uvex_transients.phase_space.plotting.difference.plot_difference#

uvex_transients.phase_space.plotting.difference.plot_difference(difference: Table, path: str | Path | None = None, title: str | None = None, overlays: Sequence[Table] | None = None, annotate: Callable | None = None)[source]#

Draw the difference of two recovery maps, in dex of the recovered yield (the volume-time, for a survey).

The axes come from the space in the table’s meta when it has one (as a table of difference_map() of two maps made with grid_table() does), so the figure does not know what they are, and from the canonical luminosity and half-decline time otherwise.

The colour is \(\Delta = \log_{10}(R_\mathrm{c}/R_\mathrm{b})\), positive where the comparison recovers more, with contours at fixed numbers of dex. Cells where \(|\Delta|\) is less than two standard deviations are dotted, and cells where it is only a bound, because one map recovers essentially nothing there, are hatched by the direction of the bound. Cells where neither map recovers anything are left blank.

Parameters:
  • difference (astropy.table.Table) – The output of difference_map().

  • path (str or pathlib.Path, optional) – Where to write the figure. If omitted, the figure is not saved.

  • title (str, optional) – A title.

  • overlays (sequence of astropy.table.Table, optional) – Measurements of populations to shade, as in plot_map(). They are of the canonical axes, so a map over others takes annotate instead.

  • annotate (callable, optional) – annotate(ax), called on the axes to draw anything else, as in plot_grid(). The legend handles it returns are added to the legend of the figure.

Returns:

The figure, left open so that it can be adjusted or shown.

Return type:

matplotlib.figure.Figure

Raises:

ValueError – If the table records a space that does not have two axes, is not a regular grid, or (with overlays) is not over the canonical axes.