From 38dc19c92565cfb1cdcfb86ccd46a47435f1502d Mon Sep 17 00:00:00 2001 From: "Ware, Joseph (DLSLtd,RAL,LSCI)" Date: Tue, 3 Sep 2024 09:27:13 +0100 Subject: [PATCH] Get beam size from aperture radius only --- src/dodal/beamline_specific_utils/i03.py | 5 +---- .../unit_tests/util/test_beamline_specific_utils.py | 10 +--------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/dodal/beamline_specific_utils/i03.py b/src/dodal/beamline_specific_utils/i03.py index 88cc67bcc3..30db44c2a9 100644 --- a/src/dodal/beamline_specific_utils/i03.py +++ b/src/dodal/beamline_specific_utils/i03.py @@ -1,7 +1,5 @@ from dataclasses import dataclass -from dodal.devices.aperturescatterguard import ApertureValue - I03_BEAM_HEIGHT_UM = 20 @@ -11,6 +9,5 @@ class BeamSize: y_um: float | None -def beam_size_from_aperture(position: ApertureValue): - aperture_size = position.radius +def beam_size_from_aperture(aperture_size: float | None): return BeamSize(aperture_size, I03_BEAM_HEIGHT_UM if aperture_size else None) diff --git a/tests/devices/unit_tests/util/test_beamline_specific_utils.py b/tests/devices/unit_tests/util/test_beamline_specific_utils.py index f41d49f2e3..13388734c6 100644 --- a/tests/devices/unit_tests/util/test_beamline_specific_utils.py +++ b/tests/devices/unit_tests/util/test_beamline_specific_utils.py @@ -4,7 +4,6 @@ I03_BEAM_HEIGHT_UM, beam_size_from_aperture, ) -from dodal.devices.aperturescatterguard import ApertureValue RADII_AND_SIZES = [ (None, (None, None)), @@ -17,14 +16,7 @@ @pytest.mark.parametrize(["aperture_radius", "beam_size"], RADII_AND_SIZES) def test_beam_size_from_aperture(aperture_radius, beam_size): beamsize = beam_size_from_aperture( - ApertureValue( - aperture_x=0, - aperture_y=0, - aperture_z=0, - scatterguard_x=0, - scatterguard_y=0, - radius=aperture_radius, - ) + aperture_radius, ) assert beamsize.x_um == beam_size[0] assert beamsize.y_um == beam_size[1]