tardis.plasma.properties.continuum_processes.fast_array_util module

tardis.plasma.properties.continuum_processes.fast_array_util.cumulative_integrate_array_by_blocks(f, x, block_references)[source]

Cumulatively integrate a function over blocks.

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

Parameters:
fnumpy.ndarray, dtype float

Input array to integrate. Shape is (N_freq, N_shells), where N_freq is the number of frequency values and N_shells is the number of computational shells.

xnumpy.ndarray, dtype float

The sample points corresponding to the f values. Shape is (N_freq,).

block_referencesnumpy.ndarray, dtype int

The start indices of the blocks to be integrated. Shape is (N_blocks,).

Returns:
numpy.ndarray, dtype float

Array with cumulatively integrated values. Shape is (N_freq, N_shells) same as f.

tardis.plasma.properties.continuum_processes.fast_array_util.numba_cumulative_trapezoid(f, x)[source]

Cumulatively integrate f(x) using the composite trapezoidal rule.

Parameters:
fnumpy.ndarray, dtype float

Input array to integrate.

xnumpy.ndarray, dtype float

The coordinate to integrate along.

Returns:
numpy.ndarray, dtype float

The result of cumulative integration of f along x