Skip to content

Commit

Permalink
Get beam size from aperture radius only
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondJoseph committed Sep 3, 2024
1 parent 3f9ac87 commit 38dc19c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
5 changes: 1 addition & 4 deletions src/dodal/beamline_specific_utils/i03.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from dataclasses import dataclass

from dodal.devices.aperturescatterguard import ApertureValue

I03_BEAM_HEIGHT_UM = 20


Expand All @@ -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)
10 changes: 1 addition & 9 deletions tests/devices/unit_tests/util/test_beamline_specific_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
I03_BEAM_HEIGHT_UM,
beam_size_from_aperture,
)
from dodal.devices.aperturescatterguard import ApertureValue

RADII_AND_SIZES = [
(None, (None, None)),
Expand All @@ -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]

0 comments on commit 38dc19c

Please sign in to comment.