Skip to content

Error with bunch pattern missing

run 31, proposal 900237 was recorded without the bunch pattern table. An error is thrown when using the ToolBox load function:

---------------------------------------------------------------------------
SourceNameError                           Traceback (most recent call last)
<ipython-input-9-0467a08f7eb6> in <module>
----> 1 run, ds = tb.load(proposal, runNB, "Vertical_FDM")

~/ToolBox_SCS/src/toolbox_scs/load.py in load(proposalNB, runNB, fields, subFolder, display, validate, subset, rois, extract_tim, extract_laser, extract_xgm, extract_bam, tim_bp, laser_bp)
    132     run_mnemonics = mnemonics_for_run(run)
    133     # load pulse pattern info
--> 134     bpt = load_bpt(run, run_mnemonics=run_mnemonics)
    135     if bpt is None:
    136         log.warning('Bunch pattern table not found in run. Skipping!')

~/ToolBox_SCS/src/toolbox_scs/load.py in load_bpt(run, merge_with, run_mnemonics)
    413         if key in run_mnemonics:
    414             bpt = run.get_array(*run_mnemonics[key].values(),
--> 415                                 name='bunchPatternTable')
    416             log.debug(f'Loaded {key} from DataCollection.')
    417             return bpt

/gpfs/exfel/sw/software/xfel_anaconda3/1.1.2/lib/python3.7/site-packages/extra_data/reader.py in get_array(self, source, key, extra_dims, roi, name)
    496             roi = roi.value
    497 
--> 498         return self._get_key_data(source, key).xarray(
    499             extra_dims=extra_dims, roi=roi, name=name)
    500 

/gpfs/exfel/sw/software/xfel_anaconda3/1.1.2/lib/python3.7/site-packages/extra_data/reader.py in _get_key_data(self, source, key)
    227 
    228     def _get_key_data(self, source, key):
--> 229         return self._get_source_data(source)[key]
    230 
    231     def _get_source_data(self, source):

/gpfs/exfel/sw/software/xfel_anaconda3/1.1.2/lib/python3.7/site-packages/extra_data/reader.py in _get_source_data(self, source)
    235             section = 'INSTRUMENT'
    236         else:
--> 237             raise SourceNameError(source)
    238 
    239         files = self._source_index[source]

SourceNameError: This data has no source named 'SA3_BR_UTC/TSYS/TIMESERVER:outputBunchPattern'.
See data.all_sources for available sources.

After inspection, the problem comes from the function mnemonics_for_run function that was recently modified (!159 (merged)) and that does not systematically check if the mnemonics are included in the run.

Spotted by @carleyr

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information