Lightcurve

class gdt.core.plot.lightcurve.Lightcurve(data=None, background=None, canvas=None, ax=None, **kwargs)[source]

Bases: GdtPlot

Class for plotting lightcurves and lightcurve paraphernalia.

Parameters:
  • data (TimeBins, optional) – The lightcurve data to plot

  • background (BackgroundRates, optional) – The background rates to plot

  • **kwargs – Options to pass to GdtPlot

Attributes Summary

ax

The matplotlib axes object for the plot

background

The background plot element

canvas

The plotting canvas, if set upon initialization.

errorbars

The error bars plot element

fig

The matplotlib figure object

lightcurve

The lightcurve plot element

selections

The list of selection plot elements

xlim

The plotting range of the x axis

xscale

The scale of the x axis, either 'linear' or 'log'.

ylim

The plotting range of the y axis.

yscale

The scale of the y axis, either 'linear' or 'log'.

Methods Summary

add_selection(data)

Add a selection to the plot.

remove_background()

Remove the background from the plot.

remove_data()

Remove the lightcurve from the plot.

remove_errorbars()

Remove the lightcurve error bars from the plot.

remove_selections()

Remove the selections from the plot.

set_background(background)

Set the background plotting data.

set_data(data)

Set the lightcurve plotting data.

Attributes Documentation

ax

The matplotlib axes object for the plot

Type:

(matplotlib.axes)

background

The background plot element

Type:

(LightcurveBackground)

canvas

The plotting canvas, if set upon initialization.

Type:

(Canvas Backend object)

errorbars

The error bars plot element

Type:

(HistoErrorbars)

fig

The matplotlib figure object

Type:

(matplotlib.figure)

lightcurve

The lightcurve plot element

Type:

(Histo)

selections

The list of selection plot elements

Type:

(list of HistoFilled)

xlim

The plotting range of the x axis

Type:

(float, float)

xscale

The scale of the x axis, either ‘linear’ or ‘log’.

Type:

(str)

ylim

The plotting range of the y axis.

Type:

(float, float)

yscale

The scale of the y axis, either ‘linear’ or ‘log’.

Type:

(str)

Methods Documentation

add_selection(data)[source]

Add a selection to the plot. This adds a new selection to a list of existing selections.

Parameters:

data (TimeBins) – The lightcurve data selection to plot

remove_background()[source]

Remove the background from the plot.

remove_data()[source]

Remove the lightcurve from the plot.

remove_errorbars()[source]

Remove the lightcurve error bars from the plot.

remove_selections()[source]

Remove the selections from the plot.

set_background(background)[source]

Set the background plotting data. If a background already exists, this triggers a replot of the background.

Parameters:

background (BackgroundRates) – The background model to plot

set_data(data)[source]

Set the lightcurve plotting data. If a lightcurve already exists, this triggers a replot of the lightcurve.

Parameters:

data (TimeBins) – The lightcurve data to plot