Skip to content

Commit

Permalink
Merge pull request #1273 from tongju12/pf1k4-pf-y
Browse files Browse the repository at this point in the history
adding PA1K4-PF device in TMO  beamline
  • Loading branch information
tangkong authored Aug 20, 2024
2 parents 872a53b + f57216d commit 75d68e7
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/source/upcoming_release_notes/1273-adding_pa1k4-pf_device.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
1273 adding pa1k4-pf device
#################

API Breaks
----------
- N/A

Features
--------
- N/A

Device Updates
--------------
- N/A

New Devices
-----------
- adding new device PA1K4-PF

Bugfixes
--------
- N/A

Maintenance
-----------
- N/A

Contributors
------------
- tongju12
51 changes: 51 additions & 0 deletions pcdsdevices/tmo_ip1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"""TMO sample calibration foil to work with spectrometer"""
from lightpath import LightpathState
from ophyd.device import Component as Cpt

from .device import GroupDevice
from .device import UpdateComponent as UpCpt
from .epics_motor import BeckhoffAxis
from .interface import BaseInterface, LightpathMixin
from .pmps import TwinCATStatePMPS


class CalibrationAxis(TwinCATStatePMPS):
"""
Sample calibration 1D State Setup
Here, we specify 5 states, and 1 motor, for Y
axe.
"""
config = UpCpt(state_count=5, motor_count=1)


class SCaFoil(BaseInterface, GroupDevice, LightpathMixin):
"""
TMO PMPS1D sample calibration class.
Parameters:
-----------
prefix : str
Base PV for the motion system
name : str
Alias for the device
"""
# UI Representation
_icon = 'fa.minus-square'
tab_component_names = True

# Sample calibration Y axis

pf_state = Cpt(CalibrationAxis, ':STATE', kind='normal')
pf_y = Cpt(BeckhoffAxis, ':MMS:Y', doc="Y-axis of photo filter pa1k4", kind='normal')
removed = False
transmission = 1
SUB_STATE = 'state'

# dummy signal, state is always the same
lightpath_cpts = ['cali_foil.user_readback']

def calc_lightpath_state(self, **kwargs) -> LightpathState:
return LightpathState(
inserted=True,
removed=False,
output={self.output_branches[0]: 1}
)

0 comments on commit 75d68e7

Please sign in to comment.