From 09f1e1ebda08c4493ba039b6bde5923732fe6afc Mon Sep 17 00:00:00 2001 From: gac-x03da Date: Wed, 23 Jan 2019 10:24:55 +0100 Subject: [PATCH] Closedown --- script/XPSSpectrum.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/script/XPSSpectrum.py b/script/XPSSpectrum.py index 913e1d9c..515efb37 100644 --- a/script/XPSSpectrum.py +++ b/script/XPSSpectrum.py @@ -56,9 +56,19 @@ def plot_cur_spectrum(): y = Scienta.spectrum.take(100) x = Scienta.spectrumX spectrum_series.setData(x, y) - #eb1 = Eph.take(100) - Scienta.lowEnergy.take(100) - 4.5 - #eb2 = Eph.take(100) - Scienta.highEnergy.take(100) - 4.5 - #spectrum_eb_axis.setRange(eb2, eb1) + + # adjust the binding energy scale + # if Eph returns an invalid number, we take energy_high as photon energy + ephot = Eph.take(100) + elo = Scienta.lowEnergy.take(100) + ehi = Scienta.highEnergy.take(100) + workfunc = 4.5 + if ephot is not float or ephot < 0.: + ephot = ehi + eb1 = ephot - elo - workfunc + eb2 = ephot - ehi - workfunc + spectrum_eb_axis.setRange(eb2, eb1) + time.sleep(1.0) finally: print "Stopping spectrum plotting" @@ -106,7 +116,9 @@ try: if xdata is None: xdata = Scienta.spectrumX p.getSeries(0).setData(xdata, ydata) - + + # adjust the binding energy scale + # if Eph returns an invalid number, we take energy_high as photon energy eb_axis = p.chart.plot.getDomainAxis(1) ephot = Eph.take(100) elo = Scienta.lowEnergy.take(100)