data - Data and observations

Introduction

gammapy.data currently contains the EventList class, as well as classes for IACT data and observation handling.

Getting Started

You can use the EventList class to load IACT gamma-ray event lists:

>>> from gammapy.data import EventList
>>> filename = '$GAMMAPY_EXTRA/datasets/hess-dl3-dr1/data/hess_dl3_dr1_obs_id_023523.fits.gz'
>>> events = EventList.read(filename)

To load Fermi-LAT event lists, use the EventListLAT class:

>>> from gammapy.data import EventListLAT
>>> filename = '$GAMMAPY_EXTRA/datasets/fermi_2fhl/2fhl_events.fits.gz'
>>> events = EventListLAT.read(filename)

The other main class in gammapy.data is the DataStore, which makes it easy to load IACT data. E.g. an alternative way to load the events for observation ID 23523 is this:

>>> from gammapy.data import DataStore
>>> data_store = DataStore.from_dir('$GAMMAPY_EXTRA/datasets/hess-dl3-dr1')
>>> events = data_store.obs(23523).events

Using gammapy.data

Gammapy tutorial notebooks that show examples using gammapy.data:

Reference/API

gammapy.data Package

Data and observation handling.

Classes

DataStore([hdu_table, obs_table]) IACT data store.
DataStoreObservation(obs_id, data_store) IACT data store observation.
EventList(table) Event list for IACT dataset
EventListBase(table) Event list.
EventListLAT(table) Event list for Fermi-LAT dataset
GTI(table) Good time intervals (GTI) Table.
HDUIndexTable([data, masked, names, dtype, …]) HDU index table.
HDULocation(obs_id, hdu_type, hdu_class, …) HDU localisation, loading and Gammapy object mapper.
InvalidDataError Invalid data found.
ObservationCTA([obs_id, gti, events, aeff, …]) Container class for an CTA observation
ObservationList([initlist]) List of DataStoreObservation.
ObservationStats([n_on, n_off, a_on, a_off, …]) Observation statistics.
ObservationSummary(obs_stats) Summary of observations.
ObservationTable([data, masked, names, …]) Observation table.
ObservationTableSummary(obs_table[, target_pos]) Observation table summary.
PointingInfo(table) IACT array pointing info.