Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable TOF imaging output #56

Merged
merged 38 commits into from
Aug 26, 2024
Merged

Enable TOF imaging output #56

merged 38 commits into from
Aug 26, 2024

Conversation

KedoKudo
Copy link
Contributor

@KedoKudo KedoKudo commented Aug 18, 2024

Description of Pull Request

This PR introduces the following changes:

  • add new configuration file type (JSON) and mark the old text based one depreciated
  • fix output time unit in the neutron HDF5 output file (was output TPX3 internal time unit, instead of proper nano seconds)
  • for existing command line application Sophiread, add new output type, TOF imaging
    • route 1: tpx3 --> hits --> neutrons --> tiff
    • route 2: tpx3 --> hits --> tiff
    • route 3: tiff <--+-- [tpx3 --> hits --> neutrons --> tiff], accumulating mode for continuous data acquisition
❯ ./Sophiread
[2024-08-21 15:45:16.534] [info] Usage: ./Sophiread -i <input_tpx3> -H <output_hits> -E <output_events> [-u <config_file>] [-T <tof_imaging_folder>] [-f <tof_filename_base>] [-m <tof_mode>] [-d] [-v]
[2024-08-21 15:45:16.534] [info] Options:
[2024-08-21 15:45:16.534] [info]   -i <input_tpx3>          Input TPX3 file
[2024-08-21 15:45:16.534] [info]   -H <output_hits>         Output hits HDF5 file
[2024-08-21 15:45:16.534] [info]   -E <output_events>       Output events HDF5 file
[2024-08-21 15:45:16.534] [info]   -u <config_file>         User configuration JSON file (optional)
[2024-08-21 15:45:16.534] [info]   -T <tof_imaging_folder>  Output folder for TIFF TOF images (optional)
[2024-08-21 15:45:16.534] [info]   -f <tof_filename_base>   Base name for TIFF files (default: tof_image)
[2024-08-21 15:45:16.534] [info]   -m <tof_mode>            TOF mode: 'hit' or 'neutron' (default: neutron)
[2024-08-21 15:45:16.534] [info]   -d                       Enable debug logging
[2024-08-21 15:45:16.534] [info]   -v                       Enable verbose logging
[2024-08-21 15:45:16.534] [error] Error: Missing required arguments
  • add new auto reducer for VENUS's tpx3 detector
❯ ./venus_auto_reducer 
[2024-08-21 15:44:49.226] [info] Usage: ./venus_auto_reducer -i <input_dir> -o <output_dir> [-u <user_config_json>] [-f <tiff_file_name_base>] [-m <tof_mode>] [-c <check_interval>] [-v] [-d]
[2024-08-21 15:44:49.226] [info] Options:
[2024-08-21 15:44:49.226] [info]   -i <input_dir>    Input directory with TPX3 files
[2024-08-21 15:44:49.226] [info]   -o <output_dir>   Output directory for TIFF files
[2024-08-21 15:44:49.226] [info]   -u <config_file>  User configuration JSON file (optional)
[2024-08-21 15:44:49.226] [info]   -f <tiff_base>    Base name for TIFF files (default: tof_image)
[2024-08-21 15:44:49.226] [info]   -m <tof_mode>     TOF mode: 'hit' or 'neutron' (default: neutron)
[2024-08-21 15:44:49.226] [info]   -c <interval>     Check interval in seconds (default: 5)
[2024-08-21 15:44:49.226] [info]   -d                Debug output
[2024-08-21 15:44:49.226] [info]   -v                Verbose output
[2024-08-21 15:44:49.226] [error] Error: Missing required arguments

Purpose of work

The main objective of this PR is to enable TOF imaging output after the neutron event has been processed.
The instrument team has the following requirements:

  • 2D histograms with tunable TOF binning parameters
  • The 2D histograms can be from neutrons (for analysis) or hits (for quick check)
  • A spectral file must be present along the corresponding TOF images (tiff format)

Test instructions

  • check out the branch and setup/enable the dev environment
  • build the branch and run unit test with ctest -V --output-on-failure
  • run the following code
    • ./Sophiread -i data/HV2700_1500_500_THLrel_274_sophy_chopper_60Hz_4.1mm_aperture_siemen_star_120s_000000.tpx3 -T tiffout_hit -m hit -v -d
    • ./Sophiread -i data/HV2700_1500_500_THLrel_274_sophy_chopper_60Hz_4.1mm_aperture_siemen_star_120s_000000.tpx3 -T tiffout_neutron -m neutron -v -d`
  • verify we have 1500 tiff images and a tof_image_Spectra.txt file in the folder
  • return the previous code
  • verify that the count in tof_image_Spectra.txt is doubled (accumulating mode)

EWM item: Story 6682

@KedoKudo KedoKudo changed the title [WIP] Enable TOF imaging output Enable TOF imaging output Aug 20, 2024
@KedoKudo KedoKudo self-assigned this Aug 21, 2024
Copy link

@peterfpeterson peterfpeterson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good enough. Some issues were created in the repository for some follow up work.

@KedoKudo KedoKudo merged commit bf23ec4 into next Aug 26, 2024
1 check passed
@KedoKudo KedoKudo deleted the tof_imaging branch August 26, 2024 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants