Skip to content

Commit

Permalink
HHL Slits Added to APS Tools (#934)
Browse files Browse the repository at this point in the history
* Modified hhl_slits to be a ophyd device.

* Added documentation for hhl_slits file

* appended _devices.rst file

* made change to release date in rst file

---------

Co-authored-by: Sector 25 ID-C User <[email protected]>
  • Loading branch information
MDecarabas and Sector 25 ID-C User authored Feb 28, 2024
1 parent 5a18d41 commit 767640c
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe future plans.
1.6.19
******

release expected by 2024-02-29
release expected by 2024-03-31

Fixes
-----
Expand Down
1 change: 1 addition & 0 deletions apstools/devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
# from .flyer_motor_scaler import _SMFlyer_Step_1
# from .flyer_motor_scaler import _SMFlyer_Step_2
# from .flyer_motor_scaler import _SMFlyer_Step_3
from .hhl_slits import HHLSlits

from .kohzu_monochromator import KohzuSeqCtl_Monochromator

Expand Down
68 changes: 68 additions & 0 deletions apstools/devices/hhl_slits.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
from ophyd import Component as Cpt
from ophyd import Device
from ophyd import FormattedComponent as FCpt
from ophyd import EpicsMotor


class HHLSlits(Device):
"""
High Heat Load Slit.
There are no independent parts to move, so each axis only has center and size.
Based on the 25-ID-A whitebeam slits.
The motor parameters listed below specify which motor records
control which axis. The last piece of the PV prefix will be
removed, and the motor number added on. For example, if the prefix
is "255ida:slits:US:", and the pitch motor is "255ida:slits:m3",
then *pitch_motor* should be "m3".
Parameters
==========
prefix:
EPICS prefix required to communicate with HHL Slit IOC, ex: "25ida:slits:US:"
pitch_motor:
The motor record suffix controlling the real pitch motor, ex "m3"
yaw_motor:
The motor record suffix controlling the real yaw motor, ex "m4"
horizontal_motor:
The motor record suffix controlling the real horizontal motor, ex: "m1"
diagonal_motor:
The motor record suffix controlling the real diagonal motor, ex: "m2"
"""

def __init__(
self,
prefix: str,
pitch_motor: str,
yaw_motor: str,
horizontal_motor: str,
diagonal_motor: str,
*args,
**kwargs,
):
# Determine the prefix for the motors
pieces = prefix.strip(":").split(":")
self.motor_prefix = ":".join(pieces[:-1])

self._pitch_motor = pitch_motor
self._yaw_motor = yaw_motor
self._horizontal_motor = horizontal_motor
self._diagonal_motor = diagonal_motor

super().__init__(prefix, *args, **kwargs)

class SlitAxis(Device):
size = Cpt(EpicsMotor, "Size", labels={"motors"})
center = Cpt(EpicsMotor, "Center", labels={"motors"})

# Individual slit directions
h = Cpt(SlitAxis, "h")
v = Cpt(SlitAxis, "v")

# Real motors that directly control the slits
pitch = FCpt(EpicsMotor, "{motor_prefix}:{_pitch_motor}", labels={"motors"})
yaw = FCpt(EpicsMotor, "{motor_prefix}:{_yaw_motor}", labels={"motors"})
horizontal = FCpt(EpicsMotor, "{motor_prefix}:{_horizontal_motor}", labels={"motors"})
diagonal = FCpt(EpicsMotor, "{motor_prefix}:{_diagonal_motor}", labels={"motors"})
7 changes: 7 additions & 0 deletions docs/source/api/_devices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ Slits

.. autosummary::

~apstools.devices.hhl_slits.HHLSlits
~apstools.devices.xia_slit.XiaSlit2D
~apstools.synApps.db_2slit.Optics2Slit1D
~apstools.synApps.db_2slit.Optics2Slit2D_HV
Expand Down Expand Up @@ -317,6 +318,12 @@ All Submodules
:show-inheritance:
:inherited-members:
.. automodule:: apstools.devices.hhl_slits
:members:
:private-members:
:show-inheritance:
:inherited-members:

.. automodule:: apstools.devices.kohzu_monochromator
:members:
:private-members:
Expand Down

0 comments on commit 767640c

Please sign in to comment.