meteor_maths.utils.punpy_util module

Contents

meteor_maths.utils.punpy_util module#

Functions to band integrate spectra for given spectral response function.

meteor_maths.utils.punpy_util.func_with_unc(f: Callable, params: dict[str, float | ndarray], u_params: dict[str, None | float | ndarray], parallel: bool = False) tuple[float | ndarray, None | float | ndarray][source]#

Evaluate function and uncertainties using Monte Carlo method

Provides simple interface to run a simple Monte Carlo experiment with punpy.

Parameters:
  • f – function

  • params – function parameters

  • u_params – function parameter uncertainties (entries keys same as parameters, one uncertainty per parameter).

Entries may be of following type:

  • None - value assumed a constant, no uncertainty (assumed if not provided)

  • float - assumed to be a relative random uncertainty

  • 1 dimensional numpy.ndarray - assumed to be an array of absolute random uncertainties (must be same length as

variable parameter) * 2 dimensional numpy.ndarray - assumed to be a covariance matrix (must be the length of the variable parameter square)

Returns:

evaluated function and uncertainty