This commit is contained in:
gac-x09la
2022-08-08 13:28:59 +02:00
parent 62474e0059
commit b910d2f00d
89 changed files with 1953 additions and 667 deletions
+82 -23
View File
@@ -1,7 +1,7 @@
###################################################################################################
# Deployment specific global definitions - executed after startup.py
###################################################################################################
import ch.psi.pshell.device.Camera as Camera
def get_additional_positioners():
ret = []
@@ -38,6 +38,13 @@ class Energy(PositionerBase):
def getMaxValue(self):
er=get_energy_range()
return er[1] if er is not None else -sys.maxint
def getChannelName(self):
return photon_energy.getChannelName()
def getResolution(self):
return photon_energy.getResolution()
add_device(Energy("energy", None), True)
def get_energy_range():
@@ -90,6 +97,9 @@ class Cff(PositionerBase):
def getMaxValue(self):
return pgm_cff.getMaxValue()
def getChannelName(self):
return pgm_cff.getChannelName()
add_device(Cff("cff", None), True)
@@ -127,6 +137,8 @@ id_mode.setSettlingCondition(IdSettlingCondition())
id_mode.setpoint.blockingWrite=True
grating.setSettlingCondition(GrSettlingCondition())
pgm_cff.setSettlingCondition(CffSettlingCondition())
id_energy.setSettlingCondition(IdSettlingCondition())
id_energy.setpoint.blockingWrite=True
def change_photon_pars(_photon_energy=None, _id_mode=None, _grating=None, _cff=None):
@@ -154,27 +166,33 @@ def change_photon_pars(_photon_energy=None, _id_mode=None, _grating=None, _cff=N
#Set operation mode to “PGM”
oper_mode.move("PGM")
if _id_mode is not None:
#Set polarization mode
print "Setting id_mode="+str(_id_mode)
id_mode.move("OFF")
id_mode.move(_id_mode)
def move_grating(_grating, _photon_energy, _cff):
if _grating is not None:
#Set grating
print "Setting grating="+str(_grating)
grating.move(_grating)
if _photon_energy is not None:
#Set moni energy
print "Setting photon_energy="+str(_photon_energy)
photon_energy.move(_photon_energy)
if _cff is not None:
#Set cff
print "Setting cff="+str(_cff)
pgm_cff.move(_cff)
if _grating is not None:
#Set grating
print "Setting grating="+str(_grating)
grating.move(_grating)
if _photon_energy is not None:
#Set insertion device energy
print "Setting photon_energy="+str(_photon_energy)
photon_energy.move(_photon_energy)
if _cff is not None:
#Set cff
print "Setting cff="+str(_cff)
pgm_cff.move(_cff)
def move_id(_id_mode, _photon_energy):
if _id_mode is not None:
#Set polarization mode
print "Setting id_mode="+str(_id_mode)
id_mode.move("OFF")
id_mode.move(_id_mode)
if _photon_energy is not None:
#Set insertion device energy
print "Setting id_energy="+str(_photon_energy)
id_energy.move(_photon_energy)
ret = parallelize((move_grating,(_grating, _photon_energy, _cff)), (move_id,(_id_mode, _photon_energy)))
finally:
#Return operation mode to original value (e.g. “PGM+ID”)
@@ -308,7 +326,7 @@ def trigger_scienta():
image_id = scienta.currentImageCount
scienta.start()
scienta.waitReady(-1)
scienta.waitNewImage(3000, image_id)
scienta.waitNewImage(10000, image_id)
def dummy_trigger_scienta():
@@ -401,4 +419,45 @@ def calc_acquisition_time(samples=1,exp=None, iter=None, images=None, mode=None,
else:
ret= "%02i:%02i:%02i" % (hours, minutes, time_s)
return ret
def get_device_channel(dev):
dev = string_to_obj(dev)
if "getChannelName" in dir(dev):
return dev.getChannelName()
return None
def set_device_channel_names(scan, sensors=None, snaps=None, diags=None, monitors=None):
layout=get_context().dataManager.layout
if sensors is not None:
for dev in sensors:
channel=get_device_channel(dev)
if channel:
try:
set_attribute(layout.getScanPath(scan)+string_to_obj(dev).alias, "channel", channel)
except:
pass
if snaps is not None:
for dev in snaps:
channel=get_device_channel(dev)
if channel:
try:
set_attribute(layout.getSnapPathName(scan, dev), "channel", channel)
except:
pass
if diags is not None:
for dev in diags:
channel=get_device_channel(dev)
if channel:
try:
set_attribute(layout.getDiagPathName(scan, dev), "channel", channel)
except:
pass
if monitors is not None:
for dev in monitors:
channel=get_device_channel(dev)
if channel:
try:
set_attribute(layout.getMonitorPathName(scan, string_to_obj(dev)), "channel", channel)
except:
pass
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
+33
View File
@@ -0,0 +1,33 @@
{
"PASSES" : 1,
"STOP" : [ ],
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
"PRE_ACTIONS" : {
"scienta.passEnergyDev" : "20",
"scienta.acquisitionModeDev" : "Fixed",
"scienta.energyModeDev" : "Kinetic",
"scienta.lensModeDev" : "Transmission",
"scienta.detectorModeDev" : "ADC",
"scienta.lowEnergy" : 18.8,
"scienta.centerEnergy" : 19.0,
"scienta.highEnergy" : 19.2,
"scienta.energyStepSize" : 0.01,
"scienta.slices" : 512,
"scienta.channels" : 512,
"scienta.exposureDev" : 3.0,
"scienta.minX" : 100,
"scienta.sizeX" : 800,
"scienta.minY" : 50,
"scienta.sizeY" : 750,
"scienta.sweeps" : 1
},
"COMPRESSION" : true,
"SENSORS" : [ "scienta.dataMatrix" ],
"ZIGZAG" : false,
"SETTLING_TIME" : 0.0,
"MONITORS" : [ "current" ],
"START" : [ ],
"POSITIONERS" : [ ],
"STEPS" : [ ],
"SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
}
Regular → Executable
+22 -14
View File
@@ -1,29 +1,37 @@
{
"PASSES" : 1,
"STOP" : [ 5.0 ],
"STOP" : [ ],
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
"PRE_ACTIONS" : {
"scienta.passEnergyDev" : "5",
"scienta.acquisitionModeDev" : "Fixed",
"scienta.passEnergyDev" : "10",
"scienta.acquisitionModeDev" : "Sweep ThetaY",
"scienta.energyModeDev" : "Kinetic",
"scienta.lensModeDev" : "A30_01",
"scienta.lensModeDev" : "DA30L_01",
"scienta.detectorModeDev" : "ADC",
"scienta.lowEnergy" : 20.3,
"scienta.centerEnergy" : 20.25,
"scienta.highEnergy" : 20.5,
"scienta.energyStepSize" : 0.001,
"scienta.lowEnergy" : 18.8,
"scienta.centerEnergy" : 19.0,
"scienta.highEnergy" : 19.2,
"scienta.energyStepSize" : 0.01,
"scienta.lowThetaY" : -10.0,
"scienta.centerThetaY" : 0.0,
"scienta.highThetaY" : 10.0,
"scienta.thetaYStepSize" : 0.5,
"scienta.centerThetaX" : 0.0,
"scienta.slices" : 601,
"scienta.channels" : 801
"scienta.slices" : 750,
"scienta.channels" : 800,
"scienta.exposureDev" : 1.0,
"scienta.minX" : 100,
"scienta.sizeX" : 800,
"scienta.minY" : 50,
"scienta.sizeY" : 750
},
"COMPRESSION" : true,
"SENSORS" : [ "scienta.dataMatrix" ],
"ZIGZAG" : false,
"SETTLING_TIME" : 0.0,
"MONITORS" : [ "current" ],
"START" : [ -5.0 ],
"RANGE" : [ 900, 100, 800, 200 ],
"POSITIONERS" : [ "tilt" ],
"STEPS" : [ 10 ],
"START" : [ ],
"POSITIONERS" : [ ],
"STEPS" : [ ],
"SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
}
Regular → Executable
View File
Regular → Executable
+19 -2
View File
@@ -2,14 +2,31 @@
"PASSES" : 1,
"STOP" : [ ],
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
"PRE_ACTIONS" : { },
"PRE_ACTIONS" : {
"scienta.passEnergyDev" : "20",
"scienta.acquisitionModeDev" : "Fixed",
"scienta.energyModeDev" : "Kinetic",
"scienta.lensModeDev" : "A14_08",
"scienta.detectorModeDev" : "ADC",
"scienta.lowEnergy" : 10.0,
"scienta.centerEnergy" : 21.0,
"scienta.highEnergy" : 15.0,
"scienta.energyStepSize" : 0.01,
"scienta.centerThetaX" : 0.0,
"scienta.slices" : 512,
"scienta.channels" : 600,
"scienta.exposureDev" : 0.2,
"scienta.minX" : 100,
"scienta.sizeX" : 600,
"scienta.minY" : 0,
"scienta.sizeY" : 600
},
"COMPRESSION" : true,
"SENSORS" : [ "scienta.dataMatrix" ],
"ZIGZAG" : false,
"SETTLING_TIME" : 0.0,
"MONITORS" : [ "current" ],
"START" : [ ],
"RANGE" : [ null, null, null, null ],
"POSITIONERS" : [ ],
"STEPS" : [ ],
"SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
+18 -2
View File
@@ -4,7 +4,24 @@
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
"PRE_ACTIONS" : {
"id_mode" : "CIRC+",
"grating" : "G2 1200"
"grating" : "G2 1200",
"scienta.passEnergyDev" : "20",
"scienta.acquisitionModeDev" : "Fixed",
"scienta.energyModeDev" : "Kinetic",
"scienta.lensModeDev" : "Transmission",
"scienta.detectorModeDev" : "ADC",
"scienta.lowEnergy" : 18.8,
"scienta.centerEnergy" : 19.0,
"scienta.highEnergy" : 19.2,
"scienta.energyStepSize" : 0.01,
"scienta.slices" : 512,
"scienta.channels" : 512,
"scienta.exposureDev" : 3.0,
"scienta.minX" : 100,
"scienta.sizeX" : 800,
"scienta.minY" : 50,
"scienta.sizeY" : 750,
"scienta.sweeps" : 1.0
},
"COMPRESSION" : true,
"SENSORS" : [ "scienta.dataMatrix" ],
@@ -12,7 +29,6 @@
"SETTLING_TIME" : 0.0,
"MONITORS" : [ "current" ],
"START" : [ 21.0 ],
"RANGE" : [ null, null, null, null ],
"POSITIONERS" : [ "energy" ],
"STEPS" : [ 9 ],
"SNAPS" : [ "acmi", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
+17 -8
View File
@@ -4,24 +4,33 @@
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
"PRE_ACTIONS" : {
"scienta.passEnergyDev" : "10",
"scienta.acquisitionModeDev" : "Fixed",
"scienta.acquisitionModeDev" : "Sweep ThetaY",
"scienta.energyModeDev" : "Kinetic",
"scienta.lensModeDev" : "Transmission",
"scienta.lensModeDev" : "DA30_01",
"scienta.detectorModeDev" : "ADC",
"scienta.lowEnergy" : 10.0,
"scienta.centerEnergy" : 19.5,
"scienta.highEnergy" : 150.0,
"scienta.centerEnergy" : 19.0,
"scienta.highEnergy" : 15.0,
"scienta.energyStepSize" : 0.01,
"scienta.slices" : 601,
"scienta.channels" : 801
"scienta.lowThetaY" : -10.0,
"scienta.centerThetaY" : 0.0,
"scienta.highThetaY" : 10.0,
"scienta.thetaYStepSize" : 0.5,
"scienta.centerThetaX" : 0.0,
"scienta.slices" : 851,
"scienta.channels" : 801,
"scienta.exposureDev" : 1.0,
"scienta.minX" : 100,
"scienta.sizeX" : 900,
"scienta.minY" : 50,
"scienta.sizeY" : 900
},
"COMPRESSION" : true,
"SENSORS" : [ "scienta.dataMatrix" ],
"ZIGZAG" : false,
"SETTLING_TIME" : 0.0,
"MONITORS" : [ "current" ],
"START" : [ 0.0 ],
"RANGE" : [ null, null, null, null ],
"START" : [ -1.0 ],
"POSITIONERS" : [ "x" ],
"STEPS" : [ 4 ],
"SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
+38
View File
@@ -0,0 +1,38 @@
{
"PASSES" : 1,
"STOP" : [ ],
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
"PRE_ACTIONS" : {
"scienta.passEnergyDev" : "10",
"scienta.acquisitionModeDev" : "Sweep ThetaY",
"scienta.energyModeDev" : "Kinetic",
"scienta.lensModeDev" : "DA30_01",
"scienta.detectorModeDev" : "ADC",
"scienta.lowEnergy" : 18.8,
"scienta.centerEnergy" : 19.0,
"scienta.highEnergy" : 19.2,
"scienta.energyStepSize" : 0.01,
"scienta.lowThetaY" : -10.0,
"scienta.centerThetaY" : 0.0,
"scienta.highThetaY" : 10.0,
"scienta.thetaYStepSize" : 0.5,
"scienta.centerThetaX" : 0.0,
"scienta.slices" : 350,
"scienta.channels" : 300,
"scienta.exposureDev" : 0.01,
"scienta.minX" : 100,
"scienta.sizeX" : 900,
"scienta.minY" : 350,
"scienta.sizeY" : 900,
"scienta.sweeps" : 1
},
"COMPRESSION" : true,
"SENSORS" : [ "scienta.dataMatrix" ],
"ZIGZAG" : false,
"SETTLING_TIME" : 0.0,
"MONITORS" : [ "current" ],
"START" : [ ],
"POSITIONERS" : [ ],
"STEPS" : [ ],
"SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
}
+33
View File
@@ -0,0 +1,33 @@
{
"PASSES" : 1,
"STOP" : [ ],
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
"PRE_ACTIONS" : {
"scienta.passEnergyDev" : "20",
"scienta.acquisitionModeDev" : "Fixed",
"scienta.energyModeDev" : "Kinetic",
"scienta.lensModeDev" : "Transmission",
"scienta.detectorModeDev" : "ADC",
"scienta.lowEnergy" : 18.8,
"scienta.centerEnergy" : 19.0,
"scienta.highEnergy" : 19.2,
"scienta.energyStepSize" : 0.01,
"scienta.slices" : 512,
"scienta.channels" : 512,
"scienta.exposureDev" : 3.0,
"scienta.minX" : 100,
"scienta.sizeX" : 800,
"scienta.minY" : 50,
"scienta.sizeY" : 750,
"scienta.sweeps" : 1
},
"COMPRESSION" : true,
"SENSORS" : [ "current" ],
"ZIGZAG" : false,
"SETTLING_TIME" : 0.0,
"MONITORS" : [ ],
"START" : [ ],
"POSITIONERS" : [ ],
"STEPS" : [ ],
"SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
}
Regular → Executable
View File
View File
+37
View File
@@ -0,0 +1,37 @@
{
"PASSES" : 1,
"STOP" : [ ],
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
"PRE_ACTIONS" : {
"scienta.passEnergyDev" : "10",
"scienta.acquisitionModeDev" : "Sweep Energy",
"scienta.energyModeDev" : "Kinetic",
"scienta.lensModeDev" : "DA30_01",
"scienta.detectorModeDev" : "ADC",
"scienta.lowEnergy" : 18.8,
"scienta.centerEnergy" : 19.0,
"scienta.highEnergy" : 19.2,
"scienta.energyStepSize" : 0.01,
"scienta.lowThetaY" : -10.0,
"scienta.centerThetaY" : 0.0,
"scienta.highThetaY" : 10.0,
"scienta.thetaYStepSize" : 0.5,
"scienta.centerThetaX" : 0.0,
"scienta.slices" : 900,
"scienta.channels" : 800,
"scienta.exposureDev" : 0.1,
"scienta.minX" : 100,
"scienta.sizeX" : 800,
"scienta.minY" : 50,
"scienta.sizeY" : 900
},
"COMPRESSION" : true,
"SENSORS" : [ "scienta.dataMatrix" ],
"ZIGZAG" : false,
"SETTLING_TIME" : 0.0,
"MONITORS" : [ "current" ],
"START" : [ ],
"POSITIONERS" : [ ],
"STEPS" : [ ],
"SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
}
+62
View File
@@ -0,0 +1,62 @@
{
"PASSES" : 1,
"STOP" : [ ],
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z", "energy" ],
"MASTER_AXIS" : {
"CONFIG" : {
"fileName" : "/sls/X09LA/data/X09LA/pshell/home/devices/tilt_correction.properties",
"precision" : -1,
"offset" : 0.0,
"scale" : 1.0,
"unit" : null,
"sign_bit" : 0,
"resolution" : "NaN",
"minValue" : "NaN",
"maxValue" : "NaN",
"rotation" : false,
"mode" : "LINEAR",
"masterPositions" : null,
"slave1Positions" : null,
"slave2Positions" : null,
"slave3Positions" : null,
"slave4Positions" : null,
"slave5Positions" : null,
"slave6Positions" : null
},
"MASTER" : "tilt",
"SLAVES" : [ "y" ],
"NAME" : "tilt_correction"
},
"PRE_ACTIONS" : {
"scienta.passEnergyDev" : "10",
"scienta.acquisitionModeDev" : "Sweep Energy",
"scienta.energyModeDev" : "Kinetic",
"scienta.lensModeDev" : "DA30_01",
"scienta.detectorModeDev" : "ADC",
"scienta.lowEnergy" : 18.8,
"scienta.centerEnergy" : 19.0,
"scienta.highEnergy" : 19.2,
"scienta.energyStepSize" : 0.01,
"scienta.lowThetaY" : -10.0,
"scienta.centerThetaY" : 0.0,
"scienta.highThetaY" : 10.0,
"scienta.thetaYStepSize" : 0.5,
"scienta.centerThetaX" : 0.0,
"scienta.slices" : 750,
"scienta.channels" : 800,
"scienta.exposureDev" : 0.1,
"scienta.minX" : 100,
"scienta.sizeX" : 800,
"scienta.minY" : 50,
"scienta.sizeY" : 750
},
"COMPRESSION" : true,
"SENSORS" : [ "scienta.dataMatrix" ],
"ZIGZAG" : false,
"SETTLING_TIME" : 0.0,
"MONITORS" : [ "current", "photon_energy", "temp_sample1", "temp_sample2", "acmi" ],
"START" : [ ],
"POSITIONERS" : [ ],
"STEPS" : [ ],
"SNAPS" : [ "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "pgm_cff", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_shield", "scienta.passEnergyDev", "scienta.acquisitionModeDev", "scienta.energyModeDev", "scienta.lensModeDev", "scienta.lowEnergy", "scienta.centerEnergy", "scienta.highEnergy", "scienta.energyStepSize", "scienta.lowThetaY", "scienta.centerThetaY", "scienta.highThetaY", "scienta.thetaYStepSize", "scienta.centerThetaX", "scienta.exposureDev", "scienta.channels", "scienta.slices", "scienta.minX", "scienta.sizeX", "scienta.minY", "scienta.sizeY", "scienta.detectorModeDev" ]
}
+37
View File
@@ -0,0 +1,37 @@
{
"PASSES" : 1,
"STOP" : [ ],
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
"PRE_ACTIONS" : {
"id_mode" : "LH",
"grating" : "G2 1200",
"scienta.passEnergyDev" : "10",
"scienta.acquisitionModeDev" : "Fixed",
"scienta.energyModeDev" : "Kinetic",
"scienta.lensModeDev" : "A30_01",
"scienta.detectorModeDev" : "ADC",
"scienta.lowEnergy" : 18.8,
"scienta.centerEnergy" : 19.0,
"scienta.highEnergy" : 19.2,
"scienta.energyStepSize" : 0.01,
"scienta.centerThetaX" : 0.0,
"scienta.slices" : 350,
"scienta.channels" : 300,
"scienta.exposureDev" : 1.0,
"scienta.minX" : 100,
"scienta.sizeX" : 900,
"scienta.minY" : 350,
"scienta.sizeY" : 900,
"scienta.sweeps" : 1,
"energy" : 300.0
},
"COMPRESSION" : true,
"SENSORS" : [ "scienta.dataMatrix" ],
"ZIGZAG" : false,
"SETTLING_TIME" : 0.0,
"MONITORS" : [ "current" ],
"START" : [ ],
"POSITIONERS" : [ ],
"STEPS" : [ ],
"SNAPS" : [ "scienta.lensModeDev", "scienta.passEnergyDev", "scienta.energyModeDev", "scienta.exposureDev", "scienta.sweeps", "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
}
+37
View File
@@ -0,0 +1,37 @@
{
"PASSES" : 1,
"STOP" : [ ],
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
"PRE_ACTIONS" : {
"scienta.passEnergyDev" : "10",
"scienta.acquisitionModeDev" : "Sweep ThetaY",
"scienta.energyModeDev" : "Kinetic",
"scienta.lensModeDev" : "DA30_01",
"scienta.detectorModeDev" : "ADC",
"scienta.lowEnergy" : 10.0,
"scienta.centerEnergy" : 19.0,
"scienta.highEnergy" : 15.0,
"scienta.energyStepSize" : 0.01,
"scienta.lowThetaY" : -10.0,
"scienta.centerThetaY" : 0.0,
"scienta.highThetaY" : 10.0,
"scienta.thetaYStepSize" : 0.5,
"scienta.centerThetaX" : 0.0,
"scienta.slices" : 851,
"scienta.channels" : 801,
"scienta.exposureDev" : 1.0,
"scienta.minX" : 100,
"scienta.sizeX" : 900,
"scienta.minY" : 50,
"scienta.sizeY" : 900
},
"COMPRESSION" : true,
"SENSORS" : [ "scienta.dataMatrix" ],
"ZIGZAG" : false,
"SETTLING_TIME" : 0.0,
"MONITORS" : [ "current" ],
"START" : [ ],
"POSITIONERS" : [ ],
"STEPS" : [ ],
"SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
}
+35
View File
@@ -0,0 +1,35 @@
{
"PASSES" : 1,
"STOP" : [ 2.0 ],
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
"PRE_ACTIONS" : {
"scienta.passEnergyDev" : "10",
"scienta.acquisitionModeDev" : "Sweep ThetaY",
"scienta.energyModeDev" : "Kinetic",
"scienta.lensModeDev" : "DA30_01",
"scienta.detectorModeDev" : "ADC",
"scienta.lowEnergy" : 18.8,
"scienta.centerEnergy" : 19.0,
"scienta.highEnergy" : 19.2,
"scienta.energyStepSize" : 0.01,
"scienta.lowThetaY" : -10.0,
"scienta.centerThetaY" : 0.0,
"scienta.highThetaY" : 10.0,
"scienta.thetaYStepSize" : 0.5,
"scienta.centerThetaX" : 0.0,
"scienta.slices" : 350,
"scienta.channels" : 300,
"scienta.exposureDev" : 0.01,
"scienta.minY" : 350,
"scienta.sweeps" : 1
},
"COMPRESSION" : true,
"SENSORS" : [ "scienta.dataMatrix" ],
"ZIGZAG" : false,
"SETTLING_TIME" : 0.0,
"MONITORS" : [ "current" ],
"START" : [ 0.0 ],
"POSITIONERS" : [ "x" ],
"STEPS" : [ 2 ],
"SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
}
+37
View File
@@ -0,0 +1,37 @@
{
"PASSES" : 1,
"STOP" : [ 10.0 ],
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
"PRE_ACTIONS" : {
"scienta.passEnergyDev" : "10",
"scienta.acquisitionModeDev" : "Fixed",
"scienta.energyModeDev" : "Kinetic",
"scienta.lensModeDev" : "DA30_01",
"scienta.detectorModeDev" : "ADC",
"scienta.lowEnergy" : 18.8,
"scienta.centerEnergy" : 19.0,
"scienta.highEnergy" : 19.2,
"scienta.energyStepSize" : 0.01,
"scienta.lowThetaY" : -10.0,
"scienta.centerThetaY" : 0.0,
"scienta.highThetaY" : 10.0,
"scienta.thetaYStepSize" : 0.5,
"scienta.centerThetaX" : 0.0,
"scienta.slices" : 900,
"scienta.channels" : 800,
"scienta.exposureDev" : 0.1,
"scienta.minX" : 100,
"scienta.sizeX" : 800,
"scienta.minY" : 50,
"scienta.sizeY" : 900
},
"COMPRESSION" : true,
"SENSORS" : [ "scienta.dataMatrix" ],
"ZIGZAG" : false,
"SETTLING_TIME" : 0.0,
"MONITORS" : [ "current" ],
"START" : [ -10.0 ],
"POSITIONERS" : [ "tilt" ],
"STEPS" : [ 20 ],
"SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
}
+37
View File
@@ -0,0 +1,37 @@
{
"PASSES" : 1,
"STOP" : [ 10.0 ],
"DIAGS" : [ "phi", "theta", "tilt", "x", "y", "z" ],
"PRE_ACTIONS" : {
"scienta.passEnergyDev" : "10",
"scienta.acquisitionModeDev" : "Fixed",
"scienta.energyModeDev" : "Kinetic",
"scienta.lensModeDev" : "DA30_01",
"scienta.detectorModeDev" : "ADC",
"scienta.lowEnergy" : 10.0,
"scienta.centerEnergy" : 19.0,
"scienta.highEnergy" : 15.0,
"scienta.energyStepSize" : 0.01,
"scienta.lowThetaY" : -10.0,
"scienta.centerThetaY" : 0.0,
"scienta.highThetaY" : 10.0,
"scienta.thetaYStepSize" : 0.5,
"scienta.centerThetaX" : 0.0,
"scienta.slices" : 851,
"scienta.channels" : 801,
"scienta.exposureDev" : 0.0,
"scienta.minX" : 100,
"scienta.sizeX" : 600,
"scienta.minY" : 50,
"scienta.sizeY" : 950
},
"COMPRESSION" : true,
"SENSORS" : [ "scienta.dataMatrix" ],
"ZIGZAG" : false,
"SETTLING_TIME" : 0.0,
"MONITORS" : [ "current" ],
"START" : [ -10.0 ],
"POSITIONERS" : [ "tilt" ],
"STEPS" : [ 20 ],
"SNAPS" : [ "acmi", "cff", "energy", "exit_slit", "fe_horiz_width", "fe_vert_width", "helium_valve", "master", "pgm_cff", "photon_energy", "tcmp", "temp_boot1", "temp_boot2", "temp_cryopump", "temp_cryostat", "temp_headmech", "temp_sample1", "temp_sample2", "temp_shield" ]
}
Regular → Executable
View File
+9
View File
@@ -0,0 +1,9 @@
datafile = args[0]
config = load_data(datafile+"|scripts/config.json")
config_file = get_attributes(datafile+"|scripts")["config"]
with open(config_file, 'w') as f:
f.write(config)
App.getInstance().getMainFrame().openScriptOrProcessor(config_file)
+30 -9
View File
@@ -26,6 +26,10 @@ def load_parameters(name):
for key in config.keys():
globals()[key] = config[key]
print str(key), " = ", config[key]
with open(filename) as config_file:
save_dataset("scripts/config.json", config_file.read(), type = 's')
set_attribute("scripts", "config", filename)
if NAME:
load_parameters(NAME)
@@ -41,6 +45,8 @@ latency = SETTLING_TIME
passes = int(PASSES)
zigzag = bool(ZIGZAG)
#Setuop Scienta
scienta.setGrabMode(Camera.GrabMode.Single)
#Change photon parameters
_id_mode=_grating=None
@@ -75,33 +81,48 @@ if COMPRESSION:
def before_read(pos, scan):
trigger_scienta()
if scienta.dataMatrix in sensors:
trigger_scienta()
data_3d = (scienta.dataMatrix in sensors) and (str(scienta.getAcquisitionMode())=="Swept_Energy_ThetaY")
data_3d = (scienta.dataMatrix in sensors) and ("thetay" in scienta.acquisitionMode.lower())
if data_3d:
print "3D dataset"
def after_read(rec, scan):
global data_3d
#handle_diagnostics(rec)
#data_3d = (scienta.dataMatrix in sensors) and (scienta.arraySize2.read()>1)
if data_3d:
try:
path = get_exec_pars().scanPath + ("/3d_images/%04d" % rec.index)
data = scienta.takeStack()
save_dataset(path, data)
#path = get_exec_pars().scanPath + ("/3d_images/%04d" % rec.index)
#data = scienta.takeStack()
#save_dataset(path, data)
path = get_exec_pars().scanPath + "/images"
if rec.index==0:
size=scienta.getImageSize()
if len(size)<3:
raise Exception("Data is not 3D")
num_images = scan.getNumberOfRecords() * size[2]
create_dataset(path, scienta.dataArray, None, (num_images, size[1], size[0]), {"layout":"contiguous", "compression":True})
for img in scienta.takeStack():
append_dataset(path, img)
except:
log(sys.exc_info()[1])
try:
if len(positioners)==0:
ret= tscan (sensors, 1,0, passes=passes, \
before_read=before_read, after_read=after_read, \
snaps=SNAPS, diags=DIAGS, monitors=MONITORS, keep=True)
save_dataset("/image", ret[scienta.dataMatrix][0], type = 'i', features={"compression":True})
snaps=SNAPS, diags=DIAGS, monitors=MONITORS, keep=True)
#if (scienta.dataMatrix in sensors) and not data_3d:
# save_dataset("/image", ret[scienta.dataMatrix][0], type = 'i', features={"compression":True})
else:
ret= ascan (positioners, sensors, start, end, steps, \
latency= latency, relative=False, passes=passes, zigzag=zigzag, \
before_read=before_read, after_read=after_read, \
snaps=SNAPS, diags=DIAGS, monitors=MONITORS)
set_device_channel_names(ret.scan, sensors, SNAPS, DIAGS, MONITORS )
finally:
scienta.stop()
scienta.zeroSupplies()
print ret
+15
View File
@@ -0,0 +1,15 @@
sensor = scienta.getSensorSize()
roi = scienta.getROI()
data = scienta.getDataMatrix().take()
a=Convert.toDouble(data);
scaleX = roi[2] / len(a[0])
scaleY = roi[3] / len(a)
arr = [[0.0] * sensor[1]] *sensor[0]
for i in range(len(a)):
for j in range (len(a[0])):
arr[int(scaleY * i) + roi[1]][int(scaleX * j) + roi[0]] = a[i][j]
p=plot(arr)
Regular → Executable
View File
Regular → Executable
View File
+1
View File
@@ -0,0 +1 @@
test
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns="http://www.psi.ch/~ebner/models/scan/1.0">
<data/>
<scan>
<dimension>
<positioner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PseudoPositioner" id="POS">
<counts>10</counts>
</positioner>
<detector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Timestamp" id="DET"/>
</dimension>
</scan>
<visualization xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="LinePlot" x="POS" y="DET"/>
</configuration>