Mars 2022

This commit is contained in:
gac-x07ma
2022-03-04 14:47:07 +01:00
parent ca26181ed4
commit 7aff507f60
24 changed files with 457 additions and 175 deletions

View File

@@ -125,11 +125,14 @@ print "Set energy..."
setpoint2 = ENERGIES[0]
print setpoint2
energy.write(setpoint2)
sleep( ENERGY_CHANGE_SLEEP ) # Settling time
# 2022: comment out, since write apparantly already waits for it to finish
#sleep( ENERGY_CHANGE_SLEEP ) # Settling time
wait_device(energy_done, 1 )
wait_device(pol_done, "DONE")
#wait_device(energy_done, 1 )
print "done energy"
#wait_device(pol_done, "DONE")
wait_pol_done(1.0) # 2022: new script to wait for polarization. Wait_device does not work for this channel
print "done pol"
#if WAIT_STABLE_TEMPERATURE == True:
@@ -163,8 +166,10 @@ while(True):
#Energy.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
energy.write(setpoint2)
sleep( ENERGY_CHANGE_SLEEP ) # Settling time
else:
sleep( 0.25 ) # TODO: Check
else:
#pass
#sleep( 0.25 ) # TODO: Check
sleep( 0.3 ) # TODO: Check
#TODO: change to Controlled variable?
readback2 = energy_readback.read() #EnergyReadback.get()
@@ -185,7 +190,14 @@ while(True):
detector4 = pol_mode_buffer #float(pol_mode.getPositions().index(pol_mode.readback.read())) #polarization.get()
detector5 = pol_angle_buffer #pol_angle.read() #polAngle.get()
detector6 = temperature.readback.read() #temperature.get()
detector7 = current.read()
# once in a single time, there was an error in a script related to this command, namely
# Error creating channel: ARIDI-PCT:CURRENT [current] in <script>
# eventually, there was a restart in epics from the machine side, even though the control room could not confirm that
# so, well try: except it for this (super rare!) exception
try:
detector7 = current.read()
except:
pass
detector8 = signal_field_analog_z.read() if FIELD =="Hz" else signal_field_analog_x.read() # fieldAnalogX.get()
# ESR HACK
detector9 = signal_field_analog_z.read() # USE ADC4 here as additional detector