mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2025-07-13 20:21:52 +02:00
Tested monochromator virtual axes
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@ -5,4 +5,6 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
**/out
|
**/out
|
||||||
**/.vscode
|
**/.vscode
|
||||||
**/.pytest_cache
|
**/.pytest_cache
|
||||||
|
*.egg-info
|
||||||
|
|
||||||
|
@ -145,97 +145,7 @@ fi3try:
|
|||||||
deviceGroup: beamlineMotor
|
deviceGroup: beamlineMotor
|
||||||
status: {enabled: true}
|
status: {enabled: true}
|
||||||
type: EpicsMotor
|
type: EpicsMotor
|
||||||
motry:
|
|
||||||
desc: 'OpticsHutch optical table vertical movement'
|
|
||||||
acquisition: {schedule: sync}
|
|
||||||
config: {name: motry, prefix: 'X12SA-OP-OT:TRY'}
|
|
||||||
deviceGroup: beamlineMotor
|
|
||||||
status: {enabled: true}
|
|
||||||
type: EpicsMotor
|
|
||||||
motrz1:
|
|
||||||
desc: 'Monochromator crystal 1 axial movement'
|
|
||||||
acquisition: {schedule: sync}
|
|
||||||
config: {name: motrz1, prefix: 'X12SA-OP-MO:TRZ1'}
|
|
||||||
deviceGroup: beamlineMotor
|
|
||||||
status: {enabled: true}
|
|
||||||
type: EpicsMotor
|
|
||||||
motrz1e:
|
|
||||||
desc: 'Monochromator crystal 1 axial movement encoder'
|
|
||||||
acquisition: {schedule: sync}
|
|
||||||
config: {name: motrz1e, read_pv: 'X12SA-OP-MO:ECZ1'}
|
|
||||||
deviceGroup: monitor
|
|
||||||
status: {enabled: true}
|
|
||||||
type: EpicsSignalRO
|
|
||||||
mopush1:
|
|
||||||
desc: 'Monochromator crystal 1 angle'
|
|
||||||
acquisition: {schedule: sync}
|
|
||||||
config: {name: mopush1, read_pv: 'X12SA-OP-MO:ROX1'}
|
|
||||||
deviceGroup: monitor
|
|
||||||
status: {enabled: true}
|
|
||||||
type: EpicsSignalRO
|
|
||||||
moth1e:
|
|
||||||
desc: 'Monochromator crystal 1 theta encoder'
|
|
||||||
acquisition: {schedule: sync}
|
|
||||||
config: {name: moth1e, read_pv: 'X12SA-OP-MO:ECX1'}
|
|
||||||
deviceGroup: monitor
|
|
||||||
status: {enabled: true}
|
|
||||||
type: EpicsSignalRO
|
|
||||||
moroll1:
|
|
||||||
desc: 'Monochromator crystal 1 roll'
|
|
||||||
acquisition: {schedule: sync}
|
|
||||||
config: {name: moroll1, prefix: 'X12SA-OP-MO:ROZ1'}
|
|
||||||
deviceGroup: beamlineMotor
|
|
||||||
status: {enabled: true}
|
|
||||||
type: EpicsMotor
|
|
||||||
motrx2:
|
|
||||||
desc: 'Monochromator crystal 2 horizontal movement'
|
|
||||||
acquisition: {schedule: sync}
|
|
||||||
config: {name: motrx2, prefix: 'X12SA-OP-MO:TRX2'}
|
|
||||||
deviceGroup: beamlineMotor
|
|
||||||
status: {enabled: true}
|
|
||||||
type: EpicsMotor
|
|
||||||
motry2:
|
|
||||||
desc: 'Monochromator crystal 2 vertical movement'
|
|
||||||
acquisition: {schedule: sync}
|
|
||||||
config: {name: motry2, prefix: 'X12SA-OP-MO:TRY2'}
|
|
||||||
deviceGroup: beamlineMotor
|
|
||||||
status: {enabled: true}
|
|
||||||
type: EpicsMotor
|
|
||||||
mopush2:
|
|
||||||
desc: 'Monochromator crystal 2 angle'
|
|
||||||
acquisition: {schedule: sync}
|
|
||||||
config: {name: mopush2, read_pv: 'X12SA-OP-MO:ROX2.VAL'}
|
|
||||||
deviceGroup: monitor
|
|
||||||
status: {enabled: true}
|
|
||||||
type: EpicsSignalRO
|
|
||||||
moth2e:
|
|
||||||
desc: 'Monochromator crystal 2 theta encoder'
|
|
||||||
acquisition: {schedule: sync}
|
|
||||||
config: {name: moth2e, read_pv: 'X12SA-OP-MO:ECX2'}
|
|
||||||
deviceGroup: monitor
|
|
||||||
status: {enabled: true}
|
|
||||||
type: EpicsSignalRO
|
|
||||||
#monot:
|
|
||||||
# desc: 'Monochromator temperature'
|
|
||||||
# acquisition: {schedule: sync}
|
|
||||||
# config: {name: monot, read_pv: 'X12SA-OP-MO:TC3'}
|
|
||||||
# deviceGroup: monitor
|
|
||||||
# status: {enabled: true}
|
|
||||||
# type: EpicsSignalRO
|
|
||||||
moyaw2:
|
|
||||||
desc: 'Monochromator crystal 2 yaw movement'
|
|
||||||
acquisition: {schedule: sync}
|
|
||||||
config: {name: moyaw2, prefix: 'X12SA-OP-MO:ROY2'}
|
|
||||||
deviceGroup: beamlineMotor
|
|
||||||
status: {enabled: true}
|
|
||||||
type: EpicsMotor
|
|
||||||
moroll2:
|
|
||||||
desc: 'Monochromator crystal 2 roll movement'
|
|
||||||
acquisition: {schedule: sync}
|
|
||||||
config: {name: moroll2, prefix: 'X12SA-OP-MO:ROZ2'}
|
|
||||||
deviceGroup: beamlineMotor
|
|
||||||
status: {enabled: true}
|
|
||||||
type: EpicsMotor
|
|
||||||
mobdai:
|
mobdai:
|
||||||
desc: 'Monochromator bender inner motor'
|
desc: 'Monochromator bender inner motor'
|
||||||
acquisition: {schedule: sync}
|
acquisition: {schedule: sync}
|
||||||
@ -913,28 +823,122 @@ stroz:
|
|||||||
deviceGroup: beamlineMotor
|
deviceGroup: beamlineMotor
|
||||||
status: {enabled: true}
|
status: {enabled: true}
|
||||||
type: GirderMotorROLL
|
type: GirderMotorROLL
|
||||||
mokev:
|
motry:
|
||||||
desc: 'Monochromator energy in keV'
|
desc: 'OpticsHutch optical table vertical movement'
|
||||||
acquisition: {schedule: sync}
|
acquisition: {schedule: sync}
|
||||||
config: {name: mokev, read_pv: 'X12SA-OP-MO:ROX2.VAL'}
|
config: {name: motry, prefix: 'X12SA-OP-OT:TRY'}
|
||||||
|
deviceGroup: beamlineMotor
|
||||||
|
status: {enabled: true}
|
||||||
|
type: EpicsMotor
|
||||||
|
motrz1:
|
||||||
|
desc: 'Monochromator crystal 1 axial movement'
|
||||||
|
acquisition: {schedule: sync}
|
||||||
|
config: {name: motrz1, prefix: 'X12SA-OP-MO:TRZ1'}
|
||||||
|
deviceGroup: beamlineMotor
|
||||||
|
status: {enabled: true}
|
||||||
|
type: EpicsMotor
|
||||||
|
motrz1e:
|
||||||
|
desc: 'Monochromator crystal 1 axial movement encoder'
|
||||||
|
acquisition: {schedule: sync}
|
||||||
|
config: {name: motrz1e, read_pv: 'X12SA-OP-MO:ECZ1'}
|
||||||
deviceGroup: monitor
|
deviceGroup: monitor
|
||||||
status: {enabled: true}
|
status: {enabled: true}
|
||||||
type: EnergyKev
|
type: EpicsSignalRO
|
||||||
|
|
||||||
|
|
||||||
|
moroll1:
|
||||||
|
desc: 'Monochromator crystal 1 roll'
|
||||||
|
acquisition: {schedule: sync}
|
||||||
|
config: {name: moroll1, prefix: 'X12SA-OP-MO:ROZ1'}
|
||||||
|
deviceGroup: beamlineMotor
|
||||||
|
status: {enabled: true}
|
||||||
|
type: EpicsMotor
|
||||||
|
motrx2:
|
||||||
|
desc: 'Monochromator crystal 2 horizontal movement'
|
||||||
|
acquisition: {schedule: sync}
|
||||||
|
config: {name: motrx2, prefix: 'X12SA-OP-MO:TRX2'}
|
||||||
|
deviceGroup: beamlineMotor
|
||||||
|
status: {enabled: true}
|
||||||
|
type: EpicsMotor
|
||||||
|
motry2:
|
||||||
|
desc: 'Monochromator crystal 2 vertical movement'
|
||||||
|
acquisition: {schedule: sync}
|
||||||
|
config: {name: motry2, prefix: 'X12SA-OP-MO:TRY2'}
|
||||||
|
deviceGroup: beamlineMotor
|
||||||
|
status: {enabled: true}
|
||||||
|
type: EpicsMotor
|
||||||
|
|
||||||
|
|
||||||
|
#monot:
|
||||||
|
# desc: 'Monochromator temperature'
|
||||||
|
# acquisition: {schedule: sync}
|
||||||
|
# config: {name: monot, read_pv: 'X12SA-OP-MO:TC3'}
|
||||||
|
# deviceGroup: monitor
|
||||||
|
# status: {enabled: true}
|
||||||
|
# type: EpicsSignalRO
|
||||||
|
moyaw2:
|
||||||
|
desc: 'Monochromator crystal 2 yaw movement'
|
||||||
|
acquisition: {schedule: sync}
|
||||||
|
config: {name: moyaw2, prefix: 'X12SA-OP-MO:ROY2'}
|
||||||
|
deviceGroup: beamlineMotor
|
||||||
|
status: {enabled: true}
|
||||||
|
type: EpicsMotor
|
||||||
|
moroll2:
|
||||||
|
desc: 'Monochromator crystal 2 roll movement'
|
||||||
|
acquisition: {schedule: sync}
|
||||||
|
config: {name: moroll2, prefix: 'X12SA-OP-MO:ROZ2'}
|
||||||
|
deviceGroup: beamlineMotor
|
||||||
|
status: {enabled: true}
|
||||||
|
type: EpicsMotor
|
||||||
|
|
||||||
|
mopush1:
|
||||||
|
desc: 'Monochromator crystal 1 angle'
|
||||||
|
acquisition: {schedule: sync}
|
||||||
|
config: {name: mopush1, read_pv: 'X12SA-OP-MO:ROX1'}
|
||||||
|
deviceGroup: monitor
|
||||||
|
status: {enabled: true}
|
||||||
|
type: EpicsSignalRO
|
||||||
moth1:
|
moth1:
|
||||||
desc: 'Monochromator Theta 1'
|
desc: 'Monochromator Theta 1'
|
||||||
acquisition: {schedule: sync}
|
acquisition: {schedule: sync}
|
||||||
config: {name: moth1, read_pv: 'X12SA-OP-MO:ECX1'}
|
config: {name: moth1, read_pv: 'X12SA-OP-MO:ROX1'}
|
||||||
deviceGroup: monitor
|
deviceGroup: monitor
|
||||||
status: {enabled: true}
|
status: {enabled: true}
|
||||||
type: MonoTheta1
|
type: MonoTheta1
|
||||||
|
moth1e:
|
||||||
|
desc: 'Monochromator crystal 1 theta encoder'
|
||||||
|
acquisition: {schedule: sync}
|
||||||
|
config: {name: moth1e, read_pv: 'X12SA-OP-MO:ECX1'}
|
||||||
|
deviceGroup: monitor
|
||||||
|
status: {enabled: true}
|
||||||
|
type: EpicsSignalRO
|
||||||
|
mopush2:
|
||||||
|
desc: 'Monochromator crystal 2 angle'
|
||||||
|
acquisition: {schedule: sync}
|
||||||
|
config: {name: mopush2, read_pv: 'X12SA-OP-MO:ROX2'}
|
||||||
|
deviceGroup: monitor
|
||||||
|
status: {enabled: true}
|
||||||
|
type: EpicsSignalRO
|
||||||
moth2:
|
moth2:
|
||||||
desc: 'Monochromator Theta 2'
|
desc: 'Monochromator Theta 2'
|
||||||
acquisition: {schedule: sync}
|
acquisition: {schedule: sync}
|
||||||
config: {name: moth1, read_pv: 'X12SA-OP-MO:ECX2'}
|
config: {name: moth1, read_pv: 'X12SA-OP-MO:ROX2'}
|
||||||
deviceGroup: monitor
|
deviceGroup: monitor
|
||||||
status: {enabled: true}
|
status: {enabled: true}
|
||||||
type: MonoTheta2
|
type: MonoTheta2
|
||||||
|
moth2e:
|
||||||
|
desc: 'Monochromator crystal 2 theta encoder'
|
||||||
|
acquisition: {schedule: sync}
|
||||||
|
config: {name: moth2e, read_pv: 'X12SA-OP-MO:ECX2'}
|
||||||
|
deviceGroup: monitor
|
||||||
|
status: {enabled: true}
|
||||||
|
type: EpicsSignalRO
|
||||||
|
mokev:
|
||||||
|
desc: 'Monochromator energy in keV'
|
||||||
|
acquisition: {schedule: sync}
|
||||||
|
config: {name: mokev, read_pv: 'X12SA-OP-MO:ROX2'}
|
||||||
|
deviceGroup: monitor
|
||||||
|
status: {enabled: true}
|
||||||
|
type: EnergyKev
|
||||||
|
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ class GirderMotorPITCH(PVPositioner):
|
|||||||
done = Component(EpicsSignal, ":M-DMOV", name="dmov")
|
done = Component(EpicsSignal, ":M-DMOV", name="dmov")
|
||||||
|
|
||||||
|
|
||||||
class VirtualSignalBase(EpicsSignalRO):
|
class VirtualEpicsSignalRO(EpicsSignalRO):
|
||||||
"""This is a test class to create derives signals from one or
|
"""This is a test class to create derives signals from one or
|
||||||
multiple original signals...
|
multiple original signals...
|
||||||
"""
|
"""
|
||||||
@ -141,13 +141,13 @@ class VirtualSignalBase(EpicsSignalRO):
|
|||||||
raw = super().get(*args, **kwargs)
|
raw = super().get(*args, **kwargs)
|
||||||
return self.calc(raw)
|
return self.calc(raw)
|
||||||
|
|
||||||
def describe(self):
|
#def describe(self):
|
||||||
val = self.get()
|
# val = self.get()
|
||||||
d = super().describe()
|
# d = super().describe()
|
||||||
d[self.name]["dtype"] = data_type(val)
|
# d[self.name]["dtype"] = data_type(val)
|
||||||
return d
|
# return d
|
||||||
|
|
||||||
class MonoTheta1(VirtualSignalBase):
|
class MonoTheta1(VirtualEpicsSignalRO):
|
||||||
"""Converts the pusher motor position to theta angle
|
"""Converts the pusher motor position to theta angle
|
||||||
"""
|
"""
|
||||||
_mono_a0_enc_scale1 = -1.0
|
_mono_a0_enc_scale1 = -1.0
|
||||||
@ -159,7 +159,7 @@ class MonoTheta1(VirtualSignalBase):
|
|||||||
theta1 = self._mono_a0_enc_scale1 * asin( asin_arg ) / 3.141592 * 180.0 + self._mono_a3_enc_offs1
|
theta1 = self._mono_a0_enc_scale1 * asin( asin_arg ) / 3.141592 * 180.0 + self._mono_a3_enc_offs1
|
||||||
return theta1
|
return theta1
|
||||||
|
|
||||||
class MonoTheta2(VirtualSignalBase):
|
class MonoTheta2(VirtualEpicsSignalRO):
|
||||||
"""Converts the pusher motor position to theta angle
|
"""Converts the pusher motor position to theta angle
|
||||||
"""
|
"""
|
||||||
_mono_a3_enc_offs2 = -19.7072
|
_mono_a3_enc_offs2 = -19.7072
|
||||||
@ -172,14 +172,19 @@ class MonoTheta2(VirtualSignalBase):
|
|||||||
theta2 = self._mono_a0_enc_scale2 * asin( asin_arg ) / 3.141592 * 180.0 + self._mono_a3_enc_offs2
|
theta2 = self._mono_a0_enc_scale2 * asin( asin_arg ) / 3.141592 * 180.0 + self._mono_a3_enc_offs2
|
||||||
return theta2
|
return theta2
|
||||||
|
|
||||||
class EnergyKev(VirtualSignalBase):
|
class EnergyKev(VirtualEpicsSignalRO):
|
||||||
"""Converts the pusher motor position to energy in keV
|
"""Converts the pusher motor position to energy in keV
|
||||||
"""
|
"""
|
||||||
|
_mono_a3_enc_offs2 = -19.7072
|
||||||
|
_mono_a2_pusher_offs2 = 5.93905
|
||||||
|
_mono_a1_lever_length2 = 206.572
|
||||||
|
_mono_a0_enc_scale2 = -1.0
|
||||||
_mono_hce = 12.39852066
|
_mono_hce = 12.39852066
|
||||||
_mono_2d2 = 2*5.43102/sqrt(3)
|
_mono_2d2 = 2*5.43102/sqrt(3)
|
||||||
def calc(self, val):
|
def calc(self, val):
|
||||||
theta_deg = atan(50 / val) / 2.0 * 180.0 / 3.141592
|
asin_arg = (val - self._mono_a2_pusher_offs2) / self._mono_a1_lever_length2
|
||||||
E_keV = -self._mono_hce / self._mono_2d2 / sin(theta_deg/180.0*3.14152)
|
theta2_deg = self._mono_a0_enc_scale2 * asin( asin_arg ) / 3.141592 * 180.0 + self._mono_a3_enc_offs2
|
||||||
|
E_keV = -self._mono_hce / self._mono_2d2 / sin(theta2_deg/180.0*3.14152)
|
||||||
return E_keV
|
return E_keV
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user