Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Irf maker and cut optimiser #2473

Merged
merged 195 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
0b87a8f
First kludge of protopipe irf code as a ctapipe tool
Tobychev Apr 18, 2023
29a2305
Fixed names so the tool can install properly
Tobychev Apr 19, 2023
e7fae22
Fixing two small comments from Karl
Tobychev Apr 25, 2023
1800dfe
Various small fixes
Tobychev May 3, 2023
9d6f043
Big refactor to use components as intended
Tobychev May 3, 2023
46b77a7
Got it all to run
Tobychev May 4, 2023
330cbd1
Formatting fixes
Tobychev May 4, 2023
46ec47d
Adjusting defaults to make only one bin in offset?
Tobychev May 4, 2023
8921f05
Moved preselection to start()
Tobychev May 10, 2023
fb1cd9d
Use only one true energy axis
Tobychev May 10, 2023
e60f7a2
Use only one true energy axis
Tobychev May 10, 2023
eff26fa
Use only one true energy axis
Tobychev May 10, 2023
05952bc
Refactoring to group things in the same manner
Tobychev May 10, 2023
2f0dee8
Split preselct into remaning and quality selecting, made EventPreProc…
Tobychev May 12, 2023
d0865a3
Fixed serveral problems
Aug 23, 2023
fb2715f
Fixed unit issue
Aug 23, 2023
1c8fd69
Updated some defaults
Tobychev Aug 23, 2023
3c844f8
Updated some comments to avoid problems with the doctest
Tobychev Aug 28, 2023
d1e79f2
Add changelog
Tobychev Aug 28, 2023
d04289e
Fixed small bug, trying to pass doctests
Tobychev Aug 28, 2023
b31a169
Refactored after feedback
Tobychev Sep 5, 2023
e4066b0
Refactored after feedback
Tobychev Sep 5, 2023
641c7c9
Refactored after feedback
Tobychev Sep 5, 2023
a64577f
Made spectra into enums
Tobychev Sep 5, 2023
a1a49e2
Added specific configuration of the optimisation grid to the cut opti…
Tobychev Sep 7, 2023
99fb702
Refactored based on feedback: new tests that simulations stay consist…
Tobychev Sep 8, 2023
36bb7ee
Refactored based on feedback: cleaner test
Tobychev Sep 8, 2023
5644f0f
Various changes to match reference script.
Tobychev Sep 11, 2023
8e1004a
Reworked how initial theta cuts are calculated, changed some logging …
Tobychev Sep 19, 2023
590ad49
Update conf.py
Tobychev Sep 20, 2023
8ebeac4
Moved PSF related quantities into its own component
Tobychev Sep 26, 2023
453be91
Renamed PSF component to ThetaCutsCalculator, other small refactors
Tobychev Sep 26, 2023
04aa3bd
Update to support newest pyirf version
Tobychev Oct 5, 2023
8bc8af0
Fix logging error
Tobychev Oct 5, 2023
960face
Use consistent offset binning
Tobychev Oct 18, 2023
b4d2b0c
Add theta cut to the background, change logging statments
Tobychev Oct 23, 2023
097fb95
Partial refactoring into optimising and calculating parts
Tobychev Nov 16, 2023
7fa0a88
Mayor refactor complete, still not running properly
Tobychev Nov 23, 2023
1132a9d
Various changes to get the code to run end to end
Tobychev Nov 25, 2023
dfd612f
Pretty large refactoring around how results are saved, cleaned out so…
Tobychev Dec 1, 2023
660d956
Further refactoring to decouple things now that there are two tools
Tobychev Dec 5, 2023
2909dc0
Added background and benchmarking option to the make_irf tool
Tobychev Dec 5, 2023
83e5b01
removed some dead code that had been left behind by mistake
Tobychev Dec 7, 2023
39025c8
Minor fixes
LukasBeiske Dec 7, 2023
ba2bb61
Ensure users requested binning is honoured
Tobychev Dec 8, 2023
e4a037d
Fixed typo in EXTNAME of energy dispersion
Tobychev Dec 12, 2023
0333238
Add several convenience functions for plotting irfs
Tobychev Dec 12, 2023
0341151
Added function to draw 2d hist from a irf table
Tobychev Dec 12, 2023
073aabe
Use integar indices for fov bounds; fix write out of benchmark hdus
LukasBeiske Dec 19, 2023
a10fb82
Remove redundant overwrite flag
LukasBeiske Dec 19, 2023
a19dd7b
Add some aliases and flags; fix logging bug
LukasBeiske Dec 19, 2023
3786543
Rename some files and classes
LukasBeiske Dec 19, 2023
70d7abe
Make EventPreProcessor a subcomponent of EventsLoader
LukasBeiske Dec 19, 2023
db487c9
Use reco energy for rad_max table
LukasBeiske Dec 20, 2023
668b91a
Use n_bins everywhere instead of n_edges
LukasBeiske Jan 12, 2024
2dcb1d2
Add reco bins to logging; remove unused bins
LukasBeiske Jan 12, 2024
b45ea6a
Fix EventPreProcessor configurability
LukasBeiske Jan 13, 2024
188eb63
Make ThetaCutsCalculator configurable
LukasBeiske Jan 13, 2024
30112eb
Fix help for n_bins config options
LukasBeiske Jan 15, 2024
8b9a179
Added helper function for plotting just bin-wise statistics of IRF ta…
Tobychev Jan 10, 2024
11e3b48
Added energy binning directly to the PsfIrf class
Tobychev Jan 15, 2024
da187d5
Created a Background2D and Background3D IRF classes
Tobychev Jan 15, 2024
337144b
Add option for point-like IRF; support diffuse and point-like gammas
LukasBeiske Jan 15, 2024
e764763
Update to consistently use number of bins
Tobychev Jan 16, 2024
2f57ace
Added calculation of fov_lat/lon and explicit column descriptions
Tobychev Jan 16, 2024
a2adb18
Added a bit of logging
Tobychev Jan 16, 2024
f76b1c0
Remove unnecessary conversions
Tobychev Jan 16, 2024
89ae390
Moved stuff to match src/ organisatoin
Tobychev Feb 6, 2024
47d3a44
Fix extra dimension in effective area per offset, adapt to new loader…
Tobychev Feb 25, 2024
5f46ad1
Fixed bug where background only used gh-cuts
Tobychev Feb 29, 2024
6df85a6
Renamed some options for clarity
Tobychev Mar 5, 2024
215dd40
Clarified arguments for full-enclosure irfs
Tobychev Apr 10, 2024
2cde08a
Sort and remove duplicates in sphinx nitpicks
LukasBeiske Apr 29, 2024
271b8be
Use AstroQuantity trait for observation time
LukasBeiske Apr 29, 2024
77d501f
Add definition of selectable spectra to irf.select
LukasBeiske Apr 29, 2024
fea7bd4
Force same clf for computation and application of g/h cuts; warn if o…
LukasBeiske Apr 29, 2024
4cf4e01
Use full-enclosure flag for cut optimization tool
LukasBeiske Apr 30, 2024
182e6de
Remove theta cut re-calculation from irf-tool; move ThetaCutsCalculat…
LukasBeiske May 2, 2024
0a0ebcb
Make saving a theta cut optional in cut-opt tool and if saved, also s…
LukasBeiske May 2, 2024
c5d57ed
Remove redundant bin range check
LukasBeiske May 2, 2024
cb6a501
Apply event selection per particle type
LukasBeiske May 2, 2024
7f6ed61
More AstroQuantity
LukasBeiske May 2, 2024
22a9f52
Rework irf classes
LukasBeiske May 3, 2024
3a659ce
Make irf parameterizations configurable
LukasBeiske May 6, 2024
4853279
Move spectra definition to separate file
LukasBeiske May 6, 2024
8c2d6d1
Revert change of edisp extname
LukasBeiske May 6, 2024
558b49b
Also calculate aeff for protons and electrons
LukasBeiske May 6, 2024
6525c89
Update cut optimization components and make cut opt algorithm configu…
LukasBeiske May 7, 2024
d8a1691
Clearer class names
LukasBeiske May 7, 2024
b8fc973
Remove FoVOffsetBinning; save singular quantities in ResultValidRange
LukasBeiske May 10, 2024
9a190b9
No cut on background events based on its true origin position
LukasBeiske May 10, 2024
0cd86ea
Split out input handling code to separate helper to keep logic of ini…
Tobychev May 13, 2024
b58e789
Fixed typo
Tobychev May 13, 2024
a966868
Set min pyirf version to handle astropy 6.0
Tobychev May 14, 2024
53cf92a
Create a minimal changelog
Tobychev May 14, 2024
b80a862
Use classes_with_traits() in tools
LukasBeiske May 14, 2024
301fa41
cleaning up changelogs
Tobychev May 14, 2024
aa7f357
Added messages explaining which bin range was failing to pass the check
Tobychev May 14, 2024
0d2e02d
Respect bounds over n_bins_per_decade for energy binning
LukasBeiske May 14, 2024
88ba028
Made range check optionally only emit warning, made output a bit more…
Tobychev May 14, 2024
1477363
Added tracking of where range check came from, made check failure opt…
Tobychev May 14, 2024
c8c6443
Discared Lukas changes in error
Tobychev May 14, 2024
e5b84e2
Fixed some code quality issues from sonar
Tobychev May 15, 2024
e0b979a
Fixed typo
Tobychev May 15, 2024
7ae5518
Fixed problems where PSF was not always being generate
Tobychev May 15, 2024
804173d
Added optional colorbar plotting to plot_hist2d, additional small fixes
Tobychev May 15, 2024
7112994
Move benchmarks into dedicated Components; remove OutputEnergyBinning
LukasBeiske May 16, 2024
c922f8b
Add type hints to EventsLoader and EventPreProcessor
LukasBeiske May 16, 2024
b9641b9
Add fov binning for benchmarks
LukasBeiske May 17, 2024
8cdf5d7
Only compute psf for full enclosure irf
LukasBeiske Jun 4, 2024
badc600
Allow user renaming of cols and check for needed cols after
LukasBeiske Jun 6, 2024
44b116f
Add tests for event loading and selection code; minor bugfix
LukasBeiske Jun 6, 2024
b8d47d0
Shorten bins in range checks a bit
LukasBeiske Jun 7, 2024
efc97f4
Fix number of bin edges in make_bins_per_decade
LukasBeiske Jun 14, 2024
93da1e0
parent=None as default for all components
LukasBeiske Jun 14, 2024
80478d1
Add tests for binning
LukasBeiske Jun 14, 2024
39b0b69
Fix caplog binning test
LukasBeiske Jun 14, 2024
42f4722
Do not use caplog in test, due to problems with pytest-xdist
LukasBeiske Jun 14, 2024
9d08e9f
Do not expose base classes
LukasBeiske Jun 14, 2024
a5bd3ca
Add missing docstring
LukasBeiske Jun 14, 2024
51d0ac3
Fix imports in binning tests
LukasBeiske Jun 14, 2024
48796dd
Remove wrong bin-in-range checks; fix valid_fov_offset
LukasBeiske Jul 18, 2024
b6874b8
Only compute event weights, if a sensitivity is computed
LukasBeiske Jul 18, 2024
888438f
Make proton and electron files optional, if PercentileCuts is used
LukasBeiske Jul 19, 2024
432e362
Move pytest fixtures to conftest.py
LukasBeiske Jul 19, 2024
09e9557
Some tests for cut optimization
LukasBeiske Jul 19, 2024
c3752b8
Fixed hardcoded nonsensical offset bins for RAD_MAX
Tobychev Jul 19, 2024
d4d64f0
Add test to ensure BackgroundRate2dMaker stays working once current r…
Tobychev Jul 23, 2024
b0991f8
Fixed broken background generation
Tobychev Jul 23, 2024
a466a1b
Rework event weight calculation
LukasBeiske Jul 24, 2024
7e6bd5d
Fix background2D test
LukasBeiske Aug 14, 2024
73ffddd
More tests for optimization components
LukasBeiske Aug 14, 2024
a3cac46
Iterate over cut optimizers in optimize tests
LukasBeiske Aug 16, 2024
0e169c4
Add more tests for irf makers
LukasBeiske Sep 2, 2024
414d873
Small refactoring of irf tests
LukasBeiske Sep 3, 2024
ffb8969
Add tests for benchmarks; fix axis order in benchmark output
LukasBeiske Sep 3, 2024
05a35e8
Address some comments
LukasBeiske Sep 19, 2024
9c4a505
replace removed in numpy 2.0
LukasBeiske Sep 19, 2024
d2f47e9
Add unit definition, docstring, fix table name
Tobychev Sep 18, 2024
254910a
Fixed bug with weights not being set properly
Tobychev Sep 20, 2024
2be477e
Make header row using columns directly
Tobychev Sep 20, 2024
04d8c61
fixed conftest table generation to work around bug with dimensionless…
Tobychev Sep 20, 2024
05965d1
Linspace to match bins from official IRFs
Tobychev Sep 20, 2024
962b0cb
harmonised column names
Tobychev Sep 23, 2024
92dda44
Made linear bins optional, adjusted wording of help strings
Tobychev Sep 23, 2024
a9432d4
Trying to work around pyIrf errors
Tobychev Sep 23, 2024
7a28dac
Rename EnergyMigrationMaker to EnergyDispersionMaker to avoid confusion
LukasBeiske Sep 26, 2024
3cda9f6
Replace do_benchmarks with optional benchmark_output_path
LukasBeiske Sep 26, 2024
78a7bca
Fix some code smells
LukasBeiske Sep 26, 2024
a3eeb32
Use ctapipe.compat.COPY_IF_NEEDED
LukasBeiske Sep 30, 2024
5962b22
Add test for cut optimization tool
LukasBeiske Oct 1, 2024
8ac3fa5
Add test for irf tool
LukasBeiske Oct 11, 2024
96e2cf0
Calculate full-enclosure irf by default with optional point-like flag
LukasBeiske Oct 18, 2024
b1b7073
Remove old todo
LukasBeiske Oct 18, 2024
e787a4f
Merge OptimizationResult and OptimizationResultStore
LukasBeiske Oct 18, 2024
8cb46e6
Fix some docstrings
LukasBeiske Oct 24, 2024
d9e6546
Remove support for non-standart column names
LukasBeiske Oct 24, 2024
cf5b33b
Move on/off ratio config to PointSourceSensitivityOptimizer
LukasBeiske Oct 24, 2024
703f54a
Rename ctapipe.irf.select to ctapipe.irf.preprocessing
LukasBeiske Nov 15, 2024
54d582c
Add doc pages; fix docstrings; add __all__
LukasBeiske Nov 15, 2024
806afd2
Update pyirf dependency and make it optional; remove numpy 2.0 hotfixes
LukasBeiske Nov 15, 2024
b245b66
Fix heading on doc page
LukasBeiske Nov 18, 2024
9501c75
Add support for older files
Tobychev Nov 20, 2024
fd7ebbe
Support for only using proton and gamma files
Tobychev Nov 20, 2024
b0058da
Remove unused visualisation conde
Tobychev Nov 20, 2024
8e57ac6
Remove unused visualisation conde
Tobychev Nov 20, 2024
ba082a5
Fix tests for pyirf as optional dependency; update ctapipe-info
LukasBeiske Nov 21, 2024
ef48d87
Fix irf tool for only proton file; remove refs to visualization code …
LukasBeiske Nov 21, 2024
a782cd2
Improve handling of only protons as bkg and add tests
LukasBeiske Nov 21, 2024
1ea0e2e
ctapipe-make-irf -> ctapipe-compute-irf; IrfEventSelector -> EventSel…
LukasBeiske Nov 21, 2024
ea5e736
Fix docs test for minimal dependencies
LukasBeiske Nov 21, 2024
22b1a82
Add test for using incompatible cuts for irf computation
LukasBeiske Nov 21, 2024
98994ce
Use TableLoader to load observation info
LukasBeiske Nov 22, 2024
5acf966
Restore ability to generate correct pointlike irf files
Tobychev Nov 25, 2024
a2a3f25
Remove option of only calculating gh cuts with cut-opt tool, but keep…
LukasBeiske Jan 10, 2025
0ab95be
energy_migration_linear_bins -> energy_migration_binning
LukasBeiske Jan 15, 2025
e0da126
point-like -> spatial-selection-applied
LukasBeiske Jan 15, 2025
5bc7f3d
Fix __init__ signatures; use __call__ in small Components; improve at…
LukasBeiske Jan 15, 2025
d6d1506
Adress minor comments
LukasBeiske Jan 15, 2025
b48461f
EventPreProcessor -> EventPreprocessor and add EventQualityQuery
LukasBeiske Jan 20, 2025
1a5dbe8
theta_cuts -> spatial_selection_table
LukasBeiske Jan 20, 2025
dfa76e8
Make multiple angular resolution quantiles configurable
LukasBeiske Jan 21, 2025
d304c60
Also calculate psf for point-like IRF
LukasBeiske Jan 21, 2025
f423375
Fix psf test
LukasBeiske Jan 21, 2025
e7ea330
Make CutOptimizers use DefaultRecoEnergyBins
LukasBeiske Jan 21, 2025
2da2069
Do not requiere background events for percentile cuts
LukasBeiske Jan 21, 2025
2b3430a
Add default config files for both tools to ctapipe-quickstart
LukasBeiske Jan 21, 2025
5676a3c
Fix docs
LukasBeiske Jan 21, 2025
ce57838
Add new tools to tools doc page
LukasBeiske Jan 23, 2025
cf72c72
Address some comments, rest later
LukasBeiske Jan 29, 2025
39540b8
Remove unnecessary abbreviations
LukasBeiske Jan 30, 2025
ffdbbfc
Slight rework of CutOptimizer API
LukasBeiske Jan 30, 2025
5ff65ca
Only apply gh cuts for psf
LukasBeiske Jan 31, 2025
c307815
use_true_energy -> use_reco_energy
LukasBeiske Jan 31, 2025
1ad6c54
Fix binning for sensitivity
LukasBeiske Jan 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/api-reference/irf/benchmarks.rst
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:
12 changes: 12 additions & 0 deletions docs/api-reference/irf/binning.rst
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:
44 changes: 44 additions & 0 deletions docs/api-reference/irf/index.rst
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:
12 changes: 12 additions & 0 deletions docs/api-reference/irf/irfs.rst
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:
12 changes: 12 additions & 0 deletions docs/api-reference/irf/optimize.rst
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:
12 changes: 12 additions & 0 deletions docs/api-reference/irf/preprocessing.rst
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:
12 changes: 12 additions & 0 deletions docs/api-reference/irf/spectra.rst
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:
8 changes: 7 additions & 1 deletion docs/api-reference/tools/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ Reference/API
:no-inheritance-diagram:

