MonoPredictCTLearnModel#

class ctlearn.tools.predict_mono_model.MonoPredictCTLearnModel(*args: t.Any, **kwargs: t.Any)[source]#

Bases: PredictCTLearnModel

Tool to predict the gammaness, energy and arrival direction from monoscopic R1/DL1 data using CTLearn models.

This tool extends the PredictCTLearnModel to specifically handle monoscopic R1/DL1 data. The prediction is performed using the CTLearn models. The data is stored in the output file following the ctapipe DL2 data format. It also stores the telescope pointing monitoring and DL1 feature vectors (if selected) in the output file. By default, waveforms and images are not copied to the DL2 output file unless explicitly enabled in the configuration.

Attributes#

namestr

Name of the tool.

descriptionstr

Description of the tool.

examplesstr

Examples of how to use the tool.

Methods#

start()

Start the tool.

_store_mc_telescope_pointing(all_identifiers)

Store the telescope pointing table for the mono mode for MC simulation.

Attributes Summary

description

examples

name

stereo_combiner_cls

Which stereo combination method to use after the monoscopic reconstruction.

Methods Summary

start()

Execute the core logic of the tool.

Attributes Documentation

description = '\n    Tool to predict the gammaness, energy and arrival direction from monoscopic R1/DL1 data using CTLearn models.\n\n    This tool extends the ``PredictCTLearnModel`` to specifically handle monoscopic R1/DL1 data. The prediction\n    is performed using the CTLearn models. The data is stored in the output file following the ctapipe DL2 data format.\n    It also stores the telescope pointing monitoring and DL1 feature vectors (if selected) in the output file.\n    By default, waveforms and images are not copied to the DL2 output file unless explicitly enabled in the configuration.\n\n    Attributes\n    ----------\n    name : str\n        Name of the tool.\n    description : str\n        Description of the tool.\n    examples : str\n        Examples of how to use the tool.\n\n    Methods\n    -------\n    start()\n        Start the tool.\n    _store_mc_telescope_pointing(all_identifiers)\n        Store the telescope pointing table for the mono mode for MC simulation.\n    '#
examples = '\n    To predict from pixel-wise image data in mono mode using trained CTLearn models:\n    > ctlearn-predict-mono-model         --input_url input.dl1.h5         --PredictCTLearnModel.batch_size=64         --PredictCTLearnModel.dl1dh_reader_type=DLImageReader         --DLImageReader.channels=cleaned_image         --DLImageReader.channels=cleaned_relative_peak_time         --DLImageReader.image_mapper_type=BilinearMapper         --type_model="/path/to/your/mono/type/ctlearn_model(.keras/.pth)"         --energy_model="/path/to/your/mono/energy/ctlearn_model(.keras/.pth)"         --cameradirection_model="/path/to/your/mono/cameradirection/ctlearn_model(.keras/.pth)"         --dl1-features         --no-dl1-images         --no-true-images         --output output.dl2.h5 \n    To predict from pixel-wise waveform data in mono mode using trained CTLearn models:\n    > ctlearn-predict-mono-model         --input_url input.r1.h5         --PredictCTLearnModel.dl1dh_reader_type=DLWaveformReader         --DLWaveformReader.sequnce_length=20         --DLWaveformReader.image_mapper_type=BilinearMapper         --type_model="/path/to/your/mono_waveform/type/ctlearn_model(.keras/.pth)"         --energy_model="/path/to/your/mono_waveform/energy/ctlearn_model(.keras/.pth)"         --cameradirection_model="/path/to/your/mono_waveform/cameradirection/ctlearn_model(.keras/.pth)"         --no-r0-waveforms         --no-r1-waveforms         --no-dl1-images         --no-true-images         --output output.dl2.h5     '#
name = 'ctlearn-predict-mono-model'#
stereo_combiner_cls#

Which stereo combination method to use after the monoscopic reconstruction.. Possible values: []

Methods Documentation

start()[source]#

Execute the core logic of the tool.

Depending on the tool, this method either orchestrates the training and validation loops across epochs, or it iterates through the input dataset to generate and save model predictions to the output file.