Closedown

This commit is contained in:
gac-x03da
2019-06-19 09:50:03 +02:00
parent 2c8244e0ff
commit 5ff752da53
2 changed files with 16 additions and 15 deletions

View File

@@ -47,16 +47,15 @@ be_axis.setLabel("binding energy")
spectrum_series = p.getSeries(0)
def get_binding_range():
def get_binding_energy(e):
ephot = Eph.take(100)
elo = Scienta.lowEnergy.take(100)
ehi = Scienta.highEnergy.take(100)
workfunc = 4.5
if type(ephot) != float or ephot < 0.:
ephot = ehi
eb1 = ephot - elo - workfunc
eb2 = ephot - ehi - workfunc
return eb2, eb1
ephot = Scienta.highEnergy.take(100)
return ephot - e - workfunc
def get_binding_range():
return get_binding_energy(Scienta.highEnergy.take(100)), get_binding_energy(Scienta.lowEnergy.take(100))
eb2, eb1 = get_binding_range()
@@ -88,18 +87,19 @@ try:
for cur_range in range(len(ranges)):
cur_iteration = 0
skip_iteration = False
vars = ranges[cur_range].vars
#Check if photon energy is defined
if len(vars) > 2:
eph = vars[3]
if not math.isnan(eph):
if eph and (not math.isnan(eph)):
Eph.move(eph)
Scienta.lowEnergy.write(adjusted_ranges[cur_range][0])
Scienta.highEnergy.write(adjusted_ranges[cur_range][1])
Scienta.update()
vars = ranges[cur_range].vars
Scienta.stepTime.write(vars[0])
Scienta.stepSize.write(vars[1])
Scienta.setIterations(1)
@@ -179,7 +179,8 @@ finally:
if not Scienta.isReady():
Scienta.stop()
Scienta.update()
task[0].cancel(True)
if task:
task[0].cancel(True)
if ENDSCAN:
after_scan()

View File

@@ -2,9 +2,9 @@ import ch.psi.pshell.device.DummyPositioner as DummyPositioner
#Energy #Pass Energy
STEPS = [ ( 136.0, 10 ),
( 350.5, 20 ),
( 400.0, 50 ),
STEPS = [ ( 136.0, 10 , 5.0),
( 350.5, 20 , 6.0),
( 400.0, 50 , 7.0),
]
@@ -27,7 +27,7 @@ def scan_gen():
for step in STEPS:
yield step
POSITIONERS = [energy, pass_energy]
POSITIONERS = [energy, pass_energy, Scienta.getChild("Scienta step time")]
try:
vscan( POSITIONERS,