EnergyFilter

class marxs.optics.EnergyFilter(**kwargs)[source] [edit on github]

Bases: FlatOpticalElement

Energy dependent filter with position, size etc.

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), where p, en are 1-d arrays of floats with the same number of elements.

Examples

>>> from scipy.interpolate import interp1d
>>> from marxs.optics import EnergyFilter
>>> energygrid = [.1, .5, 1., 2., 5.]
>>> filtercurve = [.1, .5, .9, .9, .5]
>>> f = interp1d(energygrid, filtercurve)
>>> blockingfilter = EnergyFilter(filterfunc=f, position=[4, 1, 0], zoom=4)

Define a new MARXS element.

Attributes Summary

display

Dictionary for display specifications, e.g. color.

Methods Summary

specific_process_photons(photons, intersect, ...)

Attributes Documentation

display = {'color': (1.0, 0.0, 0.0), 'opacity': 0.5, 'shape': 'box'}

Dictionary for display specifications, e.g. color

Methods Documentation

specific_process_photons(photons, intersect, interpos, intercoos)[source] [edit on github]