Commit b234d855 authored by bliss administrator's avatar bliss administrator
Browse files

Bugs correction in zseries for half-acquisition + avoid motor synchro with

musst at each stage
parent 914c0ed3
......@@ -68,6 +68,7 @@ class TomoMusst:
if sync_shut_time is not None and sync_shut_time > 0:
self.sync_shutter_active = True
self.sync_shut_time = sync_shut_time
self.motor_already_sync = False
log_info(self, "__init__() leaving")
......@@ -85,6 +86,7 @@ class TomoMusst:
// 1
)
)
self.motor_already_sync = True
def set_timer_clock(self, scan_time):
"""
......@@ -127,7 +129,8 @@ class TomoMusst:
log_info(self, "prepare_continuous() entering")
self.card.CLEAR
self.sync_motor()
if not self.motor_already_sync:
self.sync_motor()
# mot_zero is a list of encoder values corresponding to
# start position tomo parameter
......@@ -226,8 +229,9 @@ class TomoMusst:
"""
log_info(self, "prepare_sweep() entering")
self.sync_motor()
if not self.motor_already_sync:
self.sync_motor()
# mot_zero is a list of encoder values corresponding to
# start position tomo parameter
......
......@@ -190,6 +190,7 @@ class FastTomo:
Calculates parameters and contructs acquisition chain corresponding to scan type.
"""
self.tomo.tomo_tools.check_params(self.tomo.tomo_musst)
self.tomo.tomo_musst.motor_already_sync = False
self.calculate_parameters()
......@@ -663,7 +664,7 @@ class HalfTomo(FastTomo, TomoParameters):
self.tomo.tomo_musst.set_timer_back()
if self.parameters.return_to_full_frame_position:
umv(self.lat_align_axis, self.parameters.full_frame_position)
self.tomo.scan_motors.remove(self.lat_align_axis)
self.tomo.scan_motors = [self.tomo.rotation_axis]
def configure_sample_size(self, ccd_cols, pixel_size):
"""
......@@ -806,25 +807,9 @@ class ZSeries(FastTomo):
scan_info = self.tomo.meta_data.tomo_scan_info()
scan_info["technique"]["scan"]["nb_scans"] = self.nb_scans
scan_info["technique"]["scan"]["start_nb"] = self.start_nb
nb_scan_per_series = self.tomo.in_pars["nb_groups"] * 2 - 1
if self.tomo.parameters.ref_images_at_start:
nb_scan_per_series += 1
if self.tomo.parameters.dark_images_at_start:
nb_scan_per_series += 1
if self.tomo.parameters.ref_images_at_end:
nb_scan_per_series += 1
if self.tomo.parameters.dark_images_at_end:
nb_scan_per_series += 1
if self.tomo.parameters.return_images:
nb_scan_per_series += 1
ScanDisplay.NB_SCANS = self.nb_scans * nb_scan_per_series
if self.tomo.parameters.ref_images_at_start:
ScanDisplay.NB_SCANS -= 1
if self.tomo.parameters.dark_images_at_start:
ScanDisplay.NB_SCANS -= 1
ScanDisplay.NB_SCANS = self.nb_scans
ScanDisplay.SCAN_NB = 0
dataset_name = setup_globals.SCAN_SAVING.dataset_name
setup_globals.newdataset(dataset_name + "_stage" + str(0).zfill(2))
......@@ -835,8 +820,12 @@ class ZSeries(FastTomo):
)
with seq.sequence_context() as scan_seq:
ScanDisplay.SCAN_NB += 1
self.tomo.show_scan_info()
self.tomo.run_sequence(scan_seq)
if self.tomo.parameters.half_acquisition:
self.tomo.active_tomo = self.tomo.halftomo
for i in range(1, self.nb_scans):
# move Z motor
......@@ -854,7 +843,11 @@ class ZSeries(FastTomo):
)
with seq.sequence_context() as scan_seq:
ScanDisplay.SCAN_NB += 1
self.tomo.show_scan_info()
self.tomo.run_sequence(scan_seq)
if self.tomo.parameters.half_acquisition:
self.tomo.active_tomo = self.tomo.halftomo
# move back to start position
umv(self.z_axis, self.original_pos)
......@@ -866,7 +859,7 @@ class ZSeries(FastTomo):
Restores all parameters that have been modified by the zseries acquisition.
"""
self.sequence = "tomo:basic"
self.tomo.scan_motors.remove(self.z_axis)
self.tomo.scan_motors = [self.tomo.rotation_axis]
self.tomo.tomo_musst.set_timer_back()
setup_globals.newdataset(
"_".join(setup_globals.SCAN_SAVING.dataset_name.split("_")[:-1])
......@@ -1017,6 +1010,7 @@ class TopoTomo(FastTomo):
)
self.tomo.tomo_tools.check_params(self.topo_musst)
self.topo_musst.motor_already_sync = False
est_time_scan = self.estimate_scan_time(
self.topo_musst.motor,
......@@ -1158,7 +1152,7 @@ class TopoTomo(FastTomo):
"""
Restores all parameters that have been modified by the topotomo acquisition.
"""
self.tomo.scan_motors.remove(self.nested_axis)
self.tomo.scan_motors = [self.tomo.rotation_axis]
self.topo_musst.set_timer_back()
def run(self):
......
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