62 lines
1.4 KiB
Python
62 lines
1.4 KiB
Python
N_POSITION_BAND = 10.0
|
|
|
|
|
|
# EInkommentieren fuer Messungen Mit PSCR136
|
|
# Auskommentieren fuer Messungen Mit PCEL
|
|
#
|
|
cam_server.start("SATES21-CAMS-PATT1", True)
|
|
cam_server.stream.waitCacheChange(-1)
|
|
i= cam_server.stream.getChild("x_fwhm")
|
|
i_avg = create_averager(i, 30, interval = -1)
|
|
|
|
|
|
# muss auskommentiert bleiben
|
|
#Keithley = Channel("SATOP31-CSSU-PCEL1381:READOUT",'d', monitored ='True')
|
|
|
|
#_avg = create_averager(Keithley, 5, interval = -1)
|
|
|
|
def beam_ok():
|
|
I0 = caget ("SATFE10-PEPG046:PHOTON-ENERGY-PER-PULSE-AVG")
|
|
if I0 > 100:
|
|
return "Yes"
|
|
else :
|
|
return "No"
|
|
|
|
|
|
def before_sampling(rec):
|
|
while beam_ok() == "No":
|
|
time.sleep(0.1)
|
|
print(".")
|
|
|
|
def after_sampling(rec):
|
|
if beam_ok() == "No":
|
|
rec.invalidate()
|
|
|
|
|
|
i0 = Channel("SATFE10-PEPG046:PHOTON-ENERGY-PER-PULSE-AVG",'d')
|
|
|
|
|
|
class VLSSGM(RegisterBase):
|
|
def doWrite(self, value):
|
|
caput ("SATOP11-OSGM087:SetEnergy", value)
|
|
time.sleep(0.2)
|
|
cawait('SATOP11-OSGM087:MOVING', 1, timeout = 20.0, type = 'i')
|
|
def doRead(self):
|
|
return caget("SATOP11-OSGM087:photonenergy")
|
|
|
|
athos = VLSSGM()
|
|
athos.initialize()
|
|
|
|
#lscan( athos, [i0,i_avg], 520.0, 540, 1.0, 0.5, setpoints=True,zigzag=True) # Scans mit PSCR136
|
|
#lscan( athos, [i0,K_avg], 833.5, 837, 0.05, 0.5, setpoints=True,zigzag=True) # Scans mit PCEL
|
|
|
|
|
|
|
|
#caput ("ATHOS:SetEnergy", 680.0)
|
|
tscan( [i_avg], 10, 1 , passes=1)
|
|
|
|
|
|
|
|
|
|
|