Beam attenuation#35
Conversation
Jakub Wlodek (jwlodek)
left a comment
There was a problem hiding this comment.
Marked some suggestions. Mainly I'd recommend making both device classes Movables and re-work the current methods for changing states into a set method override.
| """ | ||
| status = {} | ||
| active_attens = [] | ||
| en = self.photon_energy |
There was a problem hiding this comment.
we are already in an async function here so
| en = self.photon_energy | |
| en = await self.energy.readback.value() |
I may be wrong about the exact name, ophyd-async has a verb for "get me the one true number for this or explode".
There was a problem hiding this comment.
energy is an ophyd object, so await does not work
| def get_egu(self): | ||
| return self.energy.egu | ||
|
|
||
| async def read(self): # type: ignore[reportUnknownParameterType] |
There was a problem hiding this comment.
This needs a matched describe (unless ophyd async is providing more magic than I think it is)
| """ | ||
| status = {} | ||
| active_attens = [] | ||
| energy = self.get_photon_energy() |
There was a problem hiding this comment.
use async flavor here for access to the hardware.
There was a problem hiding this comment.
energy is a regular ophyd object, not an ophyd-async object.
started writing tests; ignored eiger_async tests for now so that running tests is somewhat useful
wrap set method in AsyncStatus
…ot have to be zero-indexed
…ed xrayutilities to calculate the transmission
… bank is the transmission
added sha back to github action; properly formatted docstrings; pass in material and thickness to constructor; added pixi format task; pass energy into utility methods; remove property reading energy
removed sorting of available transmissions because we can find the best one in linear time; also it is easier to read
Co-authored-by: Thomas A Caswell <tcaswell@bnl.gov>
991eeef to
4385f2c
Compare
Mainly, this PR creates the ability to attenuate a beam by giving control over a set of attenuators:
Also fixed various other issues: