pybsm.otf.functional.weighted_by_wavelength

pybsm.otf.functional.weighted_by_wavelength(*, wavelengths: ndarray, weights: ndarray, my_function: Callable) ndarray

Returns a wavelength weighted composite array based on my_function.

Parameters:
  • wavelengths – array of wavelengths (m)

  • weights – array of weights corresponding to the “wavelengths” array; weights are normalized within this function so that weights.sum()==1

  • my_function – a lambda function parameterized by wavelength; e.g. otfFunction = lambda wavelengths: pybsm.otf.functional.circular_aperture_OTF (uu,vv,wavelengths,D,eta)

Returns:

weighted_fcn:

the weighted function

Raises:
IndexError:

if wavelengths or weights is empty or length of weights and wavelengths are not equal

WARNING:

Output can be nan if all weights are 0.