-
Notifications
You must be signed in to change notification settings - Fork 12
add support for i16 DCM - there are PVs still missing in EPICS #1580
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
Open
fajinyuan
wants to merge
4
commits into
main
Choose a base branch
from
1568-add-dcm-device-for-i16
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
08dbe98
add suprot for i16 DCM - there are PVs still missing in EPICS
fajinyuan 0f3d590
Merge branch 'main' into 1568-add-dcm-device-for-i16
oliwenmandiamond 8149bec
Update src/dodal/beamlines/i16.py
fajinyuan 6eedc1d
simplify impl to not use i22 dcm.py as example.
fajinyuan 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| from dodal.common.beamlines.beamline_utils import device_factory | ||
| from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline | ||
| from dodal.devices.i16.dcm import DCM | ||
| from dodal.devices.synchrotron import Synchrotron | ||
| from dodal.log import set_beamline as set_log_beamline | ||
| from dodal.utils import BeamlinePrefix, get_beamline_name | ||
|
|
||
| BL = get_beamline_name("i16") | ||
| PREFIX = BeamlinePrefix(BL, suffix="I") | ||
| set_log_beamline(BL) | ||
| set_utils_beamline(BL) | ||
|
|
||
|
|
||
| @device_factory() | ||
| def synchrotron() -> Synchrotron: | ||
| return Synchrotron() | ||
|
|
||
|
|
||
| # dodal connect should work again after this https://jira.diamond.ac.uk/browse/I16-960 | ||
| @device_factory() | ||
| def dcm() -> DCM: | ||
| return DCM( | ||
| temperature_prefix=f"{PREFIX.beamline_prefix}-OP-DCM-01:", | ||
| prefix=f"{PREFIX.beamline_prefix}-OP-DCM-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,50 @@ | ||
| from ophyd_async.epics.core import epics_signal_r, epics_signal_w | ||
| from ophyd_async.epics.motor import Motor | ||
|
|
||
| from dodal.devices.common_dcm import BaseDCM, PitchAndRollCrystal, RollCrystal | ||
|
|
||
|
|
||
| class DCM(BaseDCM[RollCrystal, PitchAndRollCrystal]): | ||
| """ | ||
| A double crystal monochromator (DCM), used to select the energy of the beam. | ||
|
|
||
| perp describes the gap between the 2 DCM crystals which has to change as you alter | ||
| the angle to select the requested energy. | ||
|
|
||
| offset ensures that the beam exits the DCM at the same point, regardless of energy. | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, | ||
| temperature_prefix: str, | ||
| prefix: str, | ||
| name: str = "", | ||
| ) -> None: | ||
| with self.add_children_as_readables(): | ||
| # Positionable Parameters | ||
| self.perp = Motor(prefix + "XTAL2:YPRIME") | ||
| self.crystal_1_roll = Motor(prefix + "XTAL1:ROLL") | ||
| self.crystal_2_roll = Motor(prefix + "XTAL2:ROLL") | ||
| self.crystal_2_pitch = Motor(prefix + "XTAL2:PITCH") | ||
| self.crystal_2_fine_pitch_read = epics_signal_r( | ||
| float, prefix + "FPMTR:PREAD" | ||
| ) | ||
| self.crystal_2_fine_pitch_write = epics_signal_w( | ||
| float, prefix + "FPMTR:POUT" | ||
| ) | ||
| self.crystal_2_fine_roll_read = epics_signal_r( | ||
| float, prefix + "FRMTR:PREAD" | ||
| ) | ||
| self.crystal_2_fine_roll_write = epics_signal_w( | ||
| float, prefix + "FRMTR:POUT" | ||
| ) | ||
|
|
||
| # Temperatures | ||
| self.crystal_1_temp1 = epics_signal_r(float, temperature_prefix + "TMP1") | ||
| self.crystal_2_temp2 = epics_signal_r(float, temperature_prefix + "TMP2") | ||
| self.crystal_1_temp3 = epics_signal_r(float, temperature_prefix + "TMP3") | ||
| self.crystal_2_temp4 = epics_signal_r(float, temperature_prefix + "TMP4") | ||
| self.crystal_1_temp5 = epics_signal_r(float, temperature_prefix + "TMP5") | ||
| self.crystal_2_temp6 = epics_signal_r(float, temperature_prefix + "TMP6") | ||
|
|
||
| super().__init__(prefix, RollCrystal, PitchAndRollCrystal, name) |
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.
Uh oh!
There was an error while loading. Please reload this page.