OrderSelector¶
- class marxs.optics.OrderSelector(orderlist, p=None)[source] [edit on github]¶
Bases:
object
Select from a list of order numbers independent of energy.
- Parameters:
- orderlistarray
This are the order numbers to chose from. They must be integers.
- pNone or array
Probability for a photon to end up in each order. The sum of all probabilities can be smaller than 1, if a certain fraction of photons is absorbed by the grating. If this is
None
, equal probability is assigned to all orders.
Examples
Two common use cases for testing are a grating where every photon gets diffracted into the same order or where all photons get distributed with equal probability into a set of orders.
>>> import numpy as np >>> from marxs.optics import FlatGrating, OrderSelector >>> singleordergrating = FlatGrating(d=1e-4, order_selector=OrderSelector([3])) >>> setofordersgrating = FlatGrating(d=1e-4, order_selector=OrderSelector(np.arange(-3, 4)))
Methods Summary
__call__
(energy, *args)Call self as a function.
Methods Documentation
- __call__(energy, *args)[source] [edit on github]¶
Call self as a function.