ewokstomo.tasks.energycalculation.ApplyAttenuators#

class ewokstomo.tasks.energycalculation.ApplyAttenuators(inputs=None, varinfo=None, node_id=None, node_attrs=None, execinfo=None, profile_directory=None)[source]#

Bases: Task

Apply a stack of attenuators to the source spectrum (and optionally flux).

Inputs#

energy_eVnumpy.ndarray

Photon energy grid in electron-volts.

spectral_powernumpy.ndarray

Power spectrum (W/eV).

attenuatorsdict[str, dict]

Mapping where each value contains material, thickness_mm and optional density_g_cm3. material accepts element symbols (e.g. "Al"), NIST aliases (e.g. "kapton") or chemical formulae parsable by xraylib.

orderlist[str], optional

Explicit stacking order of the attenuator keys. Defaults to the dictionary insertion order.

fluxnumpy.ndarray, optional

Source flux array (phot/s/0.1%bw) matching energy_eV.

Outputs#

energy_eVnumpy.ndarray

Same energy grid passed through.

transmissionnumpy.ndarray

Cumulative transmission of the attenuator stack.

attenuated_spectral_powernumpy.ndarray

spectral_power multiplied by transmission.

attenuated_fluxnumpy.ndarray | None

flux multiplied by transmission when provided, otherwise None.

type inputs:

Optional[Mapping]

param inputs:

type varinfo:

Optional[dict]

param varinfo:

type node_id:

Union[str, int, tuple, None]

param node_id:

type node_attrs:

Optional[dict]

param node_attrs:

type execinfo:

Optional[dict]

param execinfo:

type profile_directory:

Optional[dict]

param profile_directory:

run()[source]#

To be implemented by the derived classes