uvex_transients.utils.plotting.plot_archived_luminosity_function#

uvex_transients.utils.plotting.plot_archived_luminosity_function(table, transient_type: str, source: str | None = None, *, band: str = 'V', label: str | None = None, color: str | None = None, ax: Axes | None = None) → tuple[Figure, Axes][source]#

Overplot an archived, observed luminosity function on a model’s magnitude function, as points.

The archived rates have an overall normalization that is not ours (see ~uvex_transients.utils.luminosity_function_archive.LuminosityFunctionArchive), so they are compared by shape. The curve is normalized to unit area over the range it covers, taking each point to be the density in a bin centred on it that reaches to the midpoints between neighbouring points, and then multiplied by the fraction of the model’s events that fall in that same range. It therefore has the model’s normalization, per event, and where the two shapes agree the points lie on the model’s curve. The model’s events outside the range of the archived curve (the faint end, usually) are the reason the area of the points is less than 1.

Parameters:
  • table (QTable) – The model’s luminosity function, as drawn by plot_luminosity_function, which must be of magnitudes (meta["quantity"] == "magnitude").

  • transient_type (str) – The archive’s name for the type, such as "supernovae/Ia".

  • source (str, optional) – The source of the archived curve, such as "ASAS-SN". May be left out if the type has only one.

  • band (str, optional) – The band of both curves, such as "V".

  • label (str, optional) – Legend label of the points. If given, the legend of the axes is redrawn to include it. Defaults to the label the archive has for the curve.

  • color (str, optional) – Color of the points. Defaults to the style’s text color, so that they stand apart from the model’s curves.

  • ax (matplotlib.axes.Axes, optional) – The axes to draw onto, usually the one plot_luminosity_function returned. A new figure if None.

Returns:

Raises:

ValueError – If table is not a function of magnitude, or the model has no events in the range of the archived curve.