Fixes & new requests

This commit is contained in:
x07maop
2017-02-08 14:03:07 +01:00
parent 15b1f51023
commit 31879d6ae2
21 changed files with 293 additions and 70 deletions

View File

@@ -10,6 +10,7 @@ OFFSET = -1.0
FIELD_PRECISION = 0.01
if FIELD == field_z: FIELD = "Hz"
field = field_z if FIELD == "Hz" else field_x
field_done = field_z_done if FIELD == "Hz" else field_x_done
ramp_rate = ramp_rate_z if FIELD == "Hz" else ramp_rate_x
@@ -34,22 +35,21 @@ 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'], [0.0, ENERGIES[0]], [0.0, ENERGIES[-1]], [0, len(ENERGIES)-1])
scan.start()
print "SKIPPED Waiting for start field"
write_logs()
for (START_FIELD, END_FIELD, RAMP_RATE) in RANGES:
ramp_rate.write(RAMP_RATE)
if abs(field.readback.read() - START_FIELD) > FIELD_PRECISION:
print "Setting start field: ", START_FIELD
field.write(START_FIELD)
time.sleep(3.0)
wait_device(field_done, 1) #ramp_done.wait_for_value(1.0)
wait_device(pol_done, "DONE")
open(2.0)
#open_valve(2.0)
print "Set end field"
print "Set end field: ", END_FIELD
field.write(END_FIELD) #caputq('X07MA-PC-PS2:M:GO.A', END_FIELD)
index = 0
@@ -72,7 +72,7 @@ for (START_FIELD, END_FIELD, RAMP_RATE) in RANGES:
detector3 = signal_trans.read() #trans.get()
detector4 = float(pol_mode.getPositions().index(pol_mode.readback.read())) #polarization.get()
detector5 = pol_angle.read() #polAngle.get()
detector6 = temperature.read() #temperature.get()
detector6 = temperature.readback.read() #temperature.get()
detector7 = current.read()
detector8 = signal_field_analog_x.read() # fieldAnalogX.get()
@@ -88,7 +88,7 @@ for (START_FIELD, END_FIELD, RAMP_RATE) in RANGES:
scan.append ([field_readback, setpoint2], [field_readback, readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, tey_norm, trans_norm])
if field_done.read() == 1: #If not ramping #ramp_done.get() == 1:
print "Not ramping, breaking execution"
print "Reached end field. Readback=", field_readback
break
index = index+1