Commit 95344abe authored by bliss administrator's avatar bliss administrator
Browse files

Correction of bugs in topotomo

parent 0a9de033
Pipeline #51332 passed with stages
in 4 minutes and 48 seconds
......@@ -990,7 +990,9 @@ class TopoTomo(FastTomo):
self.topo_tools = TopoTools(self.tomo)
tomo.topo_scan = None
self.topo_scan = None
super().__init__(tomo)
log_info(self, "__init__() leaving")
......@@ -1033,8 +1035,8 @@ class TopoTomo(FastTomo):
undershoot = self.tomo_scan.in_pars["scan_speed"] ** 2 / (
2 * topo_motor.acceleration
)
acc_margin = self.tomo_scan.acc_margin
if self.tomo_scan.use_step_size:
acc_margin = self.tomo.acc_margin
if self.tomo.use_step_size:
acc_margin = abs(self.tomo_scan.in_pars["scan_step_size"])
back_disp = (topo_end_pos + undershoot + acc_margin) - (
topo_start_pos + undershoot + acc_margin
......@@ -1093,7 +1095,7 @@ class TopoTomo(FastTomo):
datetime.timedelta(seconds=est_time_scan)
)
self.tomo.topo_scan = TopoScan(
self.topo_scan = TopoScan(
self.tomo,
self.nested_axis,
self.topo_start_pos,
......@@ -1101,8 +1103,6 @@ class TopoTomo(FastTomo):
self.topo_nb_points,
self.topo_musst,
)
self.tomo.topo_scan.acc_margin = self.tomo_scan.acc_margin
self.tomo.topo_scan.use_step_size = self.tomo_scan.use_step_size
if (
self.tomo.parameters.scan_type == ScanType.CONTINUOUS_HARD
......@@ -1146,7 +1146,7 @@ class TopoTomo(FastTomo):
proj_scan = None
if self.tomo.parameters.scan_type == ScanType.STEP:
proj_scan = self.tomo.topo_scan.step_scan(
proj_scan = self.topo_scan.step_scan(
start_pos,
end_pos,
nb_points,
......@@ -1158,7 +1158,7 @@ class TopoTomo(FastTomo):
)
if self.tomo.parameters.scan_type == ScanType.CONTINUOUS_HARD:
proj_scan = self.tomo.topo_scan.continuous_scan(
proj_scan = self.topo_scan.continuous_scan(
start_pos,
end_pos,
nb_points,
......@@ -1174,7 +1174,7 @@ class TopoTomo(FastTomo):
)
if self.tomo.parameters.scan_type == ScanType.CONTINUOUS_SOFT:
proj_scan = self.tomo.topo_scan.soft_scan(
proj_scan = self.topo_scan.soft_scan(
start_pos,
end_pos,
nb_points,
......@@ -1188,7 +1188,7 @@ class TopoTomo(FastTomo):
)
if self.tomo.parameters.scan_type == ScanType.SWEEP:
proj_scan = self.tomo.topo_scan.sweep_scan(
proj_scan = self.topo_scan.sweep_scan(
start_pos,
end_pos,
nb_points,
......
......@@ -170,9 +170,9 @@ class TopoScan:
# Step scan master
step_motor_master = LinearStepTriggerMaster(nb_points, self.tomo.rotation_axis, start_pos, end_pos)
acc_margin = self.acc_margin
acc_margin = self.tomo.acc_margin
if self.use_step_size:
if self.tomo.use_step_size:
# undershoot start margin is added to be sure motor will reach scan speed
acc_margin = abs(scan_step_size)
......@@ -181,10 +181,12 @@ class TopoScan:
undershoot_start_margin = acc_margin, undershoot_end_margin = acc_margin)
chain.add(step_motor_master, scan_motor_master)
scan_time = self.tomo.active_tomo.topo_tools.continuous_scan_time(self.tomo.rotation_axis, start_pos, end_pos)
scan_time = self.tomo.active_tomo.topo_tools.continuous_scan_time(self.nested_axis, start_pos, end_pos)
# prepare MUSST
accumulation = self.tomo.tomo_ccd.detector.accumulation.nb_frames
if accumulation < 0:
accumulation = 1
musst_master, musst_slave = self.topo_musst.prepare_continuous(self.start_pos, exposure_time, latency_time, self.nb_points,
scan_step_size, scan_point_time, scan_time, accumulation, trigger_type)
......@@ -274,9 +276,9 @@ class TopoScan:
# Step scan master
step_motor_master = LinearStepTriggerMaster(nb_points, self.tomo.rotation_axis, start_pos, end_pos)
acc_margin = self.acc_margin
acc_margin = self.tomo.acc_margin
if self.use_step_size:
if self.tomo.use_step_size:
# undershoot start margin is added to be sure motor will reach scan speed
acc_margin = abs(scan_step_size)
......@@ -291,7 +293,7 @@ class TopoScan:
name="fast_timer")
chain.add(scan_motor_master, scan_timer_master)
scan_time = self.tomo.active_tomo.topo_tools.continuous_scan_time(self.tomo.rotation_axis, start_pos, end_pos)
scan_time = self.tomo.active_tomo.topo_tools.continuous_scan_time(self.nested_axis, start_pos, end_pos)
# prepare MUSST
# musst acquisition device behave like musst.ct(exposure_time)
......@@ -370,9 +372,9 @@ class TopoScan:
# Step scan master
step_motor_master = LinearStepTriggerMaster(nb_points, self.tomo.rotation_axis, start_pos, end_pos)
acc_margin = self.acc_margin
acc_margin = self.tomo.acc_margin
if self.use_step_size:
if self.tomo.use_step_size:
# undershoot start margin is added to be sure motor will reach scan speed
acc_margin = abs(scan_step_size)
......@@ -390,7 +392,7 @@ class TopoScan:
# get full calculate undershoot
undershoot = scan_motor_master._undershoot
scan_time = self.tomo.active_tomo.topo_tools.sweep_scan_time(self.tomo.rotation_axis, start_pos, end_pos, npoints)
scan_time = self.tomo.active_tomo.topo_tools.sweep_scan_time(nested_axis, start_pos, end_pos, npoints)
# prepare MUSST
# acquisition device equivalent to musst.ct(exposure_time)
......
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