GTI#
- class gammapy.data.GTI(table)[source]#
Bases:
object
Good time intervals (GTI)
Table
.Data format specification: GTI
Note: at the moment dead-time and live-time is in the EVENTS header … the GTI header just deals with observation times.
- Parameters
- table
Table
GTI table
- table
Examples
Load GTIs for a H.E.S.S. event list:
>>> from gammapy.data import GTI >>> gti = GTI.read('$GAMMAPY_DATA/hess-dl3-dr1//data/hess_dl3_dr1_obs_id_023523.fits.gz') >>> print(gti) GTI info: - Number of GTIs: 1 - Duration: 1687.0 s - Start: 53343.92234009259 MET - Start: 2004-12-04T22:08:10.184 (time standard: TT) - Stop: 53343.94186555556 MET - Stop: 2004-12-04T22:36:17.184 (time standard: TT)
Load GTIs for a Fermi-LAT event list:
>>> gti = GTI.read("$GAMMAPY_DATA/fermi-3fhl-gc/fermi-3fhl-gc-events.fits.gz") >>> print(gti) GTI info: - Number of GTIs: 39042 - Duration: 183139597.9032163 s - Start: 54682.65603794185 MET - Start: 2008-08-04T15:44:41.678 (time standard: TT) - Stop: 57236.96833546296 MET - Stop: 2015-08-02T23:14:24.184 (time standard: TT)
Attributes Summary
GTI durations in seconds (
Quantity
).List of time intervals
Time reference (
Time
).GTI start times (
Time
).GTI end times (
Time
).Sum of GTIs in seconds (
Quantity
).Methods Summary
copy
()create
(start, stop[, reference_time])Creates a GTI table from start and stop times.
from_stack
(gtis, **kwargs)Stack (concatenate) list of event lists.
from_time_intervals
(time_intervals[, ...])From list of time intervals
group_table
(time_intervals[, atol])Compute the table with the info on the group to which belong each time interval.
read
(filename[, hdu])Read from FITS file.
select_time
(time_interval)Select and crop GTIs in time interval.
stack
(other)Stack with another GTI in place.
to_table_hdu
([format])Convert this GTI instance to a
astropy.io.fits.BinTableHDU
.union
([overlap_ok, merge_equal])Union of overlapping time intervals.
write
(filename, **kwargs)Write to file.
Attributes Documentation
- time_intervals#
List of time intervals
Methods Documentation
- classmethod create(start, stop, reference_time='2000-01-01')[source]#
Creates a GTI table from start and stop times.
- classmethod from_stack(gtis, **kwargs)[source]#
Stack (concatenate) list of event lists.
Calls
vstack
.
- classmethod from_time_intervals(time_intervals, reference_time='2000-01-01')[source]#
From list of time intervals
- group_table(time_intervals, atol='1e-6 s')[source]#
Compute the table with the info on the group to which belong each time interval.
The t_start and t_stop are stored in MJD from a scale in “utc”.
- Parameters
- time_intervalslist of
astropy.time.Time
Start and stop time for each interval to compute the LC
- atol
Quantity
Tolerance value for time comparison with different scale. Default 1e-6 sec.
- time_intervalslist of
- Returns
- group_table
Table
Contains the grouping info.
- group_table
- classmethod read(filename, hdu='GTI')[source]#
Read from FITS file.
- Parameters
- filename
pathlib.Path
, str Filename
- hdustr
hdu name. Default GTI.
- filename
- select_time(time_interval)[source]#
Select and crop GTIs in time interval.
- Parameters
- time_interval
astropy.time.Time
Start and stop time for the selection.
- time_interval
- Returns
- gti
GTI
Copy of the GTI table with selection applied.
- gti
- stack(other)[source]#
Stack with another GTI in place.
This simply changes the time reference of the second GTI table and stack the two tables. No logic is applied to the intervals.
- Parameters
- other
GTI
GTI to stack to self
- other
- to_table_hdu(format='gadf')[source]#
Convert this GTI instance to a
astropy.io.fits.BinTableHDU
.- Parameters
- format: str
Output format, currently only “gadf” is supported
- Returns
- hdu:
astropy.io.fits.BinTableHDU
GTI table converted to FITS representation
- hdu: