Skip to content

Commit 23f26bc

Browse files
committed
Merge pull request #2734 from cta-observatory/data_format
Docs: Rename data model -> data format, update
2 parents ba4546f + 66ff743 commit 23f26bc

File tree

5 files changed

+35
-24
lines changed

5 files changed

+35
-24
lines changed

docs/api-reference/io/index.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,13 @@ Writing Output Files
133133
====================
134134

135135
The `DataWriter` Component allows one to write a series of events (stored in
136-
`ctapipe.containers.ArrayEventContainer`) to a standardized HDF5 format file
137-
following the data model (see :ref:`datamodels`). This includes all related datasets
138-
such as the instrument and simulation configuration information, simulated
139-
shower and image information, observed images and parameters and reconstruction
140-
information. It can be used in an event loop like:
136+
`ctapipe.containers.ArrayEventContainer`) to an HDF5 format file
137+
following the data format described in :ref:`dataformat`.
138+
This includes all related datasets such as the instrument and simulation
139+
configuration information, simulated shower and image information, observed
140+
images and parameters and reconstruction information.
141+
142+
It can be used in an event loop like:
141143

142144
.. code-block:: python
143145

docs/changes/2738.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix inverted sign of ``DispReconstructor`` prediction.
Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
.. _datamodels:
1+
.. _dataformat:
22

33
***********
4-
Data Models
4+
Data Format
55
***********
66

77
The ``ctapipe`` output files are using the HDF5 format files,
@@ -13,8 +13,16 @@ generated by ctapipe (e.g. the ``ctapipe-process`` tool which uses the
1313

1414
The tables are written with `pytables <https://www.pytables.org>`_ (not ``h5py``).
1515

16-
DL1 Data Model
17-
==============
16+
The in-memory data format is defined by the `~ctapipe.containers` structure.
17+
18+
To read this data, there are two high-level APIs available:
19+
20+
- Bulk-reading into astropy `~astropy.table.Table` objects using `~ctapipe.io.TableLoader`
21+
- Event-wise using the `~ctapipe.io.HDF5EventSource`
22+
23+
24+
DL1 Data Format
25+
===============
1826

1927
This describes data that change per-event.
2028
The following datasets will be written to the group ``/dl1/event/`` in the output file:
@@ -34,22 +42,22 @@ The following datasets will be written to the group ``/dl1/event/`` in the outp
3442
* - ``telescope/``
3543
- Per-telescope Per-event information
3644
- (group)
37-
* - ``telescope/parameters/tel_{TEL_ID:03d}``
38-
- tables of image parameters (one per telescope)
39-
- :py:class:`~ctapipe.containers.TelEventIndexContainer`, :py:class:`~ctapipe.containers.ImageParametersContainer`
4045
* - ``telescope/images/tel_{TEL_ID:03d}``
4146
- tables of telescope images (one per telescope)
4247
- :py:class:`~ctapipe.containers.TelEventIndexContainer`, :py:class:`~ctapipe.containers.DL1CameraContainer`
48+
* - ``telescope/parameters/tel_{TEL_ID:03d}``
49+
- tables of image parameters (one per telescope)
50+
- :py:class:`~ctapipe.containers.TelEventIndexContainer`, :py:class:`~ctapipe.containers.ImageParametersContainer`
4351

4452

45-
DL2 Data Model
46-
==============
53+
DL2 Data Format
54+
===============
4755

4856
This describes data that change per-event. The following datasets will be
49-
written to the group ``/dl2/event/stereo/<algorithm>/`` and or
50-
``/dl2/event/mono/<algorithm>/``, one for each reconstruction algorithm in the
51-
output file, where ``<algorithm>`` is the identifier of the algorithm (e.g.
52-
"Hillas"):
57+
written to the group ``/dl2/event/subarray/<algorithm>/`` and or
58+
``/dl2/event/telescope/<algorithm>/``, one for each reconstruction algorithm in the
59+
output file, where ``<algorithm>`` is the identifier of the algorithm
60+
(e.g. "HillasReconstructor"):
5361

5462
.. list-table::
5563
:widths: 25 50 25
@@ -69,8 +77,8 @@ output file, where ``<algorithm>`` is the identifier of the algorithm (e.g.
6977
- :py:class:`~ctapipe.containers.EventIndexContainer`, :py:class:`~ctapipe.containers.ParticleClassificationContainer`
7078

7179

72-
Simulation Data Model
73-
=====================
80+
Simulation Data Format
81+
======================
7482

7583
.. list-table::
7684
:header-rows: 1
@@ -92,8 +100,8 @@ Simulation Data Model
92100
- :py:class:`~ctapipe.containers.SimulatedShowerDistribution`
93101

94102

95-
Configuration Data Model
96-
========================
103+
Configuration Data Format
104+
=========================
97105

98106
The output file should also contain serializations of the instrument, observation (if
99107
applicable), simulation (if applicable) configuration information, written to the

docs/user-guide/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ User Guide
99

1010
getting-started
1111
tools/index
12-
data_models/index
12+
data_format/index
1313
examples_tutorials
1414
FAQ

src/ctapipe/reco/sklearn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ def _predict(self, key, table):
703703
else:
704704
prediction[valid] = valid_norms
705705

706-
sign_proba = self._models[key][1].predict_proba(X)[:, 0]
706+
sign_proba = self._models[key][1].predict_proba(X)[:, 1]
707707
# proba is [0 and 1] where 0 => very certain -1, 1 => very certain 1
708708
# and 0.5 means random guessing either. So we transform to a score
709709
# where 0 means "guessing" and 1 means "very certain"

0 commit comments

Comments
 (0)