uvex_transients.transients.supernovae.TypeIIbSNe.luminosity_function#

TypeIIbSNe.luminosity_function(bandpass: SpectralElement, n: int, *, quantity: str = 'luminosity', bins: int | ArrayLike | Quantity = 30, t: Quantity | None = None, t_min: Quantity | None = None, t_max: Quantity | None = None, n_time: int | None = None, spacing: str = 'log', confidence: float = 0.6827, rng: Generator | int | None = None) → QTable#

Estimate the luminosity function of this transient class in a band, by drawing events from its SED priors.

n events are drawn, the peak of each one’s rest-frame band light curve is measured (see ~uvex_transients.models.core.base.SpectralModel.sample_peak_luminosities), and the peaks are binned. The result is the normalized distribution of peak luminosity, not a volumetric rate density: multiply the pdf by ExtragalacticTransient.rate (or rate * rate_shape(z)) for events per volume, time and luminosity. Whether n is enough is for the caller to judge from the intervals of the bins.

Parameters:
  • bandpass (SpectralElement) – The band, for example mission.detector.bandpasses["FUV"].

  • n (int) – Number of events to draw.

  • quantity ({"luminosity", "magnitude"}, optional) – What the function is of. "luminosity" is the peak band luminosity \(L\) in erg/s, and pdf is \(\mathrm{d}N/\mathrm{d}L\) per event, in 1/(erg/s). "magnitude" is the absolute AB magnitude \(M\) of that peak, brightest first, and pdf is \(\mathrm{d}N/\mathrm{d}M\) per event, in 1/mag. \(M\) is the magnitude at 10 pc of a spectrum flat in \(L_\nu\) with that band luminosity (see ~uvex_transients.utils.phot_utils.luminosity_to_absolute_magnitude), so it is a monotonic conversion of \(L\), not the photon-weighted band magnitude of the SED.

  • bins (int or array-like or Quantity, optional) – Either the number of bins, which span the sample (equally spaced in \(\log L\) for luminosities, so that the bins are not all empty but one, and equally spaced in \(M\) for magnitudes), or the bin edges, increasing, in erg/s or magnitudes. The density is per unit \(L\) or \(M\) either way.

  • t (Quantity, optional) – Rest-frame times since explosion at which the light curves are evaluated, shape (T,). If given, the four arguments below are ignored. See ~uvex_transients.models.core.base.SpectralModel.sample_peak_luminosities.

  • t_min (Quantity, optional) – Start of the grid of times. If None (the default), uses config["phase_space.overlay.t_min"] days.

  • t_max (Quantity, optional) – End of the grid of times. If None (the default), uses config["phase_space.overlay.t_max_factor"] times DEFAULT_DURATION.

  • n_time (int, optional) – Number of points of the grid. If None (the default), uses config["phase_space.overlay.n_time"].

  • spacing ({"log", "linear"}, optional) – How the grid is spaced between t_min and t_max.

  • confidence (float, optional) – Confidence level of the intervals, 68.27% (one sigma) by default.

  • rng (numpy.random.Generator, int, or None, optional) – Random-number source for the draws.

Returns:

One row per bin: its edges lo and hi; count, the number of the n events in it, with the interval count_lo and count_hi on the count that n events give; and pdf, the normalized density with pdf_lo and pdf_hi. Events with no peak, or a peak of no light, are dropped before binning. meta holds the class name, quantity, n (as asked), n_valid and confidence; the density is normalized to n_valid.

Return type:

QTable

Raises:

ValueError – If quantity is not recognised, bins is invalid, or no event has a measurable peak.