Commit e5d40d99 authored by Jibril Mammeri's avatar Jibril Mammeri
Browse files

Add steps_per_unit property to TomoOptic, include it in scan_parameters

parent f9749468
...@@ -60,15 +60,14 @@ class TomoOptic(TomoParameters): ...@@ -60,15 +60,14 @@ class TomoOptic(TomoParameters):
self.__name = name self.__name = name
self.__config = config self.__config = config
param_defaults["manual_pixel_size"] = False param_defaults["manual_pixel_size"] = False
param_defaults["unbinned_pixel_size"] = 0 param_defaults["unbinned_pixel_size"] = 0
param_defaults["image_pixel_size"] = 0 param_defaults["image_pixel_size"] = 0
param_defaults["scintillator"] = 'None' param_defaults["scintillator"] = "None"
# Initialise the TomoParameters class # Initialise the TomoParameters class
super().__init__(param_name, param_defaults) super().__init__(param_name, param_defaults)
try: try:
self.__scintillators = config["scintillator"] self.__scintillators = config["scintillator"]
...@@ -118,10 +117,10 @@ class TomoOptic(TomoParameters): ...@@ -118,10 +117,10 @@ class TomoOptic(TomoParameters):
self.__scintillator = config["scintillator"] self.__scintillator = config["scintillator"]
except: except:
self.__scintillator = None self.__scintillator = None
try:
self.__manual_pixel_size = self.parameters.manual_pixel_size self.__focus_steps_per_unit = config["__focus_steps_per_unit"]
self.__unbinned_pixel_size = self.parameters.unbinned_pixel_size except:
self.__image_pixel_size = self.parameters.image_pixel_size self.__focus_steps_per_unit = 0
log_info(self, "__init__() leaving") log_info(self, "__init__() leaving")
...@@ -132,7 +131,7 @@ class TomoOptic(TomoParameters): ...@@ -132,7 +131,7 @@ class TomoOptic(TomoParameters):
dlg1 = UserYesNo(label="Do you want to set pixel size manually?") dlg1 = UserYesNo(label="Do you want to set pixel size manually?")
ret = display(dlg1, title="Manual Pixel Size") ret = display(dlg1, title="Manual Pixel Size")
if ret is True: if ret is True:
self.manual_pixel_size = True self.manual_pixel_size = True
dlg1 = UserFloatInput( dlg1 = UserFloatInput(
label="Unbinned pixel size in um", defval=self.unbinned_pixel_size label="Unbinned pixel size in um", defval=self.unbinned_pixel_size
...@@ -269,6 +268,20 @@ class TomoOptic(TomoParameters): ...@@ -269,6 +268,20 @@ class TomoOptic(TomoParameters):
self.__scintillator = value self.__scintillator = value
self.parameters.scintillator = value self.parameters.scintillator = value
@property
def focus_steps_per_unit(self):
"""
Returns the value of the focus steps per unit
"""
return self.__focus_steps_per_unit
@focus_steps_per_unit.setter
def focus_steps_per_unit(self, value):
"""
Sets the value of the focus steps per unit
"""
self.__focus_steps_per_unit = value
@property @property
def manual_pixel_size(self): def manual_pixel_size(self):
""" """
...@@ -408,9 +421,16 @@ class TomoOptic(TomoParameters): ...@@ -408,9 +421,16 @@ class TomoOptic(TomoParameters):
scan_params["focus_scan_steps"] = self.__focus_scan_steps scan_params["focus_scan_steps"] = self.__focus_scan_steps
scan_params["focus_lim_pos"] = self.__focus_lim_pos scan_params["focus_lim_pos"] = self.__focus_lim_pos
scan_params["focus_lim_neg"] = self.__focus_lim_neg scan_params["focus_lim_neg"] = self.__focus_lim_neg
scan_params["focus_steps_per_unit"] = self.__focus_steps_per_unit
return scan_params return scan_params
def focus_activate_config(self):
"""
Update focus motor steps per unit
"""
self.__focus_mot.steps_per_unit = self.__focus_steps_per_unit
def __info__(self): def __info__(self):
info_str = f"{self.name} optic info:\n" info_str = f"{self.name} optic info:\n"
info_str += f" description = {self.description}\n" info_str += f" description = {self.description}\n"
......
...@@ -17,4 +17,4 @@ ...@@ -17,4 +17,4 @@
focus_scan_steps: 10 focus_scan_steps: 10
focus_lim_pos: 1000 focus_lim_pos: 1000
focus_lim_neg: -1000 focus_lim_neg: -1000
steps_per_unit: 600 focus_steps_per_unit: 600
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