-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2473 from cta-observatory/irf-maker
Irf maker and cut optimiser
- Loading branch information
Showing
36 changed files
with
4,155 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.. _benchmarks: | ||
|
||
********** | ||
Benchmarks | ||
********** | ||
|
||
|
||
Reference/ API | ||
============== | ||
|
||
.. automodapi:: ctapipe.irf.benchmarks | ||
:no-inheritance-diagram: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.. _binning: | ||
|
||
******* | ||
Binning | ||
******* | ||
|
||
|
||
Reference/ API | ||
============== | ||
|
||
.. automodapi:: ctapipe.irf.binning | ||
:no-inheritance-diagram: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.. _irf: | ||
|
||
********************************************** | ||
Instrument Response Functions (`~ctapipe.irf`) | ||
********************************************** | ||
|
||
.. currentmodule:: ctapipe.irf | ||
|
||
This module contains functionalities for generating instrument response functions. | ||
The simulated events used for this have to be selected based on their associated "gammaness" | ||
value and (optionally) their reconstructed angular offset from their point of origin. | ||
The code for doing this can found in :ref:`cut_optimization` and is intended for use via the | ||
`~ctapipe.tools.optimize_event_selection.EventSelectionOptimizer` tool. | ||
|
||
The generation of the irf components themselves is implemented in :ref:`irfs` and is intended for | ||
use via the `~ctapipe.tools.compute_irf.IrfTool` tool. | ||
This tool can optionally also compute some common benchmarks, which are implemented in :ref:`benchmarks`. | ||
|
||
The cut optimization as well as the calculations of the irf components and the benchmarks | ||
are done using the `pyirf <https://pyirf.readthedocs.io/en/stable/>`_ package. | ||
|
||
:ref:`binning`, :ref:`preprocessing`, and :ref:`spectra` contain helper functions and classes used by many of the | ||
other components in this module. | ||
|
||
|
||
Submodules | ||
========== | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
optimize | ||
irfs | ||
benchmarks | ||
binning | ||
preprocessing | ||
spectra | ||
|
||
|
||
Reference/API | ||
============= | ||
|
||
.. automodapi:: ctapipe.irf | ||
:no-inheritance-diagram: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.. _irfs: | ||
|
||
************** | ||
IRF components | ||
************** | ||
|
||
|
||
Reference/ API | ||
============== | ||
|
||
.. automodapi:: ctapipe.irf.irfs | ||
:no-inheritance-diagram: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.. _cut_optimization: | ||
|
||
******************************** | ||
G/H (and Theta) Cut Optimization | ||
******************************** | ||
|
||
|
||
Reference/ API | ||
============== | ||
|
||
.. automodapi:: ctapipe.irf.optimize | ||
:no-inheritance-diagram: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.. _preprocessing: | ||
|
||
******************************* | ||
Event Loading and Preprocessing | ||
******************************* | ||
|
||
|
||
Reference/ API | ||
============== | ||
|
||
.. automodapi:: ctapipe.irf.preprocessing | ||
:no-inheritance-diagram: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.. _spectra: | ||
|
||
************************************* | ||
Spectra definitions for event weights | ||
************************************* | ||
|
||
|
||
Reference/ API | ||
============== | ||
|
||
.. automodapi:: ctapipe.irf.spectra | ||
:no-inheritance-diagram: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Add a ``ctapipe-optimize-event-selection`` tool to produce cut-selection files, | ||
based on a gamma, and optionally a proton and an electron DL2 file. | ||
Two components for calculating G/H and optionally theta cuts are added: | ||
``PercentileCuts`` keeps a certain percentage of gamma events in each bin and | ||
``PointSourceSensitivityOptimizer`` optimizes G/H cuts for maximum point source sensitivity and | ||
optionally calculates percentile theta cuts. | ||
|
||
Add a ``ctapipe-compute-irf`` tool to produce irfs given a cut-selection file, a gamma, | ||
and optionally a proton, and an electron DL2 input file. | ||
Given only a gamma file, the energy dispersion, effective area, and point spread function are calculated. | ||
Optionally, the bias and resolution of the energy reconstruction and the angular resolution can be calculated | ||
and saved in a separate output file. | ||
If a proton or a proton and an electron file is also given, a background model can be calculated, | ||
as well as the point source sensitivity. | ||
|
||
Irfs can be calculated with and without applying a direction cut. | ||
Only radially symmetric parameterizations of the irf components are implemented so far. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ dependencies: | |
- pypandoc | ||
- pre-commit | ||
- psutil | ||
- pyirf | ||
- pytables | ||
- pytest | ||
- pytest-cov | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.