This commit is contained in:
+22
-15
@@ -22,18 +22,23 @@ if OFFSET is not None:
|
||||
|
||||
#pol_done.waitValue("DONE", -1)
|
||||
|
||||
scan = ManualScan(['field', 'Energy'], ['TEY', 'I0', 'trans', 'polarization', 'polAngle', 'temperature', 'RingCurrent', 'fieldAnalogX', 'tey_norm'] , [0.0, 630.0], [0.1, 638.46], [44, 1])
|
||||
setpoints = []
|
||||
for r in RANGES:
|
||||
setpoints = setpoints + frange(r[0], r[1], r[2], True)
|
||||
|
||||
|
||||
set_preference(Preference.ENABLED_PLOTS, ['field', 'tey_norm', 'trans_norm'])
|
||||
set_preference(Preference.PLOT_TYPES, {'tey_norm':1, 'trans_norm':1})
|
||||
|
||||
scan = ManualScan(['field', 'Energy'], ['TEY', 'I0', 'trans', 'polarization', 'polAngle', 'temperature', 'RingCurrent', 'fieldAnalogX', 'tey_norm', 'trans_norm'] , [min(setpoints), min(ENERGIES)], [max(setpoints), max(ENERGIES)], [len(setpoints)-1, len(ENERGIES)-1])
|
||||
scan.start()
|
||||
|
||||
|
||||
#Dimension 1
|
||||
#RegionPositioner field
|
||||
setpoints = []
|
||||
for r in RANGES:
|
||||
setpoints = setpoints + frange(r[0], r[1], r[2], True)
|
||||
|
||||
for setpoint1 in setpoints:
|
||||
print "Field = ", setpoint1
|
||||
print "Setting field = ", setpoint1
|
||||
#PRObably not needed for newer HW
|
||||
"""
|
||||
if setpoint1 == 0.002:
|
||||
@@ -46,19 +51,20 @@ for setpoint1 in setpoints:
|
||||
caputq('X07MA-PC-PS2:SET:DMD:POINT:LFIELD_CHANGE_SLEEPOWER', '0.002')
|
||||
sleep(15.0)
|
||||
"""
|
||||
field.write(setpoint1)
|
||||
print "-"
|
||||
field_x.write(setpoint1)
|
||||
field_x.readback.waitValueInRange(setpoint1,FIELD_PRECISION,300000)
|
||||
|
||||
readback1 = field.getPosition()
|
||||
print readback1
|
||||
if abs(readback1 - setpoint1) > FIELD_PRECISION : # TODO: Check accuracy
|
||||
raise Exception('Actor field could not be set to the value ' + str(setpoint1))
|
||||
#print readback1
|
||||
#if abs(readback1 - setpoint1) > FIELD_PRECISION : # TODO: Check accuracy
|
||||
# raise Exception('Field could not be set to ' + str(setpoint1))
|
||||
time.sleep( FIELD_CHANGE_SLEEP ) # TODO: Settling time
|
||||
#Dimension 2
|
||||
#ArrayPositioner Energy
|
||||
for setpoint2 in ENERGIES:
|
||||
print "Energy = ", setpoint2
|
||||
energy.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
|
||||
readback2 = energy_readback.get()
|
||||
print "Setting energy = ", setpoint2
|
||||
energy.write(setpoint2)
|
||||
readback2 = energy_readback.read()
|
||||
if abs(readback2 - setpoint2) > 0.1 : # TODO: Check accuracy
|
||||
raise Exception('Actor Energy could not be set to the value ' + str(setpoint2))
|
||||
sleep( ENERGY_CHANGE_SLEEP ) # Settling time
|
||||
@@ -71,7 +77,8 @@ for setpoint1 in setpoints:
|
||||
detector6 = temperature.read() #temperature.get()
|
||||
detector7 = current.read()
|
||||
detector8 = signal_field_analog_x.read() # fieldAnalogX.get()
|
||||
tey_norm = detector1/detector2
|
||||
scan.append ([setpoint1, setpoint2], [readback1, readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, tey_norm])
|
||||
tey_norm = detector1/detector2
|
||||
trans_norm = detector3/detector2
|
||||
scan.append ([setpoint1, setpoint2], [readback1, readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, tey_norm, trans_norm])
|
||||
|
||||
scan.end()
|
||||
|
||||
Reference in New Issue
Block a user