Plot Light Curves

We provide many customization options for display of multi-band light curves.

If you want additional configuration, you may be better served creating your own plotting function, as this is intended for quick inspection of individual lightcurves in HATS-formatted data products.

To see the method and configuration in action, check out the Plotting light curves notebook.

plot_light_curve(lc: NestedFrame, *, title='LSST light curve', mag_field='psfMag', flux_field=None, corrected_err=False, legend_kwargs=None, band_names=None, plot_kwargs=None, filter_colors=None, filter_symbols=None, filter_linestyles=None, period=None, num_periods=1, period_mjd0=None)[source]

Convenience method to plot a single light curve’s magnitude.

Note: The y-axis is upside-down since magnitude is bananas.

If you want additional configuration, you may be better served creating your own plotting function, as this is intended for quick inspection of individual lightcurves in HATS-formatted data products.

Parameters:
  • lc (npd.NestedFrame) – Light curve data a single nested dataframe.

  • title (str, optional) – Title for the plot. Defaults to “LSST light curve”.

  • mag_field (str, optional) – Field name for magnitude values. Defaults to “psfMag”. If using magnitude, the y-axis will be inverted.

  • flux_field (str, optional) – Field name for flux values. If None, uses mag_field instead. Defaults to None.

  • corrected_err (bool, optional) – Whether to use the corrected error field, f"{brightness_field}Err_corrected", instead of the original f"{brightness_field}Err". Corrected errors are added to the nested forced-source columns of the Rubin EDP2 HATS catalogs (psfFluxErr_corrected, psfDiffFluxErr_corrected and psfMagErr_corrected) by a model that rescales the errors of non-variable objects to a reduced chi-squared close to unity.

  • legend_kwargs (dict, optional) – Keyword arguments for plt.legend(). Defaults to None.

  • band_names (list, optional) – List of band names to plot. Defaults to None (uses ugrizy).

  • plot_kwargs (dict, optional) – Additional keyword arguments for plt.errorbar(). Defaults to None.

  • filter_colors (dict, optional) – Mapping of band names to colors. Defaults to plot_filter_colors_white_background.

  • filter_symbols (dict, optional) – Mapping of band names to marker symbols. Defaults to plot_symbols.

  • filter_linestyles (dict, optional) – Mapping of band names to line styles. Defaults to plot_linestyles_none.

  • period (float, optional) – If provided, folds the time axis by this period (in days). Defaults to None.

  • num_periods (int) – Used to plot multiple full periods. Defaults to 1 (single period).

  • period_mjd0 (float, optional) – The time of the start of the phase-folded light curve. If not provided, we use the earliest midpointMjdTai value.

Returns:

None

Raises:

ValueError – If corrected_err is True but lc has no corrected error column for the requested brightness field.

Colors, symbols, line styles, and band names

filter_colors, filter_symbols, filter_linestyles, and band_names all take the shared band defaults. See LSST Bands.