uvex_transients.utils.phot_utils.photon_weighted_band_average#

uvex_transients.utils.phot_utils.photon_weighted_band_average(flux_density: NDArray, nu: NDArray, throughput: NDArray) → NDArray[source]#

Average a flux density over a band, weighting by photon counts: \(\int F_\nu T\,d\nu/\nu\,/\int T\,d\nu/\nu\).

This is the same average band_weight_matrix evaluates on a rest-frame grid for many redshifts at once. Here it is a trapezoid rule on the band’s own samples, for one set of observed flux densities.

Parameters:
  • flux_density (numpy.ndarray) – The flux density at each band sample, shape (..., F).

  • nu (numpy.ndarray) – The band’s frequencies, shape (F,), increasing.

  • throughput (numpy.ndarray) – The throughput at each frequency, shape (F,).

Returns:

The band-averaged flux density, shape (...).

Return type:

numpy.ndarray