Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Move aperture at the start of rotation #1409

Merged
merged 12 commits into from
May 31, 2024

Conversation

olliesilvester
Copy link
Contributor

Fixes #1336

Link to dodal PR (if required): DiamondLightSource/dodal#573
(remember to update setup.cfg with the dodal commit tag if you need it for tests to pass!)

Not to be merged until the WIP GDA changes are done

To test:

  1. Confirm changes satisfy issue
  2. Confirm tests still pass

Copy link
Contributor

@d-perl d-perl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

src/hyperion/experiment_plans/rotation_scan_plan.py Outdated Show resolved Hide resolved
@@ -264,6 +283,13 @@ def rotation_scan(
def rotation_scan_plan_with_stage_and_cleanup(
params: RotationScan,
):
assert composite.aperture_scatterguard.aperture_positions is not None
yield from move_aperture(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must: I think this should probably go in or next to setup_sample_environment. We should be staging the detector as the first thing we do then asynchronously moving this into the correct place, we then only need to wait for it to have finished moving just before we do rotation_scan_plan

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good point!

Copy link
Collaborator

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, another couple of comments

src/hyperion/device_setup_plans/manipulate_sample.py Outdated Show resolved Hide resolved
@@ -44,6 +45,7 @@ class RotationScan(
default=IspybExperimentType.ROTATION
)
transmission_frac: float
selected_aperture: AperturePositionGDANames
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: I think every diffraction experiment should have aperture so this should go in DiffractionExperiment. However, I also think it should be optional and default to whatever the beamline is already set up with like for demand_energy. Do you agree @dperl-dls?

Copy link
Contributor Author

@olliesilvester olliesilvester May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

David and I talked about this a bit yesterday - GridCommon uses DiffractionExperiment. Since the grid scans determine the aperture, why should the aperture be an input parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, your way works fine too, happy with that

@olliesilvester
Copy link
Contributor Author

olliesilvester commented May 28, 2024

After discussion with @DominicOram , this PR should now do the following:

  • selected_aperture is an optional parameter of DiffractionExperiment

  • XRC: If set to None, XRC won't change the aperture, and whatever is currently in position will be used. Otherwise, XRC will set the aperture according to the parameter

  • Rotation: Same as above, and GDA should pass back the selected parameter from Hyperion's XRC

  • Robot load: Inherits from DiffractionExperiment, but the plan always sets aperture to RobotLoad position, regardless of parameter. This is because, for now, robot load and XRC use the same set of parameters.

@olliesilvester
Copy link
Contributor Author

Also, selected_aperture has a default of SMALL for gridscan, while for a general DiffractionExperiment it defaults to None

Copy link
Collaborator

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you! I think I'm happy to merge w/o the GDA changes being done yet

@olliesilvester olliesilvester merged commit f1530be into main May 31, 2024
3 of 4 checks passed
@olliesilvester olliesilvester deleted the 1336_move_to_aperture_before_rotation branch May 31, 2024 14:44
olliesilvester added a commit to olliesilvester/mx-bluesky that referenced this pull request Aug 23, 2024
)

* Add new parameter selected_aperture, rotation scan moves to aperture position as first thing

* Add function to convert from gda aperture name to aperture position

* move aperture during setup_sample_environment

* XRC uses parameter for aperture change, made optional for rotations

* Aperture selection can be none, added tests
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move to aperture from GDA before rotation
3 participants