Commit 5fb29cf6 authored by bliss administrator's avatar bliss administrator
Browse files

Bug correction when taking dark, ref or projections without any sequence

parent 1861478c
Pipeline #47807 passed with stages
in 4 minutes and 30 seconds
......@@ -1090,18 +1090,19 @@ class Tomo(TomoParameters):
setup_globals.machinfo, checktime=dark_scan_time
)
dark_scan.acq_chain.add_preset(refill_preset)
if self.parameters.sinogram_active:
dark_spectrum_acq,= dark_scan.acq_chain.get_node_from_devices(self.tomo_ccd.detector.roi_profiles)
def sequence_channel_emit(event_dict={}, sender=None):
data = event_dict.get("data")
if data is None:
return
scan_sequence.sequence.custom_channels["dark_spectrum"].emit(data)
event.connect(dark_spectrum_acq.channels[0],"new_data",sequence_channel_emit)
# add to scan sequence when requested
if scan_sequence != None:
if self.parameters.sinogram_active:
dark_spectrum_acq,= dark_scan.acq_chain.get_node_from_devices(self.tomo_ccd.detector.roi_profiles)
def sequence_channel_emit(event_dict={}, sender=None):
data = event_dict.get("data")
if data is None:
return
scan_sequence.sequence.custom_channels["dark_spectrum"].emit(data)
event.connect(dark_spectrum_acq.channels[0],"new_data",sequence_channel_emit)
scan_sequence.add(dark_scan)
self.list_dark_scans.append(dark_scan)
......@@ -1206,19 +1207,20 @@ class Tomo(TomoParameters):
ref_scan_time = self.tomo_tools.estimate_ref_scan_duration(motor)
refill_preset = WaitForRefillPreset(setup_globals.machinfo,checktime=ref_scan_time)
ref_scan.acq_chain.add_preset(refill_preset)
if self.parameters.sinogram_active:
ref_spectrum_acq,= ref_scan.acq_chain.get_node_from_devices(self.tomo_ccd.detector.roi_profiles)
def sequence_channel_emit(event_dict={}, sender=None):
data = event_dict.get("data")
if data is None:
return
scan_sequence.sequence.custom_channels["ref_spectrum"].emit(data)
event.connect(ref_spectrum_acq.channels[0],"new_data",sequence_channel_emit)
# add to scan sequence when requested
if scan_sequence != None:
if self.parameters.sinogram_active:
ref_spectrum_acq,= ref_scan.acq_chain.get_node_from_devices(self.tomo_ccd.detector.roi_profiles)
def sequence_channel_emit(event_dict={}, sender=None):
data = event_dict.get("data")
if data is None:
return
scan_sequence.sequence.custom_channels["ref_spectrum"].emit(data)
event.connect(ref_spectrum_acq.channels[0],"new_data",sequence_channel_emit)
scan_sequence.add(ref_scan)
self.list_ref_scans.append(ref_scan)
......
......@@ -352,27 +352,28 @@ class FastTomo:
setup_globals.machinfo, checktime=proj_scan_time
)
proj_scan.acq_chain.add_preset(refill_preset)
if self.tomo.parameters.sinogram_active:
proj_spectrum_acq,= proj_scan.acq_chain.get_node_from_devices(self.tomo.tomo_ccd.detector.roi_profiles)
npixels = self.tomo.tomo_ccd.detector.roi_profiles.get_rois()[0].width
tomo_range = self.tomo.parameters.end_pos-self.tomo.parameters.start_pos
def sequence_channel_emit(event_dict={}, sender=None):
data = event_dict.get("data")
if data is None:
return
if sender == proj_spectrum_acq.channels[0]:
scan_sequence.sequence.custom_channels["proj_spectrum"].emit(data)
data = np.array([np.arange(npixels)] * len(data)).flatten()
scan_sequence.sequence.custom_channels["translation"].emit(data)
elif sender == rotation_acq.channels[0]:
scan_sequence.sequence.custom_channels["rotation"].emit(np.repeat(data%tomo_range, npixels))
event.connect(proj_spectrum_acq.channels[0],"new_data",sequence_channel_emit)
rotation_acq,= proj_scan.acq_chain.get_node_from_devices(self.tomo.rotation_axis)
event.connect(rotation_acq.channels[0],"new_data",sequence_channel_emit)
# add to scan sequence when requested
if scan_sequence != None:
if self.tomo.parameters.sinogram_active:
proj_spectrum_acq,= proj_scan.acq_chain.get_node_from_devices(self.tomo.tomo_ccd.detector.roi_profiles)
npixels = self.tomo.tomo_ccd.detector.roi_profiles.get_rois()[0].width
tomo_range = self.tomo.parameters.end_pos-self.tomo.parameters.start_pos
def sequence_channel_emit(event_dict={}, sender=None):
data = event_dict.get("data")
if data is None:
return
if sender == proj_spectrum_acq.channels[0]:
scan_sequence.sequence.custom_channels["proj_spectrum"].emit(data)
data = np.array([np.arange(npixels)] * len(data)).flatten()
scan_sequence.sequence.custom_channels["translation"].emit(data)
elif sender == rotation_acq.channels[0]:
scan_sequence.sequence.custom_channels["rotation"].emit(np.repeat(data%tomo_range, npixels))
event.connect(proj_spectrum_acq.channels[0],"new_data",sequence_channel_emit)
rotation_acq,= proj_scan.acq_chain.get_node_from_devices(self.tomo.rotation_axis)
event.connect(rotation_acq.channels[0],"new_data",sequence_channel_emit)
scan_sequence.add(proj_scan)
self.tomo.list_proj_scans.append(proj_scan)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment