first test of gui and xray script
All checks were successful
CI for csaxs_bec / test (push) Successful in 1m25s

This commit is contained in:
x01dc
2025-11-21 16:55:04 +01:00
parent 1a105092df
commit 2020a76536
2 changed files with 32 additions and 22 deletions

View File

@@ -37,24 +37,22 @@ class flomniGuiTools:
def flomnigui_raise(self):
self.gui.flomni.raise_window()
# def flomnigui_show_xeyealign(self):
# self.flomnigui_show_gui()
# if self.xeyegui is None:
# self.flomnigui_remove_all_docks()
# self.xeyegui = self.gui.flomni.new("xeyegui").new("XRayEye")
# # start live
# if not dev.cam_xeye.live_mode:
# dev.cam_xeye.live_mode = True
def flomnigui_show_xeyealign(self):
self.flomnigui_show_gui()
if self._flomnigui_check_attribute_not_exists("xeyegui"):
self.flomnigui_remove_all_docks()
self.xeyegui = self.gui.flomni.new("xeyegui").new("XRayEye")
# start live
if not dev.cam_xeye.live_mode:
dev.cam_xeye.live_mode = True
# start live
if not dev.cam_xeye.live_mode:
dev.cam_xeye.live_mode = True
self.xeyegui.switch_tab('alignment')
def flomnigui_show_xeyealign_fittab(self):
self.flomnigui_show_gui()
if self._flomnigui_check_attribute_not_exists("xeyegui"):
self.flomnigui_remove_all_docks()
self.xeyegui = self.gui.flomni.new("xeyegui").new("XRayEye")
self.xeyegui.switch_tab('fit')
def _flomnigui_check_attribute_not_exists(self, attribute_name):
if hasattr(self.gui,"flomni"):
@@ -156,8 +154,8 @@ class flomniGuiTools:
)
self.progressbar.set_value([progress, subtomo_progress, 0])
if self.text_box is not None:
text = f"Progress report:\n Tomo type: ....................... {self.progress['tomo_type']}\n Projection: ...................... {self.progress['projection']:.0f}\n Total projections expected ....... {self.progress['total_projections']}\n Angle: ........................... {self.progress['angle']}\n Current subtomo: ................. {self.progress['subtomo']}\n Current projection within subtomo: {self.progress['subtomo_projection']}\n Total projections per subtomo: ... {self.progress['subtomo_total_projections']}"
self.text_box.set_plain_text(text)
text = f"Progress report:\n Tomo type: ....................... {self.progress['tomo_type']}\n Projection: ...................... {self.progress['projection']:.0f}\n Total projections expected ....... {self.progress['total_projections']}\n Angle: ........................... {self.progress['angle']}\n Current subtomo: ................. {self.progress['subtomo']}\n Current projection within subtomo: {self.progress['subtomo_projection']}\n Total projections per subtomo: ... {self.progress['subtomo_total_projections']}"
self.text_box.set_plain_text(text)
if __name__ == "__main__":

View File

@@ -103,7 +103,7 @@ class XrayEyeAlign:
epics_put("XOMNYI-XEYE-MESSAGE:0.DESC", msg)
def align(self,keep_shutter_open=False):
dev.omny_xray_gui.fov_array.put(np.zeros((2, 5))) #reset the fov array
#dev.omny_xray_gui.fov_array.put(np.zeros((2, 5))) #reset the fov array
if not keep_shutter_open:
print("This routine can be called with paramter keep_shutter_open=True to keep the shutter always open")
self.send_message("Getting things ready. Please wait...")
@@ -275,11 +275,23 @@ class XrayEyeAlign:
with open(file, "w") as alignment_values_file:
alignment_values_file.write("angle\thorizontal\n")
fovx_array = np.array()
for k in range(1, 6):
fovx_offset = self.alignment_values[0] - self.alignment_values[k]
fovx_x = (k - 1) * 45
fovx_array = np.append(fovx_array, [fovx_x, fovx_offset * 1000])
fovx_offsets = np.zeros(5) # holds offsets for k = 1..5
print(f"Writing to file new alignment: number {k}, value x {fovx_offset}")
alignment_values_file.write(f"{(k-1)*45}\t{fovx_offset*1000}\n")
dev.omny_xray_gui.fov_array.put(fovx_array.reshape((2, 5)))
for k in range(1, 6):
fovx_offset = self.alignment_values[0] - self.alignment_values[k]
fovx_offsets[k-1] = fovx_offset # store in array
fovx_x = (k - 1) * 45
fovx_array = np.append(fovx_array, [fovx_x, fovx_offset * 1000])
print(f"Writing to file new alignment: number {k}, value x {fovx_offset}")
alignment_values_file.write(f"{fovx_x}\t{fovx_offset*1000}\n")
# Now build your final numpy array:
data = np.array([
[0, 45, 90, 135, 180], # angles
fovx_offsets, # <-- your computed fovx_offset values
[0, 0, 0, 0, 0] # some other row
])
dev.omny_xray_gui.fit_array.put(data)
self.flomni.flomnigui_show_xeyealign_fittab()