Skip to content

Do not try to produce selection instructions for trains not in user input data.

Oleksii Turkot requested to merge fix_missing_trains into main

While trying to reduce RAW data Janusz faced the following error:

Job started at Do 14. Mär 15:45:06 CET 2024 on max-exfl435.desy.de
 - EXFEL modulepath enabled
this is run:  0427
INFO:exdf.cli.reduce:Opened data from /gpfs/exfel/data/user/xred/data_reduction/002734_case/input_raw/r0427 containing 16 sources and 3095 trains across 208 files
INFO:spi_reduction.exdf_entry.SpiUserSlicing:Using SPIFrameSelectCFEL - reduce SPI data in CFEL format with:
    proposal_num: 2734
    base_path: '/gpfs/exfel/exp/SPB/202201/p002734/scratch/events'
Traceback (most recent call last):
  File "/gpfs/exfel/sw/software/exfel_environments/exdf-tools/bin/exdf-reduce", line 8, in <module>
    sys.exit(main())
  File "/gpfs/exfel/sw/software/exfel_environments/exdf-tools/lib/python3.9/site-packages/exdf/cli/reduce.py", line 211, in main
    method = ep.load()(inp_data, args)
  File "/gpfs/exfel/sw/software/exfel_environments/exdf-tools/lib/python3.9/site-packages/spi_reduction/exdf_entry.py", line 114, in __init__
    xfel_select = frame_selector.get_xfel_select_for_run_data(data)
  File "/gpfs/exfel/sw/software/exfel_environments/exdf-tools/lib/python3.9/site-packages/spi_reduction/user_frames_select.py", line 485, in get_xfel_select_for_run_data
    xfel_select_all = get_xfel_select_all_trains(
  File "/gpfs/exfel/sw/software/exfel_environments/exdf-tools/lib/python3.9/site-packages/spi_reduction/user_frames_select.py", line 138, in get_xfel_select_all_trains
    apply_per_train(tr_id, xfel_select)
  File "/gpfs/exfel/sw/software/exfel_environments/exdf-tools/lib/python3.9/site-packages/spi_reduction/user_frames_select.py", line 128, in apply_per_train
    select_dict[tr_id] = get_xfel_select_per_train(
  File "/gpfs/exfel/sw/software/exfel_environments/exdf-tools/lib/python3.9/site-packages/spi_reduction/user_frames_select.py", line 110, in get_xfel_select_per_train
    user_frames_range = get_train_frames_range(train_id, user_trains)
  File "/gpfs/exfel/sw/software/exfel_environments/exdf-tools/lib/python3.9/site-packages/spi_reduction/user_frames_select.py", line 36, in get_train_frames_range
    frame_start = frame_ids[0]
IndexError: index 0 is out of bounds for axis 0 with size 0

I suspect this is due to some trains in data which are missing in the user input files.

Merge request reports