LightCurve

class gammapy.estimators.LightCurve(table)[source]

Bases: object

Lightcurve container.

The lightcurve data is stored in table.

For now we only support times stored in MJD format!

TODO: specification of format is work in progress See https://github.com/open-gamma-ray-astro/gamma-astro-data-formats/pull/61

Usage: Time

Parameters
tableTable

Table with lightcurve data

Attributes Summary

time

Time (Time).

time_delta

Time bin width (TimeDelta).

time_format

Time format (str).

time_max

Time bin end (Time).

time_mid

Time bin center (Time).

time_min

Time bin start (Time).

time_scale

Time scale (str).

Methods Summary

plot([ax, energy_index, time_format, flux_unit])

Plot flux points.

read(filename, **kwargs)

Read from file.

write(filename, **kwargs)

Write to file.

Attributes Documentation

time

Time (Time).

time_delta

Time bin width (TimeDelta).

time_format

Time format (str).

time_max

Time bin end (Time).

time_mid

Time bin center (Time).

time_min

Time bin start (Time).

time_scale

Time scale (str).

Taken from table “TIMESYS” header. Common values: “TT” or “UTC”. Assumed default is “UTC”.

Methods Documentation

plot(ax=None, energy_index=None, time_format='mjd', flux_unit='cm-2 s-1', **kwargs)[source]

Plot flux points.

Parameters
axAxes, optional.

The Axes object to be drawn on. If None, uses the current Axes.

energy_indexint

The index of the energy band to use. If set to None, use the first energy index. Default is None.

time_format{‘mjd’, ‘iso’}, optional

If ‘iso’, the x axis will contain Matplotlib dates. For formatting these dates see: https://matplotlib.org/gallery/ticks_and_spines/date_demo_rrule.html

flux_unitstr, Unit, optional

Unit of the flux axis

kwargsdict

Keyword arguments passed to matplotlib.pyplot.errorbar()

Returns
axAxes

Axis object

classmethod read(filename, **kwargs)[source]

Read from file.

Parameters
filenamestr

Filename

kwargsdict

Keyword arguments passed to astropy.table.Table.read.

write(filename, **kwargs)[source]

Write to file.

Parameters
filenamestr

Filename

kwargsdict

Keyword arguments passed to astropy.table.Table.write.