Closedown
This commit is contained in:
+18
-27
@@ -29,37 +29,32 @@ def getNewestFile():
|
||||
return None
|
||||
newest = getNewestFile()
|
||||
|
||||
def wait_channel(name, value, type):
|
||||
print "Waiting " + str(name) + " = " + str(value)
|
||||
cawait(name, value, type = type)
|
||||
print "Done"
|
||||
|
||||
|
||||
#Pre-actions
|
||||
#wait_channel('ACOAU-ACCU:OP-MODE', 'Light Available', type = 's')
|
||||
wait_beam()
|
||||
if MODE is not None:
|
||||
pol_mode.write(MODE)
|
||||
time.sleep(1.0)
|
||||
pol_mode.write(MODE) #caput('X07MA-ID:MODE', MODE) #TODO: CAPUT
|
||||
time.sleep(1.0) #TODO: Needed?
|
||||
if MODE == 'LINEAR':
|
||||
pol_angle.write(ALPHA)
|
||||
wait_device(pol_done,"DONE")
|
||||
if OFFSET is not None:
|
||||
caput('X07MA-ID:ENERGY-OFFS', OFFSET)
|
||||
wait_device(pol_done,"DONE")
|
||||
if ALPHA is not None:
|
||||
pol_angle.write(ALPHA) #TODO: CAPUT
|
||||
pol_done.waitValue("DONE") #TODO: NEEDED?
|
||||
if OFFSET is not None:
|
||||
pol_offset.write(OFFSET) #TODO: CAPUT
|
||||
pol_done.waitValue("DONE")
|
||||
|
||||
caput('E1', E1)
|
||||
caput('E2', E2)
|
||||
caput('TIME', TIME)
|
||||
caput('FOLDER', FOLDER)
|
||||
caputq('X07MA-PHS-E:GO.A', E1)
|
||||
wait_channel('X07MA-PHS:alldone', '1', type = 's')
|
||||
time.sleep(0.5)
|
||||
set_energy (E1)
|
||||
caput('FILE', FILE)
|
||||
time.sleep(0.1)
|
||||
caput('X07MA-OP-VG13:WT_SET', 'Try open')
|
||||
time.sleep(5.0)
|
||||
caput('X07MA-OP-VG13:WT_SET', 'Try open')
|
||||
if DELAY is not None:
|
||||
time.sleep(DELAY)
|
||||
|
||||
open_valve()
|
||||
open_valve(0.0) #TODO: WHY WRITING AGAIN???
|
||||
|
||||
time.sleep(DELAY)
|
||||
|
||||
caput('START', '1')
|
||||
|
||||
#Post-actions
|
||||
@@ -71,7 +66,6 @@ print "Finished Energy scan"
|
||||
|
||||
#File convertion
|
||||
newName = folder + time.strftime("%Y%m%d_%H%M_", start) + FILE + "_0000.txt";
|
||||
#name = caget("MSG").split(' ')[0]
|
||||
name = getNewestFile()
|
||||
|
||||
if name == newest:
|
||||
@@ -80,10 +74,7 @@ if name == newest:
|
||||
if not os.path.isfile(name):
|
||||
raise Exception("Data file not found: " + name)
|
||||
|
||||
cmd = "/sls/X07MA/data/x07maop/bin/modify_otf.pl " + name + " " + newName;
|
||||
print("Converting data file: " + cmd);
|
||||
import os
|
||||
os.system(cmd)
|
||||
convert_file(name, newName)
|
||||
print("Success")
|
||||
|
||||
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
#Script imported from: MgE_plus.xml
|
||||
|
||||
#Parameters
|
||||
"""
|
||||
E1 = 710
|
||||
E2 = 720
|
||||
TIME = 1 #min
|
||||
DELAY = 10.0 #s
|
||||
MODE = 'CIRC +'
|
||||
OFFSET = -9.0
|
||||
FOLDER = '2015_04/20150417'
|
||||
FILE = 'Fe_plus'
|
||||
ALPHA=0
|
||||
"""
|
||||
|
||||
|
||||
print "\nStarting energy scan - Parameters: ",
|
||||
print E1,E2,TIME,DELAY,MODE ,OFFSET ,FOLDER ,FILE ,ALPHA
|
||||
|
||||
start = time.localtime()
|
||||
|
||||
folder = os.path.expanduser("~/Data1/") + FOLDER + "/";
|
||||
def getNewestFile():
|
||||
global folder
|
||||
import glob
|
||||
try:
|
||||
return max(glob.iglob(folder+'/*.txt'), key=os.path.getctime)
|
||||
except:
|
||||
return None
|
||||
newest = getNewestFile()
|
||||
|
||||
#Pre-actions
|
||||
wait_beam()
|
||||
|
||||
pol_mode.write(MODE) #caput('X07MA-ID:MODE', MODE) #TODO: CAPUT
|
||||
time.sleep(1.0) #TODO: Needed?
|
||||
if MODE == 'LINEAR':
|
||||
pol_angle.write(ALPHA) #TODO: CAPUT
|
||||
pol_done.waitValue("DONE") #TODO: NEEDED?
|
||||
pol_offset.write(OFFSET) #TODO: CAPUT
|
||||
pol_done.waitValue("DONE")
|
||||
|
||||
caput('E1', E1)
|
||||
caput('E2', E2)
|
||||
caput('TIME', TIME)
|
||||
caput('FOLDER', FOLDER)
|
||||
set_energy (E1)
|
||||
#caputq('X07MA-PHS-E:GO.A', E1)
|
||||
#wait_channel('X07MA-PHS:alldone', '1', type = 's')
|
||||
#time.sleep(0.5)
|
||||
caput('FILE', FILE)
|
||||
time.sleep(0.1)
|
||||
|
||||
open_valve()
|
||||
open_valve(0.0) #TODO: WHY WRITING AGAIN???
|
||||
#caput('X07MA-OP-VG13:WT_SET', 'Try open')
|
||||
#time.sleep(5.0)
|
||||
#caput('X07MA-OP-VG13:WT_SET', 'Try open')
|
||||
|
||||
time.sleep(DELAY)
|
||||
|
||||
caput('START', '1')
|
||||
|
||||
#Post-actions
|
||||
wait_channel('START', 'STOP', type = 's')
|
||||
|
||||
time.sleep(2.0)
|
||||
print "Finished Energy scan"
|
||||
|
||||
|
||||
#File convertion
|
||||
newName = folder + time.strftime("%Y%m%d_%H%M_", start) + FILE + "_0000.txt";
|
||||
#name = caget("MSG").split(' ')[0]
|
||||
name = getNewestFile()
|
||||
|
||||
if name == newest:
|
||||
raise Exception("Data file not created")
|
||||
|
||||
if not os.path.isfile(name):
|
||||
raise Exception("Data file not found: " + name)
|
||||
|
||||
#cmd = "/sls/X07MA/data/x07maop/bin/modify_otf.pl " + name + " " + newName;
|
||||
#print("Converting data file: " + cmd);
|
||||
#import os
|
||||
#os.system(cmd)
|
||||
|
||||
convert_file(name, newName)
|
||||
|
||||
print("Success")
|
||||
|
||||
|
||||
+35
-103
@@ -1,7 +1,6 @@
|
||||
#Script imported from: Fe_hyst_plus.xml
|
||||
|
||||
#Parameters
|
||||
"""
|
||||
FIELD = "Hx"
|
||||
START_FIELD = -0.1
|
||||
END_FIELD = 0.1
|
||||
ENERGIES = (707.90, 703.90)
|
||||
@@ -13,14 +12,21 @@ OFFSET = -1.0
|
||||
|
||||
|
||||
FIELD_PRECISION = 0.01
|
||||
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
|
||||
|
||||
#Pre-actions
|
||||
cawait('ACOAU-ACCU:OP-MODE', 'Light Available', type = 's')
|
||||
caput('X07MA-ID:MODE', MODE)
|
||||
caput('X07MA-ID:ENERGY-OFFS', OFFSET)
|
||||
#cawait('ACOAU-ACCU:OP-MODE', 'Light Available', type = 's')
|
||||
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)
|
||||
caputq('X07MA-PC:CSCALER.INPB', '1')
|
||||
caputq('X07MA-PC-PS2:SET:DMD:RAMPRATE:TPM', RAMP_RATE)
|
||||
#sleep(15.0)
|
||||
if RAMP_RATE is not None:
|
||||
ramp_rate.write(RAMP_RATE)
|
||||
|
||||
|
||||
if len(ENERGIES) ==2:
|
||||
dif_series = plot([],"Dif", context="Dif")[0].getSeries(0)
|
||||
@@ -30,61 +36,24 @@ else:
|
||||
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'])
|
||||
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()
|
||||
|
||||
#Stop condition
|
||||
ramp_done = Channel('X07MA-PC-MAG:X:RAMP:DONE', type = 'i')
|
||||
|
||||
#Creating channels: dimension 1
|
||||
#RegionPositioner field
|
||||
#field = Channel('X07MA-PC:GO', type = 'd')
|
||||
fieldReadback = Channel('X07MA-PC-PS2:STS:PMCURRENT', type = 'd')
|
||||
#Creating channels: dimension 2
|
||||
#ArrayPositioner Energy
|
||||
Energy = Channel('X07MA-PHS-E:GO.A', type = 'd')
|
||||
EnergyReadback = Channel('X07MA-PGM:CERBK', type = 'd')
|
||||
#ScalarDetector TEY
|
||||
TEY = Channel('X07MA-ES1-AI:SIGNAL0', type = 'd')
|
||||
#ScalarDetector I0
|
||||
I0 = Channel('X07MA-ES1-AI:SIGNAL1', type = 'd')
|
||||
#ScalarDetector trans
|
||||
trans = Channel('X07MA-ES1-AI:SIGNAL2', type = 'd')
|
||||
#ScalarDetector polarization
|
||||
polarization = Channel('X07MA-ID:MODE', type = 'd')
|
||||
#ScalarDetector polAngle
|
||||
polAngle = Channel('X07MA-ID:ALPHA', type = 'd')
|
||||
#ScalarDetector temperature
|
||||
temperature = Channel('X07MA-PC-TC:STS:T1', type = 'd')
|
||||
#ScalarDetector RingCurrent
|
||||
RingCurrent = Channel('ARIDI-PCT:CURRENT', type = 'd')
|
||||
#ScalarDetector fieldAnalogX
|
||||
fieldAnalogX = Channel('X07MA-ES1-AI:SIGNAL4', type = 'd')
|
||||
|
||||
|
||||
print "SKIPPED Waiting for start field"
|
||||
|
||||
|
||||
#if abs(fieldReadback.get() - START_FIELD) > FIELD_PRECISION:
|
||||
# caput('X07MA-PC-PS2:M:GO.A', START_FIELD)
|
||||
if abs(field.readback.read() - START_FIELD) > FIELD_PRECISION:
|
||||
field.write(START_FIELD)
|
||||
|
||||
|
||||
field_done.waitValue(1) #ramp_done.wait_for_value(1.0)
|
||||
pol_done.waitValue("DONE")
|
||||
|
||||
#caput("X07MA-PC-MAG:X:DMD", START_FIELD)
|
||||
#caput("X07MA-PC-MAG:STARTRAMP.PROC", 1)
|
||||
|
||||
ramp_done.wait_for_value(1.0)
|
||||
|
||||
cawait('X07MA-ID:DONE', 'DONE', type = 's')
|
||||
|
||||
caput('X07MA-OP-VG13:WT_SET', 'Try open')
|
||||
time.sleep(2.0)
|
||||
open(2.0)
|
||||
|
||||
print "Set end field"
|
||||
#caput("X07MA-PC-MAG:X:DMD", END_FIELD)
|
||||
#caputq("X07MA-PC-MAG:STARTRAMP.PROC", 1)
|
||||
caputq('X07MA-PC-PS2:M:GO.A', END_FIELD)
|
||||
field.write(END_FIELD) #caputq('X07MA-PC-PS2:M:GO.A', END_FIELD)
|
||||
|
||||
|
||||
|
||||
@@ -93,79 +62,42 @@ index = 0
|
||||
while(True):
|
||||
#Dimension 2START_FIELD = -0.2
|
||||
#ArrayPositioner Energy
|
||||
for setpoint2 in ENERGIES:
|
||||
Energy.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
|
||||
for setpoint2 in ENERGIES:
|
||||
#Energy.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
|
||||
energy.write(setpoint2)
|
||||
sleep( ENERGY_CHANGE_SLEEP ) # Settling time
|
||||
|
||||
readback2 = EnergyReadback.get()
|
||||
#TODO: change to Controlled variable?
|
||||
readback2 = energy_readback.read() #EnergyReadback.get()
|
||||
if abs(readback2 - setpoint2) > 0.1 : # TODO: Check accuracy
|
||||
raise Exception('Actor Energy could not be set to the value ' + str(setpoint2))
|
||||
raise Exception('Energy could not be set to the value ' + str(setpoint2))
|
||||
|
||||
#Detector field readback
|
||||
field_readback = fieldReadback.get()
|
||||
field_readback = field.readback.read() #fieldReadback.get()
|
||||
|
||||
#Detector TEY
|
||||
detector1 = TEY.get()
|
||||
#Detector I0
|
||||
detector2 = I0.get()
|
||||
#Detector trans
|
||||
detector3 = trans.get()
|
||||
#Detector polarization
|
||||
detector4 = polarization.get()
|
||||
#Detector polAngle
|
||||
detector5 = polAngle.get()
|
||||
#Detector temperature
|
||||
detector6 = temperature.get()
|
||||
#Detector RingCurrent
|
||||
detector7 = RingCurrent.get()
|
||||
#Detector fieldAnalogX
|
||||
detector8 = fieldAnalogX.get()
|
||||
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()
|
||||
|
||||
|
||||
#Manipulation tey_norm
|
||||
#Variable Mappings
|
||||
|
||||
#TODO: Move, if needed, this import to the file header: import math
|
||||
tey_norm = detector1/detector2
|
||||
|
||||
#Manipulation trans_norm
|
||||
#Variable Mappings
|
||||
|
||||
#TODO: Move, if needed, this import to the file header: import math
|
||||
trans_norm = detector3/detector2
|
||||
|
||||
|
||||
if dif_series is not None:
|
||||
if setpoint2 == ENERGIES[0]:
|
||||
first = tey_norm
|
||||
else:
|
||||
dif = tey_norm-first
|
||||
dif_series.appendData(field_readback,dif)
|
||||
#print [field_readback, setpoint2]
|
||||
#print [field_readback, readback2]
|
||||
#print [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, tey_norm, trans_norm]
|
||||
scan.append ([field_readback, setpoint2], [field_readback, readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, tey_norm, trans_norm])
|
||||
|
||||
|
||||
#print "Field = " + str(fieldReadback.get())
|
||||
if ramp_done.get() == 1: #If not ramping
|
||||
if field_done.read() == 1: #If not ramping #ramp_done.get() == 1:
|
||||
print "Not ramping, breaking execution"
|
||||
break
|
||||
index = index+1
|
||||
|
||||
#Closing channels
|
||||
Energy.close()
|
||||
EnergyReadback.close()
|
||||
TEY.close()
|
||||
I0.close()
|
||||
trans.close()
|
||||
polarization.close()
|
||||
polAngle.close()
|
||||
temperature.close()
|
||||
RingCurrent.close()
|
||||
fieldAnalogX.close()
|
||||
#field.close()
|
||||
fieldReadback.close()
|
||||
ramp_done.close()
|
||||
|
||||
scan.end()
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
#Script imported from: Fe_hyst_plus.xml
|
||||
|
||||
#Parameters
|
||||
"""
|
||||
START_FIELD = -0.1
|
||||
END_FIELD = 0.1
|
||||
ENERGIES = (707.90, 703.90)
|
||||
RAMP_RATE = 0.2
|
||||
ENERGY_CHANGE_SLEEP = 0.5
|
||||
MODE = 'CIRC +'
|
||||
OFFSET = -1.0
|
||||
"""
|
||||
|
||||
|
||||
FIELD_PRECISION = 0.01
|
||||
|
||||
#Pre-actions
|
||||
#cawait('ACOAU-ACCU:OP-MODE', 'Light Available', type = 's')
|
||||
wait_beam()
|
||||
|
||||
pol_mode.write(MODE)
|
||||
pol_offset.write(OFFSET) #caput('X07MA-ID:ENERGY-OFFS', OFFSET)
|
||||
caputq('X07MA-PC:CSCALER.INPB', '1')
|
||||
ramp_rate.write(RAMP_RATE)
|
||||
|
||||
|
||||
if len(ENERGIES) ==2:
|
||||
dif_series = plot([],"Dif", context="Dif")[0].getSeries(0)
|
||||
else:
|
||||
dif_series = None
|
||||
|
||||
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'], [0.0, ENERGIES[0]], [0.0, ENERGIES[-1]], [0, len(ENERGIES)-1])
|
||||
scan.start()
|
||||
|
||||
#Stop condition
|
||||
#ramp_done = Channel('X07MA-PC-MAG:X:RAMP:DONE', type = 'i')
|
||||
|
||||
#Creating channels: dimension 1
|
||||
#RegionPositioner field
|
||||
#field = Channel('X07MA-PC:GO', type = 'd')
|
||||
#fieldReadback = Channel('X07MA-PC-PS2:STS:PMCURRENT', type = 'd')
|
||||
#Creating channels: dimension 2
|
||||
#ArrayPositioner Energy
|
||||
#Energy = Channel('X07MA-PHS-E:GO.A', type = 'd')
|
||||
#EnergyReadback = Channel('X07MA-PGM:CERBK', type = 'd')
|
||||
#ScalarDetector TEY
|
||||
#TEY = Channel('X07MA-ES1-AI:SIGNAL0', type = 'd')
|
||||
#ScalarDetector I0
|
||||
#I0 = Channel('X07MA-ES1-AI:SIGNAL1', type = 'd')
|
||||
#ScalarDetector trans
|
||||
#trans = Channel('X07MA-ES1-AI:SIGNAL2', type = 'd')
|
||||
#ScalarDetector polarization
|
||||
#polarization = Channel('X07MA-ID:MODE', type = 'd')
|
||||
#ScalarDetector polAngle
|
||||
#polAngle = Channel('X07MA-ID:ALPHA', type = 'd')
|
||||
#ScalarDetector temperature
|
||||
#temperature = Channel('X07MA-PC-TC:STS:T1', type = 'd')
|
||||
#ScalarDetector RingCurrent
|
||||
#RingCurrent = Channel('ARIDI-PCT:CURRENT', type = 'd')
|
||||
#ScalarDetector fieldAnalogX
|
||||
#fieldAnalogX = Channel('X07MA-ES1-AI:SIGNAL4', type = 'd')
|
||||
|
||||
|
||||
print "SKIPPED Waiting for start field"
|
||||
|
||||
if abs(field_x.readback.read() - START_FIELD) > FIELD_PRECISION:
|
||||
field_x.write(START_FIELD)
|
||||
#if abs(fieldReadback.get() - START_FIELD) > FIELD_PRECISION:
|
||||
# caput('X07MA-PC-PS2:M:GO.A', START_FIELD)
|
||||
|
||||
|
||||
|
||||
#caput("X07MA-PC-MAG:X:DMD", START_FIELD)
|
||||
#caput("X07MA-PC-MAG:STARTRAMP.PROC", 1)
|
||||
|
||||
field_x_done.waitValue(1) #ramp_done.wait_for_value(1.0)
|
||||
pol_done.waitValue("DONE")
|
||||
|
||||
#caput('X07MA-OP-VG13:WT_SET', 'Try open')
|
||||
#time.sleep(2.0)
|
||||
open(2.0)
|
||||
|
||||
print "Set end field"
|
||||
#caput("X07MA-PC-MAG:X:DMD", END_FIELD)
|
||||
#caputq("X07MA-PC-MAG:STARTRAMP.PROC", 1)
|
||||
field_x.write(END_FIELD) #caputq('X07MA-PC-PS2:M:GO.A', END_FIELD)
|
||||
|
||||
|
||||
|
||||
|
||||
index = 0
|
||||
while(True):
|
||||
#Dimension 2START_FIELD = -0.2
|
||||
#ArrayPositioner Energy
|
||||
for setpoint2 in ENERGIES:
|
||||
#Energy.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
|
||||
energy.write(setpoint2)
|
||||
sleep( ENERGY_CHANGE_SLEEP ) # Settling time
|
||||
|
||||
#TODO: change to Controlled variable?
|
||||
readback2 = energy_readback.read() #EnergyReadback.get()
|
||||
if abs(readback2 - setpoint2) > 0.1 : # TODO: Check accuracy
|
||||
raise Exception('Energy could not be set to the value ' + str(setpoint2))
|
||||
|
||||
#Detector field readback
|
||||
field_readback = field_x.readback.read() #fieldReadback.get()
|
||||
|
||||
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()
|
||||
|
||||
tey_norm = detector1/detector2
|
||||
trans_norm = detector3/detector2
|
||||
|
||||
if dif_series is not None:
|
||||
if setpoint2 == ENERGIES[0]:
|
||||
first = tey_norm
|
||||
else:
|
||||
dif = tey_norm-first
|
||||
dif_series.appendData(field_readback,dif)
|
||||
scan.append ([field_readback, setpoint2], [field_readback, readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, tey_norm, trans_norm])
|
||||
|
||||
if field_x_done.read() == 1: #If not ramping #ramp_done.get() == 1:
|
||||
print "Not ramping, breaking execution"
|
||||
break
|
||||
index = index+1
|
||||
|
||||
#Closing channels
|
||||
#Energy.close()
|
||||
#EnergyReadback.close()
|
||||
#TEY.close()
|
||||
#I0.close()
|
||||
#trans.close()
|
||||
#polarization.close()
|
||||
#polAngle.close()
|
||||
#temperature.close()
|
||||
#RingCurrent.close()
|
||||
#fieldAnalogX.close()
|
||||
#field.close()
|
||||
#fieldReadback.close()
|
||||
#ramp_done.close()
|
||||
|
||||
scan.end()
|
||||
+25
-19
@@ -39,14 +39,14 @@ def getPars(element):
|
||||
###################################################################################################
|
||||
# PSeudo-devices
|
||||
###################################################################################################
|
||||
energy = None
|
||||
sim_energy = None
|
||||
class SimulatedEnergy(Writable):
|
||||
def write(self, value):
|
||||
self.put(value)
|
||||
|
||||
def put(self, value, timeout = None):
|
||||
global energy
|
||||
energy = value
|
||||
global sim_energy
|
||||
sim_energy = value
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
@@ -54,8 +54,8 @@ class SimulatedEnergy(Writable):
|
||||
|
||||
class SimulatedEnergyReadback(Readable):
|
||||
def read(self):
|
||||
global energy
|
||||
return energy;
|
||||
global sim_energy
|
||||
return sim_energy;
|
||||
|
||||
def get(self):
|
||||
return self.read()
|
||||
@@ -142,13 +142,13 @@ controller.addListener(Listener()) #Old listeners are cleande in startup
|
||||
###################################################################################################
|
||||
#TODO: Should set devices? K10, k11, k24 seem not to be defined....
|
||||
keithleys = {
|
||||
#name:[Setpoint, range]
|
||||
"k1": [None , 'X07MA-PC-K428:1:setGain'],
|
||||
"k2": [None , 'X07MA-PC-K428:2:setGain'],
|
||||
"k3": [None , 'X07MA-PC-K428:3:setGain'],
|
||||
"k10":['X07MA-KEI10:SETVOLTAGE' , 'X07MA-KEI10:RANGE'],
|
||||
"k11":['X07MA-KEI11:SETVOLTAGE' , 'X07MA-KEI11:RANGE'],
|
||||
"k24":['X07MA-KEI2400:setVoltAO', None]
|
||||
#name:[Setpoint, range, Readback] #TODO
|
||||
"k1": [None , 'X07MA-PC-K428:1:setGain', None],
|
||||
"k2": [None , 'X07MA-PC-K428:2:setGain', None],
|
||||
"k3": [None , 'X07MA-PC-K428:3:setGain', None],
|
||||
"k10":['X07MA-KEI10:SETVOLTAGE' , 'X07MA-KEI10:RANGE', None],
|
||||
"k11":['X07MA-KEI11:SETVOLTAGE' , 'X07MA-KEI11:RANGE', None],
|
||||
"k24":['X07MA-KEI2400:setVoltAO', None, None]
|
||||
}
|
||||
|
||||
def set_hx(field, timeout = -1):
|
||||
@@ -208,7 +208,7 @@ def set_har(value):
|
||||
harmonic.write(float(value))
|
||||
|
||||
|
||||
def set_volt(keithley, value, dalay=0.1):
|
||||
def set_volt(keithley, value, delay=0.1):
|
||||
#keithley.write(float(value))
|
||||
if not keithley in keithleys.keys(): raise Exception("Invalid keithley: " + keithley)
|
||||
caput(keithleys[keithley][0], float(value))
|
||||
@@ -276,14 +276,14 @@ def set_file(file_name):
|
||||
FILENAME = file_name
|
||||
|
||||
|
||||
def otf(start, end, time, delay=None):
|
||||
run("EnergyScan")
|
||||
def otf(start, end, time, delay=0.0):
|
||||
run("EnergyScan", {"E1":start, "E2":end, "TIME":time, "DELAY":float(delay), "MODE":None, "OFFSET":None, "FOLDER":None, "FILE":None, "ALPHA":None})
|
||||
|
||||
def hyst_cont(field, init_field, final_field, ramp_speed, energies):
|
||||
pass
|
||||
run("HistScan",{"FIELD":field, "START_FIELD":init_field, "END_FIELD":final_field, "ENERGIES":energies, "RAMP_RATE":ramp_speed, "ENERGY_CHANGE_SLEEP":0.5, "MODE":None, "OFFSET":None})
|
||||
|
||||
def hyst_cont_mult(field, ranges, energies):
|
||||
pass
|
||||
run("HistScanMult",{"FIELD":field, "RANGES":ranges, "ENERGIES":energies, "ENERGY_CHANGE_SLEEP":0.5, "MODE":None, "OFFSET":None})
|
||||
|
||||
def hyst_step(forward, field, init_field, final_field, ramp_speed, energies):
|
||||
pass
|
||||
@@ -292,12 +292,18 @@ def hyst_step_mult(forward, ranges, ramp_speed, energies):
|
||||
pass
|
||||
|
||||
def scan_e(start, end, step):
|
||||
pass
|
||||
setpoint = Channel (energy., 'd')
|
||||
readback = Channel (keithleys[keithley][2], 'd')
|
||||
lscan(setpoint, readback, float(start), float(end), float(step), latency = 0.1)
|
||||
|
||||
def scan_e(ranges):
|
||||
pass
|
||||
|
||||
def scan_v(keithley,start, end, step):
|
||||
pass
|
||||
setpoint = Channel (keithleys[keithley][0], 'd')
|
||||
readback = Channel (keithleys[keithley][2], 'd')
|
||||
lscan(setpoint, readback, float(start), float(end), float(step), latency = 0.1)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user