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

1283 use pixels per micron from file not gda #1298

Merged
merged 9 commits into from
Apr 26, 2024

Conversation

rtuck99
Copy link
Contributor

@rtuck99 rtuck99 commented Apr 9, 2024

Fixes #1283

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

To test:

  1. system and unit tests pass
  2. grid scan overlay parameters shown in ispyb comments should still be calculated correctly

@rtuck99 rtuck99 requested review from d-perl and DominicOram April 9, 2024 09:06
@DominicOram DominicOram linked an issue Apr 9, 2024 that may be closed by this pull request
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.

Thanks, as per comment I think there's a bit of a nicer way to do it

Comment on lines 153 to 158
yield from bps.abs_set(
oav.snapshot.microns_per_pixel_x, oav.parameters.micronsPerXPixel
)
yield from bps.abs_set(
oav.snapshot.microns_per_pixel_y, oav.parameters.micronsPerYPixel
)
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 don't think it makes sense for it to be the job of this plan to do this at feels internal to the OAV. I think that the OAV itself should manage the state of the microns_per_pixel information. What about we convert OAVConfigParams into a Device itself that we can read the microns_per_pixel from? Then in this file when we do yield from bps.read(oav.snapshot) we can just do yield from bps.read(oav.parameters) at the same time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the microns_per_pixel should be on the snapshot as it's a property of the individual snapshot, depending on zoom etc the OAV microns per pixel can change over time, whereas if it's on the snapshot you always know that it relates to the specific image you are looking at.
Having said that I agree it would be nice if somehow the OAV device itself applied the current mpp to the snapshot at the point at which it is generated.
I didn't do it because at the time it looked a bit fiddly and didn't want to get sidetracked.

Comment on lines 162 to 163
"oav_snapshot_microns_per_pixel_x": 1.25,
"oav_snapshot_microns_per_pixel_y": 1.25,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could: Would be good to not have these equal in each dimension, to test that we're using the right one at the right time

@rtuck99 rtuck99 force-pushed the 1217_use_event_from_grid_detect_to_do_ispyb_deposition branch from b5efe47 to 5dd5eb9 Compare April 11, 2024 13:19
@rtuck99 rtuck99 force-pushed the 1283_use_pixels_per_micron_from_file_not_GDA branch from 523094c to 072d694 Compare April 11, 2024 15:24
@rtuck99 rtuck99 requested a review from DominicOram April 12, 2024 09:24
@rtuck99 rtuck99 force-pushed the 1217_use_event_from_grid_detect_to_do_ispyb_deposition branch from 662c1aa to 36436f3 Compare April 23, 2024 09:02
@rtuck99 rtuck99 force-pushed the 1283_use_pixels_per_micron_from_file_not_GDA branch from 6b8f472 to 1decd6a Compare April 23, 2024 15:07
Base automatically changed from 1217_use_event_from_grid_detect_to_do_ispyb_deposition to main April 23, 2024 16:11
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! Can you remove the unused and empty good_test_stepped_grid_scan_parameters.json and fix the merge conflicts/failing tests? Otherwise I think this is mergeable :)

rtuck99 added 9 commits April 26, 2024 11:08
…A parameters

WIP for grid-scan ispyb system test
…A parameters

WIP for grid-scan ispyb system test
…A parameters

* Remove support for 2D gridscans from ispyb callbacks
* Remove references to microns-per-pixel from ispyb params
* Ispyb system test for grid scan and grid-detect
Remove microns-per-pixel from ispyb_params
Fix minor issue where grid-ids were not being returned in the IspybIds
…napshot is triggered instead of requiring the plan to apply it manually.
* Fix broken system+unit tests
* Fix pathlib.Path being passed into grid_detection_plan instead of str
@rtuck99 rtuck99 force-pushed the 1283_use_pixels_per_micron_from_file_not_GDA branch from 1decd6a to 709859a Compare April 26, 2024 12:29
@rtuck99 rtuck99 merged commit 721afce into main Apr 26, 2024
3 of 4 checks passed
@rtuck99 rtuck99 deleted the 1283_use_pixels_per_micron_from_file_not_GDA branch April 26, 2024 12:47
olliesilvester pushed a commit to olliesilvester/mx-bluesky that referenced this pull request Aug 23, 2024
…Source/1283_use_pixels_per_micron_from_file_not_GDA

1283 use pixels per micron from file not gda
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.

Use pixels_per_micron from file not from GDA
2 participants