Script execution
This commit is contained in:
@@ -19,10 +19,6 @@ CLOSE_SHUTTER_AT_END = True
|
||||
Scienta.setAcquisitionMode(ch.psi.pshell.epics.Scienta.AcquisitionMode.Swept)
|
||||
|
||||
class SpectrumReader(ReadonlyRegisterBase, ReadonlyRegisterArray):
|
||||
#def __init__(self):
|
||||
# super(SpectrumReader, self).__init__()
|
||||
# self.ephot_start = Eph.read()
|
||||
|
||||
def setup(self):
|
||||
ephot = Eph.read()
|
||||
try:
|
||||
@@ -30,11 +26,9 @@ class SpectrumReader(ReadonlyRegisterBase, ReadonlyRegisterArray):
|
||||
edelta = ephot - self.ephot_start
|
||||
else:
|
||||
edelta = 0.0
|
||||
print "calc edelta:", self.ephot_start, ephot, edelta
|
||||
except AttributeError:
|
||||
self.ephot_start = ephot
|
||||
edelta = 0.0
|
||||
print "reset edelta:", self.ephot_start, ephot, edelta
|
||||
|
||||
Scienta.lowEnergy.write(self.region['elo'] + edelta)
|
||||
Scienta.highEnergy.write(self.region['ehi'] + edelta)
|
||||
@@ -44,8 +38,8 @@ class SpectrumReader(ReadonlyRegisterBase, ReadonlyRegisterArray):
|
||||
Scienta.setIterations(self.region['iter'])
|
||||
|
||||
def read(self):
|
||||
print "acquiring spectrum {0}-{1} eV".format(self.region['elo'], self.region['ehi'])
|
||||
self.setup()
|
||||
print "Photon energy {ephot} eV. Acquiring spectrum {elo}-{ehi} eV".format(Eph.read(), Scienta.lowEnergy.value, Scienta.highEnergy.value)
|
||||
trig_scienta()
|
||||
time.sleep(0.5)
|
||||
sp = Scienta.getSpectrum().read()
|
||||
|
||||
Reference in New Issue
Block a user