This commit is contained in:
2020-06-17 10:41:20 +02:00
parent d780407c2d
commit 4f70592293

32
script/HarmonicScan.py Normal file
View File

@@ -0,0 +1,32 @@
ID_ENERGY = 1250
# energy at which the ID offset should be determined
#========================
HALFWIDTH = 10
STEP = 0.5
#========================
try:
caput('X07MA-PHS-E:OPT', 'PGM')
energy_id.write(ID_ENERGY)
wait_device(energy_done, 1 )
def before(position, scan):
#wait_device(energy_done, 1 )
sleep( 0.3 ) # Settling time
#ret = lscan(energy, [signal_i0, signal_tey, 'ca://X07MA-PC-K428:2:getTotalGain', 'ca://X07MA-ID:MODE?type=d', pol_angle, current, energy, pol_offset, 'ca://X07MA-ID-GAP:READ','ca://X07MA-ID-SHIFT:READ'], ID_ENERGY-HALFWIDTH, ID_ENERGY+HALFWIDTH, STEP, before_read = before)
ret = lscan(energy, [signal_i0, signal_tey, 'ca://X07MA-PC-K428:2:getTotalGain', energy], ID_ENERGY-HALFWIDTH, ID_ENERGY+HALFWIDTH, STEP, before_read = before)
xdata = ret.getPositions(0)
ydata = ret.getReadable(0)
ymin = min(ydata)
xminmin = xdata[ydata.index(min(ydata))]
print "Emin=",xminmin,"ymin = ",ymin
caput('X07MA-PHS-E:OPT', 'PGM+ID')
except:
print("Aborting...")
caput('X07MA-PHS-E:OPT', 'PGM+ID')
raise