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, 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.

  • 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

Color palettes (filter_colors)

A color palette will be used to distinguish multi-band data, and is expected to be a dictionary, where keys are band names, and values are the color, as accepted by matplotlib.

plot_filter_colors_white_background = {'g': '#31de1f', 'i': '#370201', 'r': '#b52626', 'u': '#1600ea', 'y': '#61a2b3', 'z': '#ba52ff'}

Rubin color palette for use on a white background.

This is the default, when you have no specified a per-band color palette via the filter_colors argument.

See https://rtn-045.lsst.io/#colorblind-friendly-plots

plot_filter_colors_black_background = {'g': '#30c39f', 'i': '#2af5ff', 'r': '#ff7e00', 'u': '#3eb7ff', 'y': '#fdc900', 'z': '#a7f9c1'}

Rubin color palette for use on a black background.

See https://rtn-045.lsst.io/#colorblind-friendly-plots

plot_filter_colors_rainbow = {'g': '#49be61', 'i': '#ffc200', 'r': '#ff0000', 'u': '#0c71ff', 'y': '#990099', 'z': '#f341a2'}

Bright color palette.

Symbols (filter_symbols)

Symbols will be used to distinguish multi-band data, and is expected to be a dictionary, where keys are band names, and values are the symbol marker, as accepted by matplotlib.

plot_symbols = {'g': '^', 'i': 's', 'r': 'v', 'u': 'o', 'y': 'p', 'z': '*'}

Symbols to use for indivudual data points, varying by filter.

See https://rtn-045.lsst.io/#colorblind-friendly-plots

This is the default, when you have not specified a per-band color palette via the filter_symbols argument.

plot_filter_symbols = {'g': '^', 'i': 'D', 'r': 's', 'u': 'o', 'y': 'X', 'z': 'v'}

Alternative symbols to use for indivudual data points, varying by filter.

See https://rtn-045.lsst.io/#colorblind-friendly-plots

Line Styles (filter_linestyles)

plot_linestyles_none = {'g': None, 'i': None, 'r': None, 'u': None, 'y': None, 'z': None}

Do not use filter-varying line styles. All lines are solid.

This is the default, when you have no specified a per-band color palette via the filter_linestyles argument.

plot_linestyles = {'g': (0, (3, 1, 1, 1)), 'i': '-', 'r': '-.', 'u': '--', 'y': ':', 'z': (0, (3, 1, 1, 1, 1, 1))}

Alternative filter-varying line styles.

These can be useful to show different line styles for each filter in a plot.

Band Names (band_names)

band_names_ugrizy = ['u', 'g', 'r', 'i', 'z', 'y']

Names of passbands that will appear in the band nested column.

This is the default, when you have no specified a per-band color palette via the band_names argument.

band_names_lsst_ugrizy = ['LSST_u', 'LSST_g', 'LSST_r', 'LSST_i', 'LSST_z', 'LSST_y']

Alternative names of passbands that could appear in the band nested column.