This commit is contained in:
gac-x06da
2025-02-18 13:31:29 +01:00
committed by mohacsi_i
parent e79a3f785a
commit d8a178ae13
2 changed files with 33 additions and 27 deletions

View File

@@ -102,10 +102,6 @@ class AerotechFlyscanBase(AsyncFlyScanBase):
# Call super # Call super
yield from super().pre_scan() yield from super().pre_scan()
# def stage(self):
# """ ToDo: Sot sure if we should call super() here as it'd stage the whole beamline"""
# return super().stage()
def scan_core(self): def scan_core(self):
"""The actual scan logic comes here.""" """The actual scan logic comes here."""
# Kick off the run # Kick off the run
@@ -127,6 +123,15 @@ class AerotechFlyscanBase(AsyncFlyScanBase):
return super().cleanup() return super().cleanup()
class MeasureStandardWedge(AerotechFlyscanBase): class MeasureStandardWedge(AerotechFlyscanBase):
"""Standard wedge scan using the OMEGA motor """Standard wedge scan using the OMEGA motor

View File

@@ -17,43 +17,44 @@ def ascan(motor, scan_start, scan_end, steps, exp_time, datasource, visual=True,
if not bl_check_beam(): if not bl_check_beam():
raise RuntimeError("Beamline is not in ready state") raise RuntimeError("Beamline is not in ready state")
if visual: # if visual:
# Get or create scan specific window # # Get or create scan specific window
window = None # window = None
for _, val in bec.gui.windows.items(): # for _, val in bec.gui.windows.items():
if val.title == "CurrentScan": # if val.title == "CurrentScan":
window = val.widget # window = val.widget
window.clear_all() # window.clear_all()
if window is None: # if window is None:
window = bec.gui.new("CurrentScan") # window = bec.gui.new("CurrentScan")
# Draw a simploe plot in the window # # Draw a simploe plot in the window
dock = window.add_dock(f"ScanDisplay {motor}") # dock = window.add_dock(f"ScanDisplay {motor}")
plt1 = dock.add_widget("BECWaveformWidget") # plt1 = dock.add_widget("BECWaveformWidget")
plt1.plot(x_name=motor, y_name=datasource) # plt1.plot(x_name=motor, y_name=datasource)
plt1.set_x_label(motor) # plt1.set_x_label(motor)
plt1.set_y_label(datasource) # plt1.set_y_label(datasource)
plt1.add_dap(motor, datasource, dap="LinearModel") # plt1.add_dap(motor, datasource, dap="LinearModel")
window.show() # window.show()
print("Handing over to 'scans.line_scan'") print("Handing over to 'scans.line_scan'")
if "relative" in kwargs: if "relative" in kwargs:
del kwargs["relative"] del kwargs["relative"]
s = scans.line_scan( s = scans.line_scan(
motor, scan_start, scan_end, steps=steps, exp_time=exp_time, relative=False, **kwargs motor, scan_start, scan_end, steps=steps, exp_time=exp_time, relative=False, datasource=datasource, **kwargs
) )
if visual: # if visual:
fit = plt1.get_dap_params() # fit = plt1.get_dap_params()
else: # else:
fit = bec.dap.LinearModel.fit(s, motor.name, motor.name, datasource.name, datasource.name) # fit = bec.dap.LinearModel.fit(s, motor.name, motor.name, datasource.name, datasource.name)
# fit = bec.dap.LinearModel(motor, datasource) # fit = bec.dap.LinearModel(motor, datasource)
# If fitting via GUI # If fitting via GUI
# firt_par = plt1.get_dap_params() # firt_par = plt1.get_dap_params()
return s, fit # return s, fit
return s
# # Some basic fit # # Some basic fit
# dkey = datasource.full_name # dkey = datasource.full_name