81 lines
2.7 KiB
Python
81 lines
2.7 KiB
Python
#Parameters
|
|
"""
|
|
FIELD = "Hx"
|
|
RANGES = [(-0.1, 0.1, 0.1),]
|
|
ENERGIES = (707.90, 703.90)
|
|
ENERGY_CHANGE_SLEEP = 0.5
|
|
FIELD_CHANGE_SLEEP = 22.0
|
|
MODE = 'CIRC +'
|
|
OFFSET = -1.0
|
|
"""
|
|
|
|
|
|
FIELD_PRECISION = 0.01
|
|
field = field_z if FIELD == "Hz" else field_x
|
|
|
|
#Pre-actions
|
|
#wait_beam()
|
|
if MODE is not None:
|
|
pol_mode.write(MODE)
|
|
if OFFSET is not None:
|
|
pol_offset.write(OFFSET) #caput('X07MA-ID:ENERGY-OFFS', OFFSET)
|
|
|
|
#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])
|
|
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
|
|
#PRObably not needed for newer HW
|
|
"""
|
|
if setpoint1 == 0.002:
|
|
caputq('X07MA-PC-PS2:SET:RAMP:TARGEFIELD_CHANGE_SLEEPT', 'Zero')
|
|
sleep(6.0)
|
|
caputq('X07MA-PC-PS2:SET:RAMP:DIR', 'Forward')
|
|
sleep(6.0)
|
|
caputq('X07MA-PC-PS2:SET:RAMP:TARGET', 'Lower')
|
|
sleep(6.0)
|
|
caputq('X07MA-PC-PS2:SET:DMD:POINT:LFIELD_CHANGE_SLEEPOWER', '0.002')
|
|
sleep(15.0)
|
|
"""
|
|
field.write(setpoint1)
|
|
print "-"
|
|
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))
|
|
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()
|
|
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
|
|
|
|
detector1 = signal_tey.read() #TEY.get()
|
|
detector2 = signal_i0.read() #I0.get()
|
|
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()
|
|
detector7 = current.read()
|
|
detector8 = signal_field_analog_x.read() # fieldAnalogX.get()
|
|
c = detector1
|
|
d = detector2
|
|
tey_norm = detector1/detector2
|
|
|
|
scan.append ([setpoint1, setpoint2], [readback1, readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, tey_norm])
|
|
|
|
scan.end()
|