Skip to content
Snippets Groups Projects

feat[jungfrau][correct]: use new correct data source and link to old data source

Merged Karim Ahmed requested to merge feat/new_corrected_data_source_jungfrau into master
1 file
+ 10
10
Compare changes
  • Side-by-side
  • Inline
rois_source = f'{params_source}:output'
rois_source = f'{params_source}:output'
if roi_definitions != [-1]:
if roi_definitions != [-1]:
# Create Instrument and Control sections to later add datasets.
# Create Instrument and Control sections to later add datasets.
outp_source = ofile.create_instrument_source(rois_source)
instr_src_group = ofile.create_instrument_source(rois_source)
ctrl_source = ofile.create_control_source(params_source)
ctrl_source = ofile.create_control_source(params_source)
for i in range(len(roi_definitions) // 6):
for i in range(len(roi_definitions) // 6):
roi_module, a1, a2, b1, b2, mean_axis = roi_definitions[i*6 : (i+1)*6]
roi_module, a1, a2, b1, b2, mean_axis = roi_definitions[i*6 : (i+1)*6]
)
)
# Add roi corrected datasets
# Add roi corrected datasets
outp_source.create_key(f'data.roi{rois_defined}.data', data=roi_data)
instr_src_group.create_key(f'data.roi{rois_defined}.data', data=roi_data)
# Add roi run control datasets.
# Add roi run control datasets.
ctrl_source.create_run_key(f'roi{rois_defined}.region', np.array([[a1, a2, b1, b2]]))
ctrl_source.create_run_key(f'roi{rois_defined}.region', np.array([[a1, a2, b1, b2]]))
instrument_channels=sorted({f'{output_src_kda}/data', f'{input_src_kda}/data'})
instrument_channels=sorted({f'{output_src_kda}/data', f'{input_src_kda}/data'})
)
)
# Create Instrument section to later add corrected datasets.
# Create Instrument section to later add corrected datasets.
outp_source = outp_file.create_instrument_source(output_src_kda)
instr_src_group = outp_file.create_instrument_source(output_src_kda)
# Create count/first datasets at INDEX source.
# Create count/first datasets at INDEX source.
outp_source.create_index(data=image_counts)
instr_src_group.create_index(data=image_counts)
# RAW memoryCell and frameNumber are not corrected. But we are storing only
# RAW memoryCell and frameNumber are not corrected. But we are storing only
# the values for the corrected trains.
# the values for the corrected trains.
outp_source.create_key(
instr_src_group.create_key(
"data.memoryCell", data=memcells,
"data.memoryCell", data=memcells,
chunks=(min(chunks_ids, memcells.shape[0]), 1))
chunks=(min(chunks_ids, memcells.shape[0]), 1))
outp_source.create_key(
instr_src_group.create_key(
"data.frameNumber", data=frame_number,
"data.frameNumber", data=frame_number,
chunks=(min(chunks_ids, frame_number.shape[0]), 1))
chunks=(min(chunks_ids, frame_number.shape[0]), 1))
# Add main corrected `data.adc`` dataset and store corrected data.
# Add main corrected `data.adc`` dataset and store corrected data.
outp_source.create_key(
instr_src_group.create_key(
"data.adc", data=data_corr,
"data.adc", data=data_corr,
chunks=(min(chunks_data, data_corr.shape[0]), *oshape[1:]))
chunks=(min(chunks_data, data_corr.shape[0]), *oshape[1:]))
outp_source.create_compressed_key(
instr_src_group.create_compressed_key(
"data.gain", data=gain_corr)
"data.gain", data=gain_corr)
outp_source.create_compressed_key(
instr_src_group.create_compressed_key(
"data.mask", data=mask_corr)
"data.mask", data=mask_corr)
# Temporary hotfix for FXE assuming this dataset is in corrected files.
# Temporary hotfix for FXE assuming this dataset is in corrected files.
outp_source.create_key(
instr_src_group.create_key(
"data.trainId", data=seq_dc.train_ids,
"data.trainId", data=seq_dc.train_ids,
chunks=(min(50, len(seq_dc.train_ids))))
chunks=(min(50, len(seq_dc.train_ids))))
Loading