This commit is contained in:
@@ -779,7 +779,7 @@ class LamNI(LamNIOpticsMixin, LamniGuiTools):
|
||||
|
||||
user_input = input("Are these parameters correctly set for your scan? ")
|
||||
if user_input == "y":
|
||||
print("good then")
|
||||
print("OK. continue.")
|
||||
return
|
||||
|
||||
self.tomo_countingtime = self._get_val("<ctime> s", self.tomo_countingtime, float)
|
||||
|
||||
@@ -120,7 +120,7 @@ class FlomniInitStagesMixin:
|
||||
|
||||
|
||||
if self.OMNYTools.yesno("Init of foptz. Can the stage move to the upstream limit without collision?"):
|
||||
print("good then")
|
||||
print("OK. continue.")
|
||||
else:
|
||||
return
|
||||
|
||||
@@ -174,7 +174,7 @@ class FlomniInitStagesMixin:
|
||||
print("done")
|
||||
|
||||
if self.OMNYTools.yesno("Init of tracking stages. Did you remove the outer laser flight tubes?"):
|
||||
print("good then")
|
||||
print("OK. continue.")
|
||||
else:
|
||||
print("Stopping.")
|
||||
return
|
||||
@@ -190,7 +190,7 @@ class FlomniInitStagesMixin:
|
||||
print("done")
|
||||
|
||||
if self.OMNYTools.yesno("Init of sample stage. Is the piezo at about 0 deg?"):
|
||||
print("good then")
|
||||
print("OK. continue.")
|
||||
else:
|
||||
print("Stopping.")
|
||||
return
|
||||
@@ -207,7 +207,7 @@ class FlomniInitStagesMixin:
|
||||
|
||||
print("Initializing UPR stage.")
|
||||
if self.OMNYTools.yesno("To ensure that the end switches work, please check that they are currently not pushed. Is everything okay?"):
|
||||
print("good then")
|
||||
print("OK. continue.")
|
||||
else:
|
||||
print("Stopping.")
|
||||
return
|
||||
@@ -228,7 +228,7 @@ class FlomniInitStagesMixin:
|
||||
continue
|
||||
break
|
||||
if self.OMNYTools.yesno("Shall I start the index search?"):
|
||||
print("good then. Starting index search.")
|
||||
print("OK. continue.. Starting index search.")
|
||||
else:
|
||||
print("Stopping.")
|
||||
return
|
||||
@@ -247,7 +247,7 @@ class FlomniInitStagesMixin:
|
||||
print("done")
|
||||
|
||||
if self.OMNYTools.yesno("Init of foptx. Can the stage move to the positive limit without collision? Attention: tracker flight tube!"):
|
||||
print("good then")
|
||||
print("OK. continue.")
|
||||
else:
|
||||
print("Stopping.")
|
||||
return
|
||||
@@ -271,7 +271,7 @@ class FlomniInitStagesMixin:
|
||||
break
|
||||
|
||||
if self.OMNYTools.yesno("Start limit switch search of fopty?"):
|
||||
print("good then")
|
||||
print("OK. continue.")
|
||||
else:
|
||||
print("Stopping.")
|
||||
return
|
||||
@@ -438,7 +438,19 @@ class FlomniSampleTransferMixin:
|
||||
umv(dev.fsamx, fsamx_in)
|
||||
dev.fsamx.limits = [fsamx_in - 0.4, fsamx_in + 0.4]
|
||||
|
||||
#self.flomnigui_idle()
|
||||
print("Moving X-ray eye in.")
|
||||
|
||||
if self.OMNYTools.yesno("Please confirm that this is ok with the flight tube. This check is to be removed after commissioning", "n"):
|
||||
print("OK. continue.")
|
||||
else:
|
||||
print("Stopping.")
|
||||
raise FlomniError("Manual abort of x-ray eye in.")
|
||||
|
||||
self.feye_in()
|
||||
print("Moving X-ray optics out.")
|
||||
self.foptics_out()
|
||||
self.xrayeye_update_frame()
|
||||
|
||||
|
||||
def laser_tracker_show_all(self):
|
||||
dev.rtx.controller.laser_tracker_show_all()
|
||||
@@ -543,12 +555,6 @@ class FlomniSampleTransferMixin:
|
||||
self.flomnigui_show_cameras()
|
||||
|
||||
|
||||
if self.OMNYTools.yesno("Please confirm that there is currently no sample in the gripper. It would be dropped!", "y"):
|
||||
print("good then")
|
||||
else:
|
||||
print("Stopping.")
|
||||
raise FlomniError("The sample transfer was manually aborted.")
|
||||
|
||||
self.ftransfer_gripper_move(position)
|
||||
|
||||
self.ftransfer_controller_enable_mount_mode()
|
||||
@@ -751,7 +757,7 @@ class FlomniSampleTransferMixin:
|
||||
return
|
||||
|
||||
if self.OMNYTools.yesno("All OK? Continue?", "y"):
|
||||
print("good then")
|
||||
print("OK. continue.")
|
||||
dev.ftransy.controller.socket_put_confirmed("confirm=1")
|
||||
else:
|
||||
print("Stopping.")
|
||||
@@ -785,7 +791,7 @@ class FlomniSampleTransferMixin:
|
||||
if position == 0 and fsamx_pos > -160:
|
||||
|
||||
if self.OMNYTools.yesno("May the flomni stage be moved out for the sample change? Feedback will be disabled and alignment will be lost!", "y"):
|
||||
print("good then")
|
||||
print("OK. continue.")
|
||||
self.ftransfer_flomni_stage_out()
|
||||
else:
|
||||
print("Stopping.")
|
||||
@@ -1481,11 +1487,14 @@ class Flomni(
|
||||
return
|
||||
dev = builtins.__dict__.get("dev")
|
||||
bec = builtins.__dict__.get("bec")
|
||||
|
||||
|
||||
self.feye_out()
|
||||
tags = ["BEC_alignment_tomo", self.sample_name]
|
||||
self.write_to_scilog(
|
||||
f"Starting alignment scan. First scan number: {bec.queue.next_scan_number}.", tags
|
||||
)
|
||||
|
||||
|
||||
start_angle = 0
|
||||
|
||||
angle_end = start_angle + 180
|
||||
@@ -1514,9 +1523,8 @@ class Flomni(
|
||||
for scan_nr in range(start_scan_number, end_scan_number):
|
||||
self._write_tomo_scan_number(scan_nr, angle, 0)
|
||||
|
||||
print("Alignment scan finished. Please run SPEC_ptycho_align and load the new fit.")
|
||||
|
||||
umv(dev.fsamroy, 0)
|
||||
self.OMNYTools.printgreenbold("\n\nAlignment scan finished. Please run SPEC_ptycho_align and load the new fit.")
|
||||
|
||||
def _write_subtomo_to_scilog(self, subtomo_number):
|
||||
dev = builtins.__dict__.get("dev")
|
||||
@@ -1550,6 +1558,9 @@ class Flomni(
|
||||
|
||||
self._write_subtomo_to_scilog(subtomo_number)
|
||||
|
||||
if start_angle is not None:
|
||||
print(f"Sub tomo scan with start angle {angle} requested.")
|
||||
|
||||
if start_angle is None:
|
||||
if subtomo_number == 1:
|
||||
start_angle = 0
|
||||
@@ -1568,6 +1579,7 @@ class Flomni(
|
||||
elif subtomo_number == 8:
|
||||
start_angle = self.tomo_angle_stepsize / 8.0 * 7
|
||||
|
||||
|
||||
# _tomo_shift_angles (potential global variable)
|
||||
_tomo_shift_angles = 0
|
||||
angle_end = start_angle + 180
|
||||
@@ -1598,7 +1610,7 @@ class Flomni(
|
||||
print(f"Starting flOMNI scan for angle {angle} in subtomo {subtomo_number}")
|
||||
self._print_progress()
|
||||
while not successful:
|
||||
self.bl_chk._bl_chk_start()
|
||||
#self.bl_chk._bl_chk_start()
|
||||
if not self.special_angles:
|
||||
self._current_special_angles = []
|
||||
if self._current_special_angles:
|
||||
@@ -1621,10 +1633,10 @@ class Flomni(
|
||||
else:
|
||||
raise exc
|
||||
|
||||
if self.bl_chk._bl_chk_stop() and not error_caught:
|
||||
successful = True
|
||||
else:
|
||||
self.bl_chk._bl_chk_wait_until_recovered()
|
||||
# if self.bl_chk._bl_chk_stop() and not error_caught:
|
||||
successful = True
|
||||
# else:
|
||||
# self.bl_chk._bl_chk_wait_until_recovered()
|
||||
end_scan_number = bec.queue.next_scan_number
|
||||
for scan_nr in range(start_scan_number, end_scan_number):
|
||||
self._write_tomo_scan_number(scan_nr, angle, subtomo_number)
|
||||
@@ -1645,19 +1657,19 @@ class Flomni(
|
||||
):
|
||||
|
||||
# pylint: disable=undefined-variable
|
||||
if bec.active_account != "":
|
||||
self.tomo_id = self.add_sample_database(
|
||||
self.sample_name,
|
||||
str(datetime.date.today()),
|
||||
bec.active_account.decode(),
|
||||
bec.queue.next_scan_number,
|
||||
"flomni",
|
||||
"test additional info",
|
||||
"BEC",
|
||||
)
|
||||
self.write_pdf_report()
|
||||
else:
|
||||
self.tomo_id = 0
|
||||
# if bec.active_account != "":
|
||||
# self.tomo_id = self.add_sample_database(
|
||||
# self.sample_name,
|
||||
# str(datetime.date.today()),
|
||||
# bec.active_account,
|
||||
# bec.queue.next_scan_number,
|
||||
# "flomni",
|
||||
# "test additional info",
|
||||
# "BEC",
|
||||
# )
|
||||
# self.write_pdf_report()
|
||||
# else:
|
||||
self.tomo_id = 0
|
||||
|
||||
with scans.dataset_id_on_hold:
|
||||
if self.tomo_type == 1:
|
||||
@@ -1843,7 +1855,7 @@ class Flomni(
|
||||
|
||||
return angle, subtomo_number
|
||||
|
||||
def tomo_reconstruct(self, base_path="~/Data10/specES1"):
|
||||
def tomo_reconstruct(self, base_path="~/data/raw/logs/reconstruction_queue"):
|
||||
"""write the tomo reconstruct file for the reconstruction queue"""
|
||||
bec = builtins.__dict__.get("bec")
|
||||
self.reconstructor.write(
|
||||
|
||||
@@ -4,7 +4,7 @@ from rich import box
|
||||
from rich.console import Console
|
||||
from rich.table import Table
|
||||
|
||||
from csaxs_bec.bec_ipython_client.plugins.cSAXS import epics_put, fshclose
|
||||
from csaxs_bec.bec_ipython_client.plugins.cSAXS import epics_put
|
||||
|
||||
|
||||
class FlomniOpticsMixin:
|
||||
@@ -16,12 +16,18 @@ class FlomniOpticsMixin:
|
||||
return param.get(var)
|
||||
|
||||
def feye_out(self):
|
||||
fshclose()
|
||||
dev.omnyfsh.fshclose()
|
||||
self.foptics_in()
|
||||
self.flomnigui_show_xeyealign()
|
||||
self.xrayeye_update_frame()
|
||||
if self.OMNYTools.yesno("Did the direct beam on the xray eye disappear?"):
|
||||
print("excellent.")
|
||||
else:
|
||||
print("Aborting. With visible parts of the direct beam on the xray eye, it cannot be removed.")
|
||||
return
|
||||
feyex_out = self._get_user_param_safe("feyex", "out")
|
||||
umv(dev.feyex, feyex_out)
|
||||
|
||||
epics_put("XOMNYI-XEYE-ACQ:0", 2)
|
||||
# move rotation stage to zero to avoid problems with wires
|
||||
umv(dev.fsamroy, 0)
|
||||
# umv(dev.fttrx1, 9.2)
|
||||
|
||||
@@ -210,7 +210,7 @@ class flomniGuiTools:
|
||||
main_progress_ring.set_value(progress)
|
||||
subtomo_progress_ring.set_value(subtomo_progress)
|
||||
|
||||
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']}"
|
||||
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: {int(self.progress['subtomo_total_projections'])}"
|
||||
self.progressbar.set_center_label(text)
|
||||
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ ftransy:
|
||||
readoutPriority: baseline
|
||||
connectionTimeout: 20
|
||||
userParameter:
|
||||
sensor_voltage: -2.4
|
||||
sensor_voltage: -1.1
|
||||
ftransz:
|
||||
description: Sample transer Z
|
||||
deviceClass: csaxs_bec.devices.omny.galil.fgalil_ophyd.FlomniGalilMotor
|
||||
@@ -344,6 +344,9 @@ rtx:
|
||||
description: flomni rt
|
||||
deviceClass: csaxs_bec.devices.omny.rt.rt_flomni_ophyd.RtFlomniMotor
|
||||
deviceConfig:
|
||||
limits:
|
||||
- -200
|
||||
- 200
|
||||
axis_Id: A
|
||||
host: mpc2844.psi.ch
|
||||
port: 2222
|
||||
@@ -361,6 +364,9 @@ rty:
|
||||
description: flomni rt
|
||||
deviceClass: csaxs_bec.devices.omny.rt.rt_flomni_ophyd.RtFlomniMotor
|
||||
deviceConfig:
|
||||
limits:
|
||||
- -100
|
||||
- 100
|
||||
axis_Id: B
|
||||
host: mpc2844.psi.ch
|
||||
port: 2222
|
||||
@@ -376,6 +382,9 @@ rtz:
|
||||
description: flomni rt
|
||||
deviceClass: csaxs_bec.devices.omny.rt.rt_flomni_ophyd.RtFlomniMotor
|
||||
deviceConfig:
|
||||
limits:
|
||||
- -100
|
||||
- 100
|
||||
axis_Id: C
|
||||
host: mpc2844.psi.ch
|
||||
port: 2222
|
||||
|
||||
@@ -50,16 +50,15 @@ Manually move the gripper to a transfer position
|
||||
After the sample transfer the sample stage moved to the measurement position with your new sample. The Xray eye will automatically move in and the shutter will open. You may already see the sample in the omny xeye interface running on the windows computer.
|
||||
If you see your sample already at the approximately correct height, you can skip steps 1 to 3. Otherwise adjust the height:
|
||||
|
||||
1. `flomni.rt_feedback_disable()` disable the closed loop operation to allow movement of coarse stages
|
||||
1. `flomni.feedback_disable()` disable the closed loop operation to allow movement of coarse stages
|
||||
1. `umvr(dev.fsamy, 0.01)`, attention: unit <mm>, move the sample stage relative up (positive) or down (negative) until the sample is approximately vertically centered in xray eye screen
|
||||
1. `flomni.xrayeye_update_frame()` will update the current image on the xray eye screen
|
||||
1. `flomni.xrayeye_alignment_start()` start the coarse alignment of the sample by measuring (clicking in the X-ray eye software) the sample position at 0, 45, 90, 135, 180 degrees. Then use the matlab routine `SPEC_ptycho_align.m` to fit this data.
|
||||
1. `flomni.read_alignment_offset()` read the generated alignment data.
|
||||
1. `flomni.xrayeye_alignment_start()` start the coarse alignment of the sample by measuring (clicking in the X-ray eye software) the sample position at 0, 45, 90, 135, 180 degrees. The GUI will present a fit of this data, which is automatically loaded to BEC for aligning the sample.
|
||||
|
||||
#### Fine alignment
|
||||
|
||||
After the xrayeyealign, a fine alignment needs to be performed using ptychography.
|
||||
_To bypass the fine alignment: `feye_out`_
|
||||
_To bypass the fine alignment: `flomni.feye_out`_
|
||||
|
||||
|
||||
1. `flomni.tomo_parameters()` Adjust the ptychographic scan parameters for performing an alignment scan. Typically FOVX = FOVX(Xrayeye)+20 mu, shell step = beamsize/2.5, number of projections and tomo mode are ignored in the alignment scans.
|
||||
@@ -71,7 +70,7 @@ _To bypass the fine alignment: `feye_out`_
|
||||
Now that the sample is aligned, the tomographic measurement can be performed.
|
||||
1. `flomni.tomo_parameters()` adjust the scan parameters for the tomographic scan. This includes the parameters for ptychographic scans of projections plus the strategy for angular sampling. The vertical shift adjusts the field of view, up (positive) or down (negative). After adjusting the numbers, type again `flomni.tomo_parameters()` and verify that they are correct.
|
||||
1. `flomni.tomo_scan_projection(angle)` perform a ptychographic scan at the rotation angle <angle>. Launch the tomographic measurement by `flomni.tomo_scan()`.
|
||||
1. Before changing sample, verify that all subtomograms were completely acquired using the `tomo_recons matlab` script.
|
||||
1. Before changing sample, verify that all subtomograms were completely acquired using the tomo_reconstruction matlab script.
|
||||
|
||||
#### If something went wrong…
|
||||
|
||||
|
||||
Reference in New Issue
Block a user