ewokstomo.tasks.energycalculation.SpectrumStats#

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

Bases: Task

Stats on an attenuated spectrum.

Inputs
  • energy_eV: array-like (eV)

  • attenuated_flux : array-like (ph/s/0.1%bw)

Outputs
  • mean_energy_eV: Flux-weighted mean using bin weights: weights = flux * ΔE / (0.001 * E).

  • mean_idx (int): Index of energy_eV closest to mean_energy_eV (−1 if N/A).

  • pic_energy_eV: energy at which flux * ΔE / (0.001 * E) is maximal (NaN if N/A).

  • pic_idx (int): Index of that maximum (−1 if N/A).

Parameters:
run()[source]#

To be implemented by the derived classes