tardis.transport.montecarlo.estimators.util module

tardis.transport.montecarlo.estimators.util.bound_free_estimator_array2frame(bound_free_estimator_array, level2continuum_idx)[source]

Transform a bound-free estimator array to a DataFrame.

This function transforms a bound-free estimator array with entries sorted by frequency to a multi-indexed DataFrame sorted by level.

Parameters:
bf_estimator_arraynumpy.ndarray, dtype float

Array of bound-free estimators (e.g., for the stimulated recombination rate) with entries sorted by the threshold frequency of the bound-free continuum.

level2continuum_idxpandas.Series, dtype int

Maps a level MultiIndex (atomic_number, ion_number, level_number) to the continuum_idx of the corresponding bound-free continuum (which are sorted by decreasing frequency).

Returns:
pandas.DataFrame, dtype float

Bound-free estimators indexed by (atomic_number, ion_number, level_number).

tardis.transport.montecarlo.estimators.util.integrate_array_by_blocks(f, x, block_references)[source]

Integrate a function over blocks.

This function integrates a function f defined at locations x over blocks given in block_references.

Parameters:
fnumpy.ndarray, dtype float

2D input array to integrate.

xnumpy.ndarray, dtype float

1D array with the sample points corresponding to the f values.

block_referencesnumpy.ndarray, dtype int

1D array with the start indices of the blocks to be integrated.

Returns:
numpy.ndarray, dtype float

2D array with integrated values.