.. automodapi:: ctapipe.tools.train_disp_reconstructor
:no-inheritance-diagram:
:no-inheritance-diagram:

.. automodapi:: ctapipe.tools.apply_models
:no-inheritance-diagram:

.. automodapi:: ctapipe.tools.optimize_event_selection
:no-inheritance-diagram:

.. automodapi:: ctapipe.tools.compute_irf
:no-inheritance-diagram:
17 changes: 17 additions & 0 deletions docs/changes/2473.feature.rst
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.
31 changes: 16 additions & 15 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
("py:class", "t.Type"),
("py:class", "t.List"),
("py:class", "t.Tuple"),
("py:class", "t.Sequence"),
("py:class", "Config"),
("py:class", "traitlets.config.configurable.Configurable"),
("py:class", "traitlets.traitlets.HasTraits"),
Expand All @@ -133,35 +134,34 @@
("py:class", "traitlets.config.application.Application"),
("py:class", "traitlets.utils.sentinel.Sentinel"),
("py:class", "traitlets.traitlets.ObserveHandler"),
("py:class", "traitlets.traitlets.T"),
("py:class", "traitlets.traitlets.G"),
("py:class", "Sentinel"),
("py:class", "ObserveHandler"),
("py:class", "dict[K, V]"),
("py:class", "G"),
("py:class", "K"),
("py:class", "V"),
("py:class", "t.Sequence"),
("py:class", "StrDict"),
("py:class", "ClassesType"),
("py:class", "traitlets.traitlets.G"),
("py:class", "re.Pattern"),
("py:class", "re.Pattern[t.Any]"),
("py:class", "astropy.coordinates.baseframe.BaseCoordinateFrame"),
("py:class", "astropy.table.table.Table"),
("py:class", "eventio.simtel.simtelfile.SimTelFile"),
("py:class", "ctapipe.compat.StrEnum"),
("py:class", "ctapipe.compat.StrEnum"),
("py:obj", "traitlets.traitlets.T"),

