Skip to content

Commit

Permalink
Move default aperture position to constants
Browse files Browse the repository at this point in the history
  • Loading branch information
olliesilvester committed Sep 5, 2024
1 parent 463cfaf commit 9ff2c83
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/mx_bluesky/hyperion/parameters/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from enum import Enum

from dodal.devices.aperturescatterguard import AperturePositionGDANames
from dodal.devices.detector import EIGER2_X_16M_SIZE
from pydantic.dataclasses import dataclass

Expand Down Expand Up @@ -77,6 +78,11 @@ class GridscanParamConstants:
OMEGA_2 = 90.0


@dataclass(frozen=True)
class RotationParamConstants:
DEFAULT_APERTURE_POSITION = AperturePositionGDANames.LARGE_APERTURE


@dataclass(frozen=True)
class DetectorParamConstants:
BEAM_XY_LUT_PATH = (
Expand All @@ -90,6 +96,7 @@ class DetectorParamConstants:
class ExperimentParamConstants:
DETECTOR = DetectorParamConstants()
GRIDSCAN = GridscanParamConstants()
ROTATION = RotationParamConstants()


_test_oav_file = "tests/test_data/test_OAVCentring.json"
Expand Down
12 changes: 7 additions & 5 deletions src/mx_bluesky/hyperion/parameters/rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
TemporaryIspybExtras,
WithScan,
)
from mx_bluesky.hyperion.parameters.constants import CONST, I03Constants

DEFAULT_APERTURE_POSITION = AperturePositionGDANames.LARGE_APERTURE
from mx_bluesky.hyperion.parameters.constants import (
CONST,
I03Constants,
RotationParamConstants,
)


class RotationScanPerSweep(OptionalGonioAngleStarts, OptionalXyzStarts):
Expand Down Expand Up @@ -89,9 +91,9 @@ def _set_default_aperture_position(
):
if not aperture_position:
LOGGER.warning(
f"No aperture position selected. Defaulting to {DEFAULT_APERTURE_POSITION}"
f"No aperture position selected. Defaulting to {RotationParamConstants.DEFAULT_APERTURE_POSITION}"
)
return DEFAULT_APERTURE_POSITION
return RotationParamConstants.DEFAULT_APERTURE_POSITION
else:
return aperture_position

Expand Down

0 comments on commit 9ff2c83

Please sign in to comment.