GlobalEnergyFilter¶
- class marxs.optics.GlobalEnergyFilter(**kwargs)[source] [edit on github]¶
Bases:
MarxsElement
Energy dependent filter that globally affects all photons.
This element is used on all photons in the list, there is no geometrical position associated with it. Consequently, there is no update of the position or direction for each photon. Use this element for global filters, that are not directly associated with any particular physical object, e.g. to apply a energy based mirror efficiency after passing the photons through one of the perfect efficiency mirror models.
- Parameters:
- filterfunccallable
A function that calculates the probability for each photon to pass through the filter based on the photon energy in keV. The function signature should be
p = func(en)
, wherep, en
are 1-d arrays of floats with the same number of elements.
See also
Examples
>>> from scipy.interpolate import interp1d >>> from marxs.optics import GlobalEnergyFilter >>> energygrid = [.1, .5, 1., 2., 5.] >>> filtercurve = [.1, .5, .9, .9, .5] >>> f = interp1d(energygrid, filtercurve) >>> blockingfilter = GlobalEnergyFilter(filterfunc=f)
Define a new MARXS element.
Methods Summary
__call__
(photons)Call self as a function.
Methods Documentation
- __call__(photons)[source] [edit on github]¶
Call self as a function.