xpdAcq / xpdSim

simulator objects for bluesky, ophyd
http://xpdacq.github.io/xpdSim/
Other
0 stars 5 forks source link

ENH: add filters #22

Open CJ-Wright opened 7 years ago

CJ-Wright commented 7 years ago

XPD has a set of four filters for attenuating the beam intensity. It would be nice to simulate this so we could create automated exposure algorithms.

Potential design:

  1. Similar to the shutter, have the detector take in a filter object which will manage the filters
  2. If there is a filter object then get the attenuation factor from the filters (which will depend on the filter positions).
  3. Multiply the image by the attenuation factor

Expected work:

  1. Build a filter object with a similar API to the filters here. This will require making 5 objects (4 filters, which have all the methods specified here except for maybe stop, and a 5th object combining them all). The filters will need to take in an argument which specifies how much it attenuates the beam. The composite will need to take these and multiply them together to create the effective attenuation.
  2. Add a kwarg (key word argument see Scopatz and Huff p. 99) for the composite filter. Default it to None.
  3. Change how the trigger works, if the kwarg is None do not get the attenuation factor when triggering the detector, otherwise use the get_attenuation method on the filters to attenuate the image data. This may require a design refactor where these steps are done sequentially. eg
    1. Get the image from disk (this one is already done)
    2. If the shutter is down zero the image (or maybe check it first and then load the image?)
    3. Use the filters to attenuate the image

Additional information needed:

  1. Need to take a good guess or ask the beamline scientists how much each of the filters attenuate the beam.
CJ-Wright commented 7 years ago

@brookeferber

CJ-Wright commented 7 years ago

https://github.com/NSLS-II/bluesky/blob/master/bluesky/examples.py