GitLab will be upgraded on June 23rd evening. During the upgrade the service will be unavailable, sorry for the inconvenience.

Commit 707265bd authored by bliss administrator's avatar bliss administrator

Add script to restart mr station motors

parent 1d8f20eb
......@@ -128,3 +128,70 @@ def lbs_free_space():
mem_available = 100 - mem_use
msg = f"\n\033[1mIt remains {mem_available}% of free space on lbs\033[0m\n"
print(msg)
def restart_mr_station():
yrot = setup_globals.yrot
srot = setup_globals.srot
sz = setup_globals.sz
yrot.controller.initialize()
yrot.controller.initialize_hardware()
yrot.controller.initialize_axis(yrot)
yrot.controller._set_power(yrot,True)
yrot.controller.initialize_hardware_axis(yrot)
yrot.sync_hard()
while not 'READY' in yrot.state:
yrot.sync_hard()
yrot.controller.set_velocity(yrot,yrot.velocity*yrot.steps_per_unit)
sz.controller.initialize()
sz.controller.initialize_hardware()
sz.controller.initialize_axis(sz)
sz.controller._set_power(sz,True)
sz.controller.initialize_hardware_axis(sz)
sz.sync_hard()
while not 'READY' in sz.state:
sz.sync_hard()
sz.controller.set_velocity(sz,sz.velocity*sz.steps_per_unit)
srot.controller.initialize()
srot.controller.initialize_hardware()
srot.controller.initialize_axis(srot)
srot.controller._set_power(srot,True)
srot.controller.initialize_hardware_axis(srot)
srot.sync_hard()
while not 'READY' in srot.state:
srot.sync_hard()
srot.controller.set_velocity(srot,srot.velocity*srot.steps_per_unit)
setup_globals.init_mr_srot()
def reset_detector(*detectors):
if len(detectors) == 0:
list_det=[]
# analyse the active measurement group (ACTIVE_MG)
builder = ChainBuilder([])
for node in builder.get_nodes_by_controller_type(Lima):
list_det.append(node.controller)
if len(list_det) == 0:
raise RuntimeError(
"DETECTOR ERROR : No detector defined in the active measurement group!\n")
for detector in detectors:
detector.image.roi = [0,0,0,0]
detector.image.binning = [1,1]
detector.image.rotation = 0
detector.roi_counters.clear()
detector.roi_profiles.clear()
detector.processing.background = None
detector.processing.flatfield = None
detector.processing.use_background_substraction = "disable"
detector.processing.use_flatfield = False
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