|
| 1 | +from ophyd_async.epics.motor import Motor |
| 2 | + |
1 | 3 | from dodal.common.beamlines.beamline_utils import ( |
2 | 4 | set_beamline as set_utils_beamline, |
3 | 5 | ) |
4 | 6 | from dodal.device_manager import DeviceManager |
| 7 | +from dodal.devices.attenuator.filter import FilterWheel |
| 8 | +from dodal.devices.attenuator.filter_selections import I19FilterOneSelections |
5 | 9 | from dodal.devices.beamlines.i19.access_controlled.hutch_access import ( |
6 | 10 | ACCESS_DEVICE_NAME, |
7 | 11 | HutchAccessControl, |
|
20 | 24 |
|
21 | 25 |
|
22 | 26 | @devices.factory() |
23 | | -def shutter() -> InterlockedHutchShutter: |
24 | | - """Real experiment shutter device for I19.""" |
25 | | - return InterlockedHutchShutter( |
26 | | - PREFIX.beamline_prefix, HutchInterlock(PREFIX.beamline_prefix) |
27 | | - ) |
| 27 | +def access_control() -> HutchAccessControl: |
| 28 | + """Device factory for access control device. |
28 | 29 |
|
| 30 | + I19 features two experimental hutches, EH-1 and EH-2, |
| 31 | + longitudinally positioned downstream from the common optics hutch: |
| 32 | + Only one active EH can control the optics. |
| 33 | + This device checks which EH is the active hutch. |
29 | 34 |
|
30 | | -@devices.factory() |
31 | | -def access_control() -> HutchAccessControl: |
32 | | - """Device to check which hutch is the active hutch on i19.""" |
| 35 | + Uses: |
| 36 | + I19 beamline prefix extended with an infix specific to the access control. |
| 37 | + Name of the access device in i19-blueapi. |
| 38 | + """ |
33 | 39 | return HutchAccessControl( |
34 | 40 | f"{PREFIX.beamline_prefix}-OP-STAT-01:", ACCESS_DEVICE_NAME |
35 | 41 | ) |
36 | 42 |
|
37 | 43 |
|
38 | 44 | @devices.factory() |
39 | | -def vfm() -> FocusingMirrorWithPiezo: |
40 | | - """Get the i19 vfm device, instantiate it if it hasn't already been. |
41 | | - If this is called when already instantiated, it will return the existing object. |
| 45 | +def attenuator_x_motor() -> Motor: |
| 46 | + """Device factory for the I19 attenuator x-axis motor. |
| 47 | +
|
| 48 | + The x-axis linear motor drives an absorber wedge horizontally orthogonal to the x-ray beam. |
| 49 | +
|
| 50 | + Uses: |
| 51 | + Prefix for the I19 beamline extended with an infix specific to the attenuator x-axis motor. |
| 52 | + Name of the attenuator system x-axis motor device. |
| 53 | +
|
| 54 | + Returns: |
| 55 | + Device for the x-axis attenuation system motor. |
42 | 56 | """ |
43 | | - return FocusingMirrorWithPiezo(f"{PREFIX.beamline_prefix}-OP-VFM-01:") |
| 57 | + return Motor(f"{PREFIX.beamline_prefix}-OP-ATTN-04:X", "attenuator_x") |
| 58 | + |
| 59 | + |
| 60 | +@devices.factory() |
| 61 | +def attenuator_y_motor() -> Motor: |
| 62 | + """Device factory for the I19 attenuator y-axis motor. |
| 63 | +
|
| 64 | + The y-axis linear motor drives an absorber wedge vertically orthogonal to the x-ray beam. |
| 65 | +
|
| 66 | + Uses: |
| 67 | + Prefix for the I19 beamline extended with an infix specific to the attenuator y-axis motor. |
| 68 | + Name of the attenuator system y-axis motor device. |
| 69 | +
|
| 70 | + Returns: |
| 71 | + Device for the y-axis attenuation system motor. |
| 72 | + """ |
| 73 | + return Motor(f"{PREFIX.beamline_prefix}-OP-ATTN-05:Y", "attenuator_y") |
| 74 | + |
| 75 | + |
| 76 | +@devices.factory() |
| 77 | +def filter_wheel() -> FilterWheel: |
| 78 | + """Device factory for the I19 EH-1 filter wheel indexing motor. |
| 79 | +
|
| 80 | + Filter wheel motor rotates indexed wheel to bring specific attenuating filter into/out of x-ray beam. |
| 81 | +
|
| 82 | + Uses: |
| 83 | + Beamline prefix for I19 extended with infix specific to the filter motor. |
| 84 | + A further infix specific to filter wheel usage. |
| 85 | + Name of the first filter wheel. |
| 86 | +
|
| 87 | + Returns: |
| 88 | + First indexed filter wheel slot selecting rotation device. |
| 89 | + """ |
| 90 | + return FilterWheel( |
| 91 | + prefix=f"{PREFIX.beamline_prefix}-MO-FILT-01:", |
| 92 | + filter_infix="FILTER", |
| 93 | + filter_selections=I19FilterOneSelections, |
| 94 | + name="filter_w_1", |
| 95 | + ) |
44 | 96 |
|
45 | 97 |
|
46 | 98 | @devices.factory() |
47 | 99 | def hfm() -> FocusingMirrorWithPiezo: |
48 | | - """Get the i19 hfm device, instantiate it if it hasn't already been. |
49 | | - If this is called when already instantiated, it will return the existing object. |
| 100 | + """Device factory for the I19 Horizontal Focus Mirror (HFM) Piezo Device. |
| 101 | +
|
| 102 | + Lazy instantiation: Instantiates a device object if none have been, |
| 103 | + else it will return the pre-existing instance. |
| 104 | +
|
| 105 | + Uses: |
| 106 | + I19 beamline prefix extended with an infix specific to the HFM. |
| 107 | +
|
| 108 | + Returns: |
| 109 | + Focusing mirror piezo device for the HFM. |
50 | 110 | """ |
51 | 111 | return FocusingMirrorWithPiezo(f"{PREFIX.beamline_prefix}-OP-HFM-01:") |
| 112 | + |
| 113 | + |
| 114 | +def shutter() -> InterlockedHutchShutter: |
| 115 | + """Device factory for the I19 optics hutch shutter device. |
| 116 | +
|
| 117 | + Uses: |
| 118 | + I19 beamline prefix extended with an infix specific to the optics hutch shutter. |
| 119 | + HutchInterlock device (itself using I19 beamline prefix) |
| 120 | +
|
| 121 | + Returns: |
| 122 | + I19 optics hutch shutter device. |
| 123 | + """ |
| 124 | + return InterlockedHutchShutter( |
| 125 | + PREFIX.beamline_prefix, HutchInterlock(PREFIX.beamline_prefix) |
| 126 | + ) |
| 127 | + |
| 128 | + |
| 129 | +@devices.factory() |
| 130 | +def vfm() -> FocusingMirrorWithPiezo: |
| 131 | + """Device factory for the I19 Vertical Focus Mirror (VFM) Piezo Device. |
| 132 | +
|
| 133 | + Lazy instantiation: Instantiates a device object if none have been, |
| 134 | + else it will return the pre-existing instance. |
| 135 | +
|
| 136 | + Uses: |
| 137 | + I19 beamline prefix with VFM infix. |
| 138 | +
|
| 139 | + Returns: |
| 140 | + Focusing mirror piezo device for the VFM. |
| 141 | + """ |
| 142 | + return FocusingMirrorWithPiezo(f"{PREFIX.beamline_prefix}-OP-VFM-01:") |
0 commit comments