Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions src/dodal/devices/beamlines/i15_1/laue.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ def __init__(
crystal_lut_path: str,
name: str = "",
):
with self.add_children_as_readables():
self.bend = Motor(prefix + "BENDER")
self.bragg = Motor(prefix + "PITCH")
self.roll = Motor(prefix + "ROLL")
self.yaw = Motor(prefix + "YAW")
self.y = Motor(prefix + "Y")
self.bend = Motor(prefix + "BENDER")
self.bragg = Motor(prefix + "PITCH")
self.roll = Motor(prefix + "ROLL")
self.yaw = Motor(prefix + "YAW")
self.y = Motor(prefix + "Y")

with self.add_children_as_readables(StandardReadableFormat.HINTED_SIGNAL):
self.energy_kev = derived_signal_r(self._get_energy, y=self.y)
Expand All @@ -29,10 +28,7 @@ def __init__(

def _get_xtal_config(self) -> XpdfCrystalLookupTable:
return self._config_client.get_file_contents(
self._crystal_lut_path,
XpdfCrystalLookupTable,
# Remove once https://github.com/DiamondLightSource/daq-config-server/pull/183 is released + deployed
force_parser=XpdfCrystalLookupTable.from_contents,
self._crystal_lut_path, XpdfCrystalLookupTable
)

def _get_energy(self, y: float) -> float:
Expand Down
2 changes: 1 addition & 1 deletion tests/devices/beamlines/i15_1/test_laue_monochrometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ async def test_energy_kev_gets_value_based_on_y(
await assert_reading(
laue_monochrometer,
{f"{laue_monochrometer.name}-energy_kev": partial_reading(expected_energy)},
full_match=False,
full_match=True,
)
12 changes: 7 additions & 5 deletions tests/test_data/test_i15-1_crystal_y_energy_lut.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Units mm keV
# y energy
1.455 40.05 # xtal 311
-48.845 65.40 # xtal 220
50.600 76.69 # xtal 111
{
"rows": [
[1.455, 40.05],
[-48.845,65.4],
[50.6,76.69]
]
}
Loading