44 lines
1.4 KiB
Python
Executable File
44 lines
1.4 KiB
Python
Executable File
scan_from = -1.7
|
|
scan_to = -1.0
|
|
steps = 10
|
|
|
|
motor = 'ca://SARFE10-PSSS059:MOTOR_Y3.VAL'
|
|
title = "PSSS crystal height scan"
|
|
size = caget('SARFE10-PSSS059:SPECTRUM_X.NORD','i')
|
|
sx = caget('SARFE10-PSSS059:SPECTRUM_X', size = size)
|
|
sy = create_device('ca://SARFE10-PSSS059:SPECTRUM_Y?samples=10&interval=10&size='+str(size))
|
|
|
|
class SpectrumY(ReadableArray, ReadableCalibratedArray):
|
|
def read(self):
|
|
return sy.read()
|
|
def getSize(self):
|
|
return size
|
|
def getCalibration(self):
|
|
return ArrayCalibration((sx[-1]-sx[0])/max(len(sx), 1), sx[0])
|
|
calibrated_sensor = SpectrumY()
|
|
|
|
r1 = lscan(motor, calibrated_sensor, start =scan_from, end = scan_to ,steps = steps, title=title)
|
|
|
|
#def getCrystal(crystal):
|
|
# xstal = crystal.read()
|
|
# if xstal == "None":
|
|
# Crystal_type = "None"
|
|
# elseif xstal == "Si(111)R155 4-5.5 keV"
|
|
# Crystal_type = "Si(220)R145"
|
|
# 2 Si(220)R75 5.5-8 keV
|
|
# 3 Si(220)R145 8-10.25 keV
|
|
# 4 Si(220)R200 10.25-13 keV
|
|
# 5 Si(333)R155
|
|
# return xstal
|
|
|
|
#print(getCrystal(crystal))
|
|
|
|
#motor = 'ca://SARFE10-PSSS059:MOTOR_Y3.VAL'
|
|
#title = "PSSS crystal height scan"
|
|
#sensor = ['ca://SARFE10-PSSS059:SPECTRUM_Y?samples=10&interval=10']
|
|
#scan_from = -1.7
|
|
#scan_to = -1.0
|
|
#steps = 10
|
|
#r1 = lscan(motor, sensor, start =scan_from, end = scan_to, [0.01], title=title)
|
|
#r1 = lscan(motor, sensor, start =scan_from, end = scan_to ,steps = steps, title=title)
|