XPS
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
import json
|
||||
|
||||
CURRENT_REGION = ""
|
||||
CURRENT_INDEX = -1
|
||||
|
||||
if get_exec_pars().debug:
|
||||
print "Setting debug parameters"
|
||||
NAME = None
|
||||
FILE = None
|
||||
R1 = """{
|
||||
"scienta.elementSet" : "HiPPHAXPES",
|
||||
"scienta.lensMode" : "T_HiPPHAXPES",
|
||||
"scienta.lowEnergy" : 387.0,
|
||||
"scienta.acquisitionMode" : "Swept",
|
||||
"scienta.slices" : 1.0,
|
||||
"scienta.stepSize" : 0.25,
|
||||
"scienta.passEnergy" : 2,
|
||||
"scienta.detectorMode" : "ADC",
|
||||
"scienta.energyMode" : "Kinetic",
|
||||
"scienta.centerEnergy" : 397.0,
|
||||
"scienta.stepTime" : 1.0,
|
||||
"scienta.highEnergy" : 407.0,
|
||||
"scienta.iterations" : 1.0
|
||||
} """
|
||||
|
||||
REGIONS = [["R1", R1]]
|
||||
|
||||
if FILE:
|
||||
FILE = get_context().setup.expandPath("{home}/parameters/" + FILE)
|
||||
with open(FILE) as json_file:
|
||||
cfg = json.load(json_file)
|
||||
NAME , REGIONS= cfg[0][0][0], cfg[1]
|
||||
print "FILE: ", FILE
|
||||
print "NAME: ", NAME
|
||||
#print "REGIONS: ", REGIONS
|
||||
|
||||
|
||||
set_device_alias(scienta.getSpectrum(), "spectrum")
|
||||
set_device_alias(scienta.getDataMatrix(), "image")
|
||||
set_device_alias(scienta.stats[0], "sum")
|
||||
|
||||
sensors=[i0, scienta.stats[0], scienta.getSpectrum()]
|
||||
|
||||
|
||||
def apply_pars(pars):
|
||||
scienta.elementSet = scienta.elementSet.valueOf(pars["scienta.elementSet"])
|
||||
scienta.lensMode = scienta.lensMode.valueOf(pars["scienta.lensMode"])
|
||||
scienta.detectorMode = scienta.detectorMode.valueOf(pars["scienta.detectorMode"])
|
||||
scienta.energyMode = scienta.energyMode.valueOf(pars["scienta.energyMode"])
|
||||
scienta.acquisitionMode = scienta.acquisitionMode.valueOf(pars["scienta.acquisitionMode"])
|
||||
scienta.passEnergy = pars["scienta.passEnergy"]
|
||||
scienta.getLowEnergy().writeAsync(pars["scienta.centerEnergy"])
|
||||
scienta.getCenterEnergy().writeAsync(pars["scienta.passEnergy"])
|
||||
scienta.getHighEnergy().writeAsync(pars["scienta.highEnergy"])
|
||||
scienta.getSlices().writeAsync(pars["scienta.slices"])
|
||||
scienta.getStepSize().writeAsync(pars["scienta.stepSize"])
|
||||
scienta.getStepTime().writeAsync(pars["scienta.stepTime"])
|
||||
scienta.setIterations(int(pars["scienta.iterations"]))
|
||||
|
||||
|
||||
|
||||
def before_read(position, scan):
|
||||
#trigger_scienta()
|
||||
pass
|
||||
|
||||
|
||||
#dummy_trigger_scienta()
|
||||
|
||||
|
||||
try:
|
||||
for r in REGIONS:
|
||||
name=r[0]
|
||||
pars = json.loads(r[1])
|
||||
CURRENT_REGION = name
|
||||
CURRENT_INDEX = CURRENT_INDEX+1
|
||||
print "Region: ", name
|
||||
print "Pars: ", pars
|
||||
apply_pars(pars)
|
||||
time.sleep(5.0)
|
||||
|
||||
#tscan(sensors, 1, 0.001, before_read=before_read, after_read=after_readout, name = NAME)
|
||||
finally:
|
||||
scienta.zeroSupplies()
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import ch.psi.utils.swing.SwingUtils as SwingUtils
|
||||
import ScientaParametersPanel
|
||||
import ScientaParametersDialog
|
||||
|
||||
"""
|
||||
pn = ScientaParametersPanel()
|
||||
pn.setDevice(scienta)
|
||||
SwingUtils.showDialog(App.getInstance().getMainFrame(), "Scienta", None, pn)
|
||||
time.sleep(1.0)
|
||||
pars = pn.values
|
||||
for k in pars.keySet() : print k,"=",pars[k]
|
||||
"""
|
||||
|
||||
|
||||
dlg = ScientaParametersDialog(App.getInstance().getMainFrame(),True, None)
|
||||
dlg.visible=True
|
||||
if dlg.result:
|
||||
pars = dlg.values
|
||||
for k in pars.keySet() : print k,"=",pars[k]
|
||||
|
||||
|
||||
dlg = ScientaParametersDialog(App.getInstance().getMainFrame(),True, pars)
|
||||
dlg.visible=True
|
||||
if dlg.result:
|
||||
pars = dlg.values
|
||||
for k in pars.keySet() : print k,"=",pars[k]
|
||||
|
||||
Reference in New Issue
Block a user