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

Add docstring for ctapipe-train-disp-reconstructor #2420

Merged
merged 4 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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 @@ -8,14 +11,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 @@ -54,9 +62,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``.