Check failure on line 154 in docs/conf.py

View check run for this annotation

CTAO-DPPS-SonarQube / ctapipe Sonarqube Results

docs/conf.py#L154

Define a constant instead of duplicating this literal "py:obj" 9 times.
("py:obj", "traitlets.traitlets.G"),
("py:obj", "traitlets.traitlets.S"),
("py:obj", "traitlets.traitlets.T"),
("py:class", "traitlets.traitlets.T"),
("py:class", "re.Pattern[t.Any]"),
("py:class", "re.Pattern"),
("py:class", "Sentinel"),
("py:class", "ObserveHandler"),
("py:obj", "traitlets.config.boolean_flag"),
("py:obj", "traitlets.TraitError"),
("py:obj", "-v"), # fix for wrong syntax in a traitlets docstring
("py:obj", "cls"),
("py:obj", "name"),
("py:meth", "MetaHasDescriptors.__init__"),

Check failure on line 162 in docs/conf.py

View check run for this annotation

CTAO-DPPS-SonarQube / ctapipe Sonarqube Results

docs/conf.py#L162

Define a constant instead of duplicating this literal "py:meth" 3 times.
("py:meth", "HasTraits.__new__"),
("py:meth", "BaseDescriptor.instance_init"),
("py:obj", "cls"),
("py:obj", "name"),
("py:class", "astropy.coordinates.baseframe.BaseCoordinateFrame"),
("py:class", "astropy.table.table.Table"),
("py:class", "eventio.simtel.simtelfile.SimTelFile"),
("py:class", "ctapipe.compat.StrEnum"),
("py:class", "ctapipe.compat.StrEnum"),
]

