Skip to content

Commit 516aed9

Browse files
authored
Read mirror config via the config server (#1513)
1 parent 327c161 commit 516aed9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/mx_bluesky/hyperion/device_setup_plans/dcm_pitch_roll_mirror_adjuster.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import json
2-
31
import bluesky.plan_stubs as bps
42
from dodal.devices.focusing_mirror import (
53
FocusingMirrorWithStripes,
@@ -17,6 +15,9 @@
1715
from mx_bluesky.common.utils.utils import (
1816
energy_to_bragg_angle,
1917
)
18+
from mx_bluesky.hyperion.external_interaction.config_server import (
19+
get_hyperion_config_client,
20+
)
2021

2122
MIRROR_VOLTAGE_GROUP = "MIRROR_VOLTAGE_GROUP"
2223
DCM_GROUP = "DCM_GROUP"
@@ -27,11 +28,12 @@ def _apply_and_wait_for_voltages_to_settle(
2728
stripe: MirrorStripe,
2829
mirror_voltages: MirrorVoltages,
2930
):
30-
with open(mirror_voltages.voltage_lookup_table_path) as lut_file:
31-
json_obj = json.load(lut_file)
32-
31+
config_server = get_hyperion_config_client()
32+
config_dict = config_server.get_file_contents(
33+
mirror_voltages.voltage_lookup_table_path, dict
34+
)
3335
# sample mode is the only mode supported
34-
sample_data = json_obj["sample"]
36+
sample_data = config_dict["sample"]
3537
if stripe == MirrorStripe.BARE:
3638
stripe_key = "bare"
3739
elif stripe == MirrorStripe.RHODIUM:

0 commit comments

Comments
 (0)