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
- table
Table
Table with lightcurve data
- table
Attributes Summary
Time (
Time
).Time bin width (
TimeDelta
).Time format (str).
Time bin end (
Time
).Time bin center (
Time
).Time bin start (
Time
).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_format
¶ Time format (str).
-
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
- ax
Axes
, optional. The
Axes
object to be drawn on. If None, uses the currentAxes
.- 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()
- ax
- Returns
- ax
Axes
Axis object
- ax
-
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
.