Script execution
This commit is contained in:
83
script/MultiRegionScan2.py
Normal file
83
script/MultiRegionScan2.py
Normal file
@@ -0,0 +1,83 @@
|
||||
"""
|
||||
Arguments:
|
||||
|
||||
"""
|
||||
|
||||
MOTORS = [Dummy]
|
||||
VECTOR = [450.0, 451.0]
|
||||
LATENCY = 0.0
|
||||
|
||||
REGION1 = {'elo': 440.0, 'ehi': 442.0, 'estep': 0.1, 'epass': 100, 'tstep': 0.1, 'iter': 1}
|
||||
REGION2 = {'elo': 441.0, 'ehi': 443.0, 'estep': 0.2, 'epass': 100, 'tstep': 0.1, 'iter': 1}
|
||||
REGIONS = [REGION1, REGION2]
|
||||
|
||||
class SpectrumReader(ReadonlyRegisterBase, ReadonlyRegisterArray):
|
||||
def setup(self):
|
||||
Scienta.lowEnergy.write(region['elo'])
|
||||
Scienta.highEnergy.write(region['ehi'])
|
||||
Scienta.stepSize.write(region['estep'])
|
||||
Scienta.setPassEnergy(region['epass'])
|
||||
Scienta.stepTime.write(region['tstep'])
|
||||
Scienta.setIterations(region['iter'])
|
||||
|
||||
def doRead(self):
|
||||
self.setup()
|
||||
trig_scienta()
|
||||
time.sleep(0.5)
|
||||
return Scienta.getSpectrum().read()
|
||||
|
||||
def getSize(self):
|
||||
return len(Scienta.getSpectrumX())
|
||||
|
||||
|
||||
class ImageReader(ReadonlyRegisterBase, ReadonlyRegisterMatrix):
|
||||
def doRead(self):
|
||||
return Scienta.getDataMatrix().read()
|
||||
|
||||
def getWidth(self):
|
||||
return Scienta.getDataMatrix().getWidth()
|
||||
|
||||
def getHeight(self):
|
||||
return Scienta.getDataMatrix().getHeight()
|
||||
|
||||
|
||||
index = 0
|
||||
reader1 = SpectrumReader()
|
||||
reader1.initialize()
|
||||
reader1.index = index
|
||||
reader1.region = REGIONS[index]
|
||||
|
||||
image1 = ImageReader()
|
||||
image1.initialize()
|
||||
image1.index = index
|
||||
image1.region = REGIONS[index]
|
||||
set_device_alias(image1, "ScientaImage1")
|
||||
|
||||
index = 1
|
||||
reader2 = SpectrumReader()
|
||||
reader2.initialize()
|
||||
reader2.index = index
|
||||
reader2.region = REGIONS[index]
|
||||
|
||||
image2 = ImageReader()
|
||||
image2.initialize()
|
||||
image2.index = index
|
||||
image2.region = REGIONS[index]
|
||||
set_device_alias(image2, "ScientaImage2")
|
||||
|
||||
#reader3 = SpectrumReader()
|
||||
#reader3.initialize()
|
||||
#image3 = ImageReader()
|
||||
#image3.initialize()
|
||||
#image3.index=2
|
||||
#set_device_alias(image3, "ScientaImage3")
|
||||
|
||||
SENSORS = [SampleCurrent, RefCurrent, reader1, image1, reader2, image2]#, reader3, image3]
|
||||
|
||||
Scienta.getDataMatrix()
|
||||
|
||||
adjust_sensors()
|
||||
set_adc_averaging()
|
||||
set_preference(Preference.PLOT_TYPES, {'Scienta spectrum':1})
|
||||
|
||||
lscan(MOTORS, SENSORS, VECTOR, True, LATENCY,False, before_read=wait_beam, after_read = after_readout)
|
||||
Reference in New Issue
Block a user