-
Notifications
You must be signed in to change notification settings - Fork 12
Add I06 stages #2017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+231
−4
Merged
Add I06 stages #2017
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7d0a17b
Add i06 and i06-1 sample stages
oliwenmandiamond 3f46061
Combine Camera lights with DiffractionDichroism
oliwenmandiamond 7a9389f
Merge branch 'main' into i06-peem-manipulator
oliwenmandiamond ca4662d
Add tests
oliwenmandiamond c299bac
Use _THETA
oliwenmandiamond 7aec784
Add i06-2 peem + test
oliwenmandiamond f8a27ed
Change theta2 to twotheta
oliwenmandiamond 554ced3
Update doc string for PEEMManipulator
oliwenmandiamond 85b18d4
fix test
Relm-Arrowny c2bb1fb
wrong branch
Relm-Arrowny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| from dodal.beamlines.i06_shared import devices as i06_shared_devices | ||
| from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline | ||
| from dodal.device_manager import DeviceManager | ||
| from dodal.devices.motors import XYPhiStage | ||
| from dodal.log import set_beamline as set_log_beamline | ||
| from dodal.utils import BeamlinePrefix, get_beamline_name | ||
|
|
||
| BL = get_beamline_name("i06") | ||
| PREFIX = BeamlinePrefix(BL) | ||
| set_log_beamline(BL) | ||
| set_utils_beamline(BL) | ||
|
|
||
| devices = DeviceManager() | ||
| devices.include(i06_shared_devices) | ||
|
|
||
|
|
||
| @devices.factory | ||
| def ps() -> XYPhiStage: | ||
| """PEEM manipulating sample stage.""" | ||
| return XYPhiStage(f"{PREFIX.beamline_prefix}-MO-PEEM-01:", phi_infix="PHI:OS") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline | ||
| from dodal.device_manager import DeviceManager | ||
| from dodal.devices.beamlines.i06_2 import PEEMManipulator | ||
| from dodal.log import set_beamline as set_log_beamline | ||
| from dodal.utils import BeamlinePrefix, get_beamline_name | ||
|
|
||
| BL = get_beamline_name("i06_2") | ||
| PREFIX = BeamlinePrefix(BL, suffix="K") | ||
| set_log_beamline(BL) | ||
| set_utils_beamline(BL) | ||
|
|
||
|
|
||
| devices = DeviceManager() | ||
|
|
||
|
|
||
| @devices.factory | ||
| def peem() -> PEEMManipulator: | ||
| return PEEMManipulator(f"{PREFIX.beamline_prefix}-MO-PEEM-01:") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| from .led_light import LEDLight | ||
| from .motors import DiffractionDichroism | ||
|
|
||
| __all__ = ["LEDLight", "DiffractionDichroism"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from ophyd_async.core import StandardReadable | ||
| from ophyd_async.epics.core import epics_signal_rw | ||
|
|
||
| from dodal.common.enums import OnOffUpper | ||
|
|
||
|
|
||
| class LEDLight(StandardReadable): | ||
| """LED with brightness intensity and switch on/off control.""" | ||
|
|
||
| def __init__(self, prefix: str, name: str = ""): | ||
| with self.add_children_as_readables(): | ||
| self.intensity = epics_signal_rw(float, prefix + "PWMDEMAND") | ||
| self.switch = epics_signal_rw(OnOffUpper, prefix + "TOGGLE") | ||
|
|
||
| super().__init__(name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| from ophyd_async.epics.motor import Motor | ||
|
|
||
| from dodal.devices.beamlines.i06_1.led_light import LEDLight | ||
| from dodal.devices.motors import XYZThetaStage | ||
|
|
||
|
|
||
| class DiffractionDichroism(XYZThetaStage): | ||
| def __init__(self, prefix: str, name: str = ""): | ||
| with self.add_children_as_readables(): | ||
| # Additional Motors | ||
| self.chi = Motor(prefix + "CHI") | ||
| self.phi = Motor(prefix + "PHI") | ||
| self.twotheta = Motor(prefix + "DET:2THETA") | ||
| self.dy = Motor(prefix + "DET:Y") | ||
| # Camera lights | ||
| self.cl1 = LEDLight(prefix + "LED1:") | ||
| self.cl2 = LEDLight(prefix + "LED2:") | ||
| self.cl3 = LEDLight(prefix + "LED3:") | ||
| self.cl4 = LEDLight(prefix + "LED4:") | ||
| self.cl5 = LEDLight(prefix + "LED5:") | ||
|
|
||
| super().__init__( | ||
| prefix=prefix, | ||
| name=name, | ||
| x_infix="SMPL:X", | ||
| y_infix="SMPL:Y", | ||
| z_infix="SMPL:Z", | ||
| theta_infix="THETA", | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from .motors import PEEMManipulator | ||
|
|
||
| __all__ = ["PEEMManipulator"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| from ophyd_async.epics.motor import Motor | ||
|
|
||
| from dodal.devices.motors import _PHI, _X, _Y, XYPhiStage | ||
|
|
||
|
|
||
| class PEEMManipulator(XYPhiStage): | ||
| """Four-axis stage with a standard xy stage and one axis of rotation: phi. This | ||
| also has an additional energy slit (es) translational motor. | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, | ||
| prefix: str, | ||
| x_infix: str = _X, | ||
| y_infix: str = _Y, | ||
| phi_infix: str = _PHI, | ||
| es_infix: str = "ES:TRANS", | ||
| name: str = "", | ||
| ) -> None: | ||
| with self.add_children_as_readables(): | ||
| self.es = Motor(prefix + es_infix) | ||
| super().__init__(prefix, x_infix, y_infix, phi_infix, name) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import pytest | ||
| from ophyd_async.core import init_devices | ||
| from ophyd_async.testing import assert_reading, partial_reading | ||
|
|
||
| from dodal.common.enums import OnOffUpper | ||
| from dodal.devices.beamlines.i06_1 import LEDLight | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def led_light() -> LEDLight: | ||
| with init_devices(mock=True): | ||
| led_light = LEDLight("TEST:") | ||
| return led_light | ||
|
|
||
|
|
||
| async def test_led_light_read(led_light: LEDLight) -> None: | ||
| await assert_reading( | ||
| led_light, | ||
| { | ||
| "led_light-intensity": partial_reading(0), | ||
| "led_light-switch": partial_reading(OnOffUpper.ON), | ||
| }, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import pytest | ||
| from ophyd_async.core import init_devices | ||
| from ophyd_async.testing import assert_reading, partial_reading | ||
|
|
||
| from dodal.common.enums import OnOffUpper | ||
| from dodal.devices.beamlines.i06_1 import DiffractionDichroism | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def dd() -> DiffractionDichroism: | ||
| with init_devices(mock=True): | ||
| dd = DiffractionDichroism("TEST:") | ||
| return dd | ||
|
|
||
|
|
||
| async def test_dd_read(dd: DiffractionDichroism) -> None: | ||
| await assert_reading( | ||
| dd, | ||
| { | ||
| "dd-x": partial_reading(0), | ||
| "dd-y": partial_reading(0), | ||
| "dd-z": partial_reading(0), | ||
| "dd-theta": partial_reading(0), | ||
| "dd-chi": partial_reading(0), | ||
| "dd-phi": partial_reading(0), | ||
| "dd-twotheta": partial_reading(0), | ||
| "dd-dy": partial_reading(0), | ||
| "dd-cl1-intensity": partial_reading(0), | ||
| "dd-cl1-switch": partial_reading(OnOffUpper.ON), | ||
| "dd-cl2-intensity": partial_reading(0), | ||
| "dd-cl2-switch": partial_reading(OnOffUpper.ON), | ||
| "dd-cl3-intensity": partial_reading(0), | ||
| "dd-cl3-switch": partial_reading(OnOffUpper.ON), | ||
| "dd-cl4-intensity": partial_reading(0), | ||
| "dd-cl4-switch": partial_reading(OnOffUpper.ON), | ||
| "dd-cl5-intensity": partial_reading(0), | ||
| "dd-cl5-switch": partial_reading(OnOffUpper.ON), | ||
| }, | ||
| ) |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import pytest | ||
| from ophyd_async.core import init_devices | ||
| from ophyd_async.testing import assert_reading, partial_reading | ||
|
|
||
| from dodal.devices.beamlines.i06_2 import PEEMManipulator | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def peem() -> PEEMManipulator: | ||
| with init_devices(mock=True): | ||
| peem = PEEMManipulator("TEST:") | ||
| return peem | ||
|
|
||
|
|
||
| async def test_peem_read(peem: PEEMManipulator) -> None: | ||
| await assert_reading( | ||
| peem, | ||
| { | ||
| "peem-x": partial_reading(0), | ||
| "peem-y": partial_reading(0), | ||
| "peem-phi": partial_reading(0), | ||
| "peem-es": partial_reading(0), | ||
| }, | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100% not important