fix data/index.rst
@@ -19,28 +19,28 @@ Getting Started
You can use the `~gammapy.data.EventList` class to load IACT gamma-ray event lists:
-.. code-block:: python
+.. testcode::
- >>> from gammapy.data import EventList
- >>> filename = '$GAMMAPY_DATA/hess-dl3-dr1/data/hess_dl3_dr1_obs_id_023523.fits.gz'
- >>> events = EventList.read(filename)
+ from gammapy.data import EventList
+ filename = '$GAMMAPY_DATA/hess-dl3-dr1/data/hess_dl3_dr1_obs_id_023523.fits.gz'
+ events = EventList.read(filename)
To load Fermi-LAT event lists, use the `~gammapy.data.EventListLAT` class:
-.. code-block:: python
+.. testcode::
- >>> from gammapy.data import EventList
- >>> filename = "$GAMMAPY_DATA/fermi-3fhl-gc/fermi-3fhl-gc-events.fits.gz"
- >>> events = EventList.read(filename)
+ from gammapy.data import EventList
+ filename = "$GAMMAPY_DATA/fermi-3fhl-gc/fermi-3fhl-gc-events.fits.gz"
+ events = EventList.read(filename)
The other main class in `gammapy.data` is the `~gammapy.data.DataStore`, which makes it easy
to load IACT data. E.g. an alternative way to load the events for observation ID 23523 is this:
-.. code-block:: python
+.. testcode::
- >>> from gammapy.data import DataStore
- >>> data_store = DataStore.from_dir('$GAMMAPY_DATA/hess-dl3-dr1')
- >>> events = data_store.obs(23523).events
+ from gammapy.data import DataStore
+ data_store = DataStore.from_dir('$GAMMAPY_DATA/hess-dl3-dr1')
+ events = data_store.obs(23523).events
Using `gammapy.data`
====================
