LightCurve¶
-
class
gammapy.time.
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 - Time analysis
- 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
(self[, ax, time_format, flux_unit])Plot flux points.
read
(filename, \*\*kwargs)Read from file.
write
(self, 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
(self, ax=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
.- 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
(self, filename, **kwargs)[source]¶ Write to file.
- Parameters
- filenamestr
Filename
- kwargsdict
Keyword arguments passed to
astropy.table.Table.write
.