StereoPredictCTLearnModel#

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

Bases: PredictCTLearnModel

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

This tool extends the PredictCTLearnModel to specifically handle stereoscopic 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/subarray 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_subarray_pointing(all_identifiers)

Store the subarray pointing table for the stereo mode for MC simulation.

Attributes Summary

Methods Summary

start()

Execute the core logic of the tool.

Attributes Documentation

description = '\n    Tool to predict the gammaness, energy and arrival direction from R1/DL1 stereoscopic data using CTLearn models.\n\n    This tool extends the ``PredictCTLearnModel`` to specifically handle stereoscopic 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/subarray 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_subarray_pointing(all_identifiers)\n        Store the subarray pointing table for the stereo mode for MC simulation.\n    '#
examples = '\n    To predict from pixel-wise image data in stereo mode using trained CTLearn models:\n    > ctlearn-predict-stereo-model         --input_url input.dl1.h5         --PredictCTLearnModel.batch_size=16         --PredictCTLearnModel.dl1dh_reader_type=DLImageReader         --DLImageReader.channels=cleaned_image         --DLImageReader.channels=cleaned_relative_peak_time         --DLImageReader.image_mapper_type=BilinearMapper         --DLImageReader.mode=stereo         --DLImageReader.min_telescopes=2         --PredictCTLearnModel.stack_telescope_images=True         --type_model="/path/to/your/stereo/type/ctlearn_model(.keras/.pth)"         --energy_model="/path/to/your/stereo/energy/ctlearn_model(.keras/.pth)"         --skydirection_model="/path/to/your/stereo/skydirection/ctlearn_model(.keras/.pth)"         --output output.dl2.h5     '#
name = 'ctlearn-predict-stereo-model'#

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.