Closedown

This commit is contained in:
gac-x03da
2023-08-12 13:21:28 +02:00
parent 4ea818eced
commit de6d907954
4 changed files with 21 additions and 11 deletions

View File

@@ -343,7 +343,8 @@ def wait_beam():
time.sleep(0.1)
print "Beam ok"
def before_readout():
def is_scienta_sampling():
global SENSORS
sample_scienta = False
for dev in ["Scienta.spectrum","EnergyDistribution", "AngleDistribution", "Scienta.dataMatrix", "Counts"]:
if dev in SENSORS:
@@ -353,6 +354,10 @@ def before_readout():
if dev in SENSORS:
sample_scienta = True
break
return sample_scienta
def before_readout():
sample_scienta = is_scienta_sampling()
wait_beam()
trig_keithleys()
if sample_scienta:
@@ -383,10 +388,13 @@ def after_scan():
def set_adc_averaging(dwelltime=0.0):
if dwelltime == 0.0:
dwelltime = Scienta.getStepTime().read()
if is_scienta_sampling():
dwelltime = Scienta.getStepTime().read()
fixed = AcquisitionMode.read() == "Fixed"
else:
fixed = True
dwelltime = min(dwelltime, 20.0)
dwelltime = max(dwelltime, 0.1)
fixed = AcquisitionMode.read() == "Fixed"
else:
fixed = True
prepare_keithleys(dwelltime, fixed)
@@ -398,7 +406,9 @@ def set_adc_averaging(dwelltime=0.0):
def adjust_sensors():
#Updating ranges from Scienta
Scienta.update()
if is_scienta_sampling():
Scienta.update()
global SENSORS
if SENSORS is not None:
# Move integration to end