Skip to content

[Jungfrau][CORRECT] Explicitly ingore voview on read

Cyril Danilevski requested to merge fix/jf_vo_view_handling into master

Description

HED validates raw runs, creating a voview file in the process. EXtra-data then uses this to open the run, but this doesn't work as a context manager.
This MR ignores the voview.

The issue really is in Extra-data, where I will propose a fix as well.

How Has This Been Tested?

This can be tested with the following as first notebook cell:

in_folder = "/gpfs/exfel/exp/HED/202330/p900338/raw"  # the folder to read data from, required
out_folder =  "/gpfs/exfel/data/scratch/danilevc/test/remove"  # the folder to output to, required
run = 51  # run to process, required
metadata_folder = ""  # Directory containing calibration_metadata.yml when run by xfel-calibrate
sequences = [-1]  # sequences to correct, set to [-1] for all, range allowed
sequences_per_node = 1  # number of sequence files per cluster node if run as slurm job, set to 0 to not run SLURM parallel

# Parameters used to access raw data.
karabo_id = "HED_IA1_JF500K1"  # karabo prefix of Jungfrau devices
karabo_da = ['JNGFR01']  # data aggregators
receiver_template = "JNGFR{:02d}"  # Detector receiver template for accessing raw data files. e.g. "JNGFR{:02d}"
instrument_source_template = '{}/DET/{}:daqOutput'  # template for source name (filled with karabo_id & receiver_id). e.g. 'SPB_IRDA_JF4M/DET/JNGFR01:daqOutput'
ctrl_source_template = '{}/DET/CONTROL'  # template for control source name (filled with karabo_id_control)
karabo_id_control = ""  # if control is on a different ID, set to empty string if it is the same a karabo-id

# Parameters for calibration database.
use_dir_creation_date = True  # use the creation data of the input dir for database queries
cal_db_interface = "tcp://max-exfl016:8017#8025" # the database interface to use
cal_db_timeout = 180000  # timeout on caldb requests

# Parameters affecting corrected data.
relative_gain = True  # do relative gain correction.
strixel_sensor = True  # reordering for strixel detector layout.
strixel_double_norm = 2.0  # normalization to use for double-size pixels, only applied for strixel sensors.
limit_trains = 0  # ONLY FOR TESTING. process only first N trains, Use 0 to process all.
chunks_ids = 32  # HDF chunk size for memoryCell and frameNumber.
chunks_data = 1  # HDF chunk size for pixel data in number of frames.

# Parameters for retrieving calibration constants
manual_slow_data = False  # if true, use manually entered bias_voltage, integration_time, gain_setting, and gain_mode values
integration_time = 4.96  # integration time in us, will be overwritten by value in file
gain_setting = 0  # 0 for dynamic gain, 1 for dynamic HG0, will be overwritten by value in file
gain_mode = 0  # 0 for runs with dynamic gain setting, 1 for fixgain. It will be overwritten by value in file, if manual_slow_data is set to True.
mem_cells = -1  # Set mem_cells to -1 to automatically use the value stored in RAW data.
bias_voltage = 180  # will be overwritten by value in file

# Parameters for plotting
skip_plots = False  # exit after writing corrected files
plot_trains = 500  # Number of trains to plot for RAW and CORRECTED plots. Set to -1 to automatically plot all trains.
cell_id_preview = 15  # cell Id used for preview in single-shot plots

# Parameters for ROI selection and reduction
roi_definitions = [-1]  # List with groups of 6 values defining ROIs, e.g. [3, 120, 180, 200, 550, -2] for module 3 (JNGFR03), slice 120:180, 200:550, average along axis -2 (slow scan, or -1 for fast scan)

def balance_sequences(in_folder, run, sequences, sequences_per_node, karabo_da):
    from xfel_calibrate.calibrate import balance_sequences as bs
    return bs(in_folder, run, sequences, sequences_per_node, karabo_da)

Before the fix, it will fail while creating figures after correction.
With the fix, the notebook runs to its end successfully.

Relevant Documents (optional)

HED_IA1_JF500K1_correct_900338_r52_230123_113529.pdf shows the error in action.

HED_IA1_JF500K1_correct_900338_r52_230123_135630.pdf is the same run with the fix applied, running correctly.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.

Reviewers

@ahmedk @schmidtp

Merge request reports