Skip to content

Commit

Permalink
Merge pull request #2420 from LukasBeiske/add_train_disp_docstring
Browse files Browse the repository at this point in the history
Add docstring for ctapipe-train-disp-reconstructor
  • Loading branch information
maxnoe authored Oct 31, 2023
2 parents 0b0fac6 + f34eb6f commit 42e35c0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ctapipe/tools/train_disp_reconstructor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Tool for training the DispReconstructor
"""
import astropy.units as u
import numpy as np

Expand All @@ -9,14 +12,19 @@
from ctapipe.reco import CrossValidator, DispReconstructor
from ctapipe.reco.preprocessing import check_valid_rows, horizontal_to_telescope

__all__ = [
"TrainDispReconstructor",
]


class TrainDispReconstructor(Tool):
"""
Tool to train a `~ctapipe.reco.DispReconstructor` on dl1b/dl2 data.
The tool first performs a cross validation to give an initial estimate
on the quality of the estimation and then finally trains two models
(|disp| and sign(disp)) per telescope type on the full dataset.
(estimating ``norm(disp)`` and ``sign(disp)`` respectively) per
telescope type on the full dataset.
"""

name = "ctapipe-train-disp-reconstructor"
Expand Down Expand Up @@ -55,9 +63,9 @@ class TrainDispReconstructor(Tool):
project_disp = Bool(
default_value=False,
help=(
"If true, true |disp| is the distance between shower cog and"
"If true, ``true_disp`` is the distance between shower cog and"
" the true source position along the reconstructed main shower axis."
"If false, true |disp| is the distance between shower cog"
"If false, ``true_disp`` is the distance between shower cog"
" and the true source position."
),
).tag(config=True)
Expand Down
3 changes: 3 additions & 0 deletions docs/api-reference/tools/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,8 @@ Reference/API
.. automodapi:: ctapipe.tools.train_particle_classifier
:no-inheritance-diagram:

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

.. automodapi:: ctapipe.tools.apply_models
:no-inheritance-diagram:
1 change: 1 addition & 0 deletions docs/changes/2420.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add docstring for ``ctapipe-train-disp-reconstructor``.

0 comments on commit 42e35c0

Please sign in to comment.