# Sphinx gallery config
Expand Down Expand Up @@ -405,6 +405,7 @@
"numpy": ("https://numpy.org/doc/stable", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
"psutil": ("https://psutil.readthedocs.io/en/stable", None),
"pyirf": ("https://pyirf.readthedocs.io/en/stable/", None),
"pytables": ("https://www.pytables.org", None),
"pytest": ("https://docs.pytest.org/en/stable", None),
"python": ("https://docs.python.org/3", None),
Expand Down
4 changes: 3 additions & 1 deletion docs/user-guide/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ You can get a list of all available command-line tools by typing
Data Processing Tools
=====================

* ``ctapipe-quickstart``: create some default analysis configurations and a working directory
* ``ctapipe-quickstart``: Create some default analysis configurations and a working directory.
* ``ctapipe-process``: Process event data in any supported format from R0/R1/DL0 to DL1 or DL2 HDF5 files.
* ``ctapipe-apply-models``: Tool to apply machine learning models in bulk (as opposed to event by event).
* ``ctapipe-calculate-pixel-statistics``: Tool to aggregate statistics and detect outliers from pixel-wise image data.
* ``ctapipe-train-disp-reconstructor`` : Train the ML models for the `ctapipe.reco.DispReconstructor` (monoscopic reconstruction)
* ``ctapipe-train-energy-regressor``: Train the ML models for the `ctapipe.reco.EnergyRegressor` (energy estimation)
* ``ctapipe-train-particle-classifier``: Train the ML models for the `ctapipe.reco.ParticleClassifier` (gamma-hadron separation)
* ``ctapipe-optimize-event-selection``: Calculate gamma/hadron and direction cuts (e.g. for IRF calculation).
* ``ctapipe-compute-irf``: Calculate an IRF with or without applying a direction cut and optionally benchmarks.

File Management Tools:
======================
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies:
- pypandoc
- pre-commit
- psutil
- pyirf
- pytables
- pytest
- pytest-cov
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ all = [
"eventio >=1.9.1,<2.0.0a0",
"iminuit >=2",
"matplotlib ~=3.0",
"pyirf ~=0.12.0"
]

tests = [
Expand Down Expand Up @@ -105,6 +106,8 @@ ctapipe-dump-instrument = "ctapipe.tools.dump_instrument:main"
ctapipe-display-dl1 = "ctapipe.tools.display_dl1:main"
ctapipe-process = "ctapipe.tools.process:main"
ctapipe-merge = "ctapipe.tools.merge:main"
ctapipe-optimize-event-selection = "ctapipe.tools.optimize_event_selection:main"
ctapipe-compute-irf = "ctapipe.tools.compute_irf:main"
ctapipe-fileinfo = "ctapipe.tools.fileinfo:main"
ctapipe-quickstart = "ctapipe.tools.quickstart:main"
ctapipe-calculate-pixel-statistics = "ctapipe.tools.calculate_pixel_stats:main"
Expand Down
Loading