Closedown

This commit is contained in:
gac-x09lb
2022-10-03 10:56:27 +02:00
parent aac4b91b57
commit e852f3d403
8 changed files with 144 additions and 1883 deletions
+9 -2
View File
@@ -2,9 +2,16 @@
# Deployment specific global definitions - executed after startup.py
###################################################################################################
def trig_ccd():
pass
return
if ccd.isSimulated():
time.sleep(0.1)
else:
image_id = ccd.currentImageCount
ccd.start()
ccd.waitReady(-1)
ccd.waitNewImage(3000, image_id)
def is_beam_ok():
return True
+10 -33
View File
@@ -7,40 +7,17 @@ RANGE (tuple (min, max))
STEPS (int or tuple)
LATENCY (double)
RELATIVE (BOOLEAN)
FLY_SCAN (BOOLEAN)
ENDSCAN (BOOLEAN)
"""
#set_preference(Preference.PLOT_TYPES,{'ImageIntegrator':1})
adjust_sensors()
set_adc_averaging()
set_preference(Preference.PLOT_TYPES, {'Scienta spectrum':1})
set_exec_pars(compression=True)
#Debugging
if get_exec_pars().args is None:
MOTOR = dummy_x
SENSORS = [current, ccd.dataMatrix]
RANGE = [0.0,1.0]
STEPS = 5
LATENCY = 0.1
RELATIVE = False
try:
if FLY_SCAN:
# time per scienta acquisition in seconds
trig_scienta()
time1 = time.time()
before_readout()
time.sleep(0.2)
time2 = time.time()
scienta_time = (time2 - time1) + 1.
print "step time: ", scienta_time
if isinstance(STEPS,int):
raise Exception ("Fly Scan must define step size, and not number of steps")
STEP = STEPS[0]
SPEED = STEP / scienta_time
fly_time = (RANGE[1] - RANGE[0]) / SPEED
STEPS = int(fly_time / scienta_time) + 1
print "speed: ", SPEED
print "scan time: ", fly_time
cscan(MOTOR, SENSORS, RANGE[0], RANGE[1], STEPS, LATENCY, fly_time, RELATIVE, before_read=before_readout, after_read = after_readout, check_positions = False)
else:
lscan(MOTOR, SENSORS, RANGE[0], RANGE[1], STEPS, LATENCY, RELATIVE, before_read=before_readout, after_read = after_readout)
r = lscan(MOTOR, SENSORS, RANGE[0], RANGE[1], STEPS, LATENCY, RELATIVE, before_read=before_readout, after_read = after_readout, compression=True)
finally:
if ENDSCAN:
after_scan()
after_scan()
+3 -2
View File
@@ -24,7 +24,8 @@ if get_exec_pars().args is None:
ZIGZAG = True
try:
ascan((ManipulatorPhi, ManipulatorTheta), SENSORS, (PHI_RANGE[0], THETA_RANGE[0]), (PHI_RANGE[1], THETA_RANGE[1]), STEPS, LATENCY, RELATIVE, zigzag = ZIGZAG, \
ascan((MOTORS[0], MOTORS[1]), SENSORS, (RANGE_X[0], RANGE_Y[0]), (RANGE_X[1], RANGE_Y[1]), STEPS, LATENCY, RELATIVE, zigzag = ZIGZAG, \
before_read=before_readout, after_read = after_readout, compression = True)
finally:
after_scan()
after_scan()