Commit 1861478c authored by bliss administrator's avatar bliss administrator
Browse files

Bug correction in optic parameters + pcotomo

parent 516ad6b4
Pipeline #47760 passed with stages
in 6 minutes and 7 seconds
......@@ -891,6 +891,7 @@ class TomoCcd(TomoParameters):
self.detector.proxy.saving_mode = "AUTO_FRAME"
self.detector.proxy.saving_frame_per_file = self.detector.saving.frames_per_file
self.detector.proxy.saving_directory = setup_globals.SCAN_SAVING.get_path()
self.detector.proxy.acq_mode = "SINGLE"
self.detector.prepareAcq()
self.detector.startAcq()
while self.detector.proxy.acq_status == "Running":
......
......@@ -38,7 +38,7 @@ class TomoMusst:
musst clock value before tomo acquisition
"""
def __init__(self, tomo_name, card, motor, sync_shut_time=None, *args, **kwargs):
def __init__(self, tomo_name, card, motor, *args, **kwargs):
self.name = tomo_name + ".musst"
global_map.register(self, tag=self.name)
......@@ -64,10 +64,6 @@ class TomoMusst:
self.storelist = ["timer_raw", f"{self.motor.name}_raw"]
self.tmrcfg = None
self.sync_shutter_active = False
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")
......
......@@ -188,7 +188,7 @@ class TomoOptic(TomoParameters):
# conversion in microns
ccd_ps *= 1e6
if self.parameters.manual_pixel_size:
if self.manual_pixel_size:
self.magnification = round(ccd_ps / self.unbinned_pixel_size, 3)
else:
self.unbinned_pixel_size = round(ccd_ps / self.magnification, 3)
......@@ -259,6 +259,7 @@ class TomoOptic(TomoParameters):
"""
Returns the name of the scintillator associated with the optic
"""
self.__scintillator = self.parameters.scintillator
return self.__scintillator
@scintillator.setter
......@@ -288,6 +289,7 @@ class TomoOptic(TomoParameters):
"""
Returns if pixel size is manually set or not
"""
self.__manual_pixel_size = self.parameters.manual_pixel_size
return self.__manual_pixel_size
@manual_pixel_size.setter
......@@ -303,6 +305,7 @@ class TomoOptic(TomoParameters):
"""
Returns pixel size value without binnning
"""
self.__unbinned_pixel_size = self.parameters.unbinned_pixel_size
return self.__unbinned_pixel_size
@unbinned_pixel_size.setter
......@@ -318,6 +321,7 @@ class TomoOptic(TomoParameters):
"""
Returns pixel size value without binnning
"""
self.__image_pixel_size = self.parameters.image_pixel_size
return self.__image_pixel_size
@image_pixel_size.setter
......
......@@ -18,7 +18,7 @@ class PcoTomoMusst(TomoMusst):
self.tmrcfg = None
def prepare(self,start_pos,trange,tomo_n,time,ntomo,nloop,nwait,sync_shut_angle,user_output,noread, scan_time, trigger_type=TriggerType.TIME):
self.card.ABORT
self.card.CLEAR
self.sync_motor()
#if nwait >= 0:
......@@ -26,6 +26,8 @@ class PcoTomoMusst(TomoMusst):
#self.set_timer_clock(scan_time)
self.card.TMRCFG = '10MHZ'
start_pos *= self.motor.sign
if nloop > 1:
delta = (start_pos + trange)%360
if delta > 0:
......@@ -70,14 +72,14 @@ class PcoTomoMusst(TomoMusst):
out_on_img = 0
if sync_shut_angle > 0:
sync_shut_angle = start_pos - sync_shut_angle
start_pos = (start_pos * self.motor.sign - sync_shut_angle * self.motor.sign) * self.motor.sign
start = int(start_pos*self.motor.steps_per_unit*self.motor.sign)
start = int(start_pos*self.motor.steps_per_unit)
shut = int(sync_shut_angle*self.motor.steps_per_unit)
musst_vars={'V_ZERO':0,
'V_SHUT':shut,
musst_vars={'V_SHUT':shut,
'V_TOMO':start,
'V_STEP':step,
'V_DELTA':delta,
......@@ -89,7 +91,7 @@ class PcoTomoMusst(TomoMusst):
'V_OUT_ON_LOOP':out_on_loop,
'V_OUT_ON_IMG':out_on_img
}
program_template_replacement= {'$MOTOR_CHANNEL$':'CH%d' %self.mot_chan}
if noread:
# MUSST acquisition master
......
......@@ -67,7 +67,7 @@ class PcoTomoScan:
else:
self.in_pars["sync_shut_angle"] = 0
self.watchdog_trig_difference = 1000
self.watchdog_trig_difference = 10000
self.in_pars["start_turn"] = self.calculate_undershoot(
self.tomo.rotation_axis, start_pos, time, self.tomo.pcotomo.parameters.start_turn
)
......
......@@ -14,7 +14,7 @@ class PcoTomoShutterPreset(ScanPreset):
pass
def start(self, scan):
if self.shutter.fast_shutter:
if not self.musst.sync_shutter and self.shutter.fast_shutter:
print(f"Opening the fast shutter")
self.shutter.fast_shutter_open()
......@@ -25,7 +25,7 @@ class PcoTomoShutterPreset(ScanPreset):
if self.musst.sync_shutter:
self.mux.switch("SHMODE","SOFT")
if self.shutter.fast_shutter:
if not self.musst.sync_shutter and self.shutter.fast_shutter:
print(f"Closing the fast shutter")
self.shutter.fast_shutter_close()
......
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