DiamondLightSource / DiamondLightSource/mx-bluesky
Drive collections by dose
- Dominant language
- Python
- Stars
- 4
- Forks
- 5
- Avg merge
- 1d 30m
- Merged PRs (30d)
- 2
Description
Currently we get the exposure time for the rotation collection from agamemnon. Currently agamemnon works out the exposure time by taking a default exposure time for a specific energy and scaling it to the new energy (e.g. the calculation done in https://github.com/DiamondLightSource/mx-bluesky/issues/1247). Instead, it would be preferable to take the total dose given to us by agamemnon and calculate the `exposure_time` such that we give that much dose to the sample.
There is currently a PV (`BL03I-EA-DOSE-01`) that gives the current dose rate (in MGy/s) that the sample is experiencing based on the flux being received. This value changes based on attenuation/energy so to use this we should:
1. As the first thing in a rotation change the transmission/energy to that needed for the collection:
* Note that for hyperion the energy will be the same for the XRC so no need to change it
* For i03 we do not want to run the XBPM feedback when the transmission is not at 100% so we will probably want to pause this first too
2. Calculate the exposure time using:
```
total_exposure_time = total_dose_from_agamemnon/dose_rate
exposure_time_per_frame = total_exposure_time / num_frames
```
3. Check if this exposure time is viable for the detector (it may be too fast)
4. If it is not, then modify the transmission e.g. lower it so that the collection is slower
5. For good measure, repeat the calculation in 2?
6. Arm the detector with this exposure time and carry on as usual
Note that we do not want to do this for screening collections so we will need some way of agamemnon telling us no to do it
This will probably be wanted by other beamlines so we should make it generic if possible.
## Acceptance Criteria
- The above algorithm is implemented
Contributor guide
Assessment
This issue has not been assessed yet.