Note
Go to the end to download the full example code.
Tutorial 3 Perform inference with CTlearn models#
Predict the CTAO image and waveform data using the CTLearn models
from the second tutorial train_ctlearn_model.py. The predictions
are stored in DL2 files following the CTAO reference data model.
The tutorial also shows how to visualize the classifier performance,
energy resolution, and angular resolution of the predicted events.
The tutorial is intentionally kept simple and uses only a small fraction
of the available statistics to keep the prediction time manageable.
The resulting performance metrics are not representative of a production-level
analysis nor should they be compared directly with published results. The main
goal is to illustrate the analysis workflow and to become familiar with the
command-line tools and the DL2 data format. This tutorial can be modified from
the users to use larger datasets and more statistics to obtain meaningful results.
Each section explains a prediction task followed immediately by its literal command-line example. Running this script executes every example in order.
Check paths, environments, CTAO test data, and trained models#
The executable tutorial uses the shared downloaded and processed data
from explore_public_data.py and the Keras and PyTorch models produced
by train_ctlearn_model.py. In a notebook, prefix the displayed
command-line examples with !.
import os
import subprocess
from pathlib import Path
import astropy.units as u
import ctaplot
import matplotlib.pyplot as plt
import numpy as np
from astropy.table import Column, Table
from ctapipe import __version__ as ctapipe_version
from ctapipe.io import TableLoader, write_table
from sklearn.metrics import auc, roc_curve
from ctlearn.tools.utils import get_lst1_subarray_description
MAX_EVENTS = os.environ.get("CTLEARN_TUTORIAL_MAX_EVENTS")
if MAX_EVENTS is not None and int(MAX_EVENTS) < 1:
raise ValueError("CTLEARN_TUTORIAL_MAX_EVENTS must be a positive integer")
MAX_EVENTS_SUFFIX = f"-max{MAX_EVENTS}" if MAX_EVENTS is not None else ""
DATA_DIR = (
Path(
os.environ.get(
"CTLEARN_TUTORIAL_DATA_DIR",
str(Path.home() / ".cache" / "ctlearn" / "tutorial-data"),
)
)
.expanduser()
.resolve()
)
CONVERTED_DIR = (
Path(
os.environ.get(
"CTLEARN_TUTORIAL_CONVERTED_DIR",
str(DATA_DIR / f"ctapipe-{ctapipe_version}{MAX_EVENTS_SUFFIX}"),
)
)
.expanduser()
.resolve()
)
OUTPUT_DIR = (
Path(
os.environ.get(
"CTLEARN_TUTORIAL_OUTPUT_DIR",
str(Path.home() / ".cache" / "ctlearn" / "tutorial-training"),
)
)
.expanduser()
.resolve()
)
PREDICTION_DIR = OUTPUT_DIR / "predictions"
PREDICTION_DIR.mkdir(parents=True, exist_ok=True)
def find_config_dir():
roots = []
script_path = globals().get("__file__")
if script_path is not None:
script_dir = Path(script_path).resolve().parent
roots.extend((script_dir, *script_dir.parents))
roots.extend((Path.cwd(), *Path.cwd().parents))
for root in roots:
for config_dir in (root / "config", root / "docs" / "source" / "config"):
if (config_dir / "dl1dh_example_config.json").is_file():
return config_dir
raise FileNotFoundError(
"Could not locate tutorial configs in config/ or docs/source/config/. "
"Extract the complete tutorial ZIP or run from the CTLearn repository."
)
CONFIG_DIR = find_config_dir()
DL1DH_CONFIG = CONFIG_DIR / "dl1dh_example_config.json"
for config_path in (DL1DH_CONFIG,):
if not config_path.is_file():
raise FileNotFoundError(f"Tutorial configuration is missing: {config_path}")
GAMMA_FILE = CONVERTED_DIR / "gamma-diffuse_with_images_01.dl2.h5"
PROTON_FILE = CONVERTED_DIR / "proton_with_images_01.dl2.h5"
missing_files = [path for path in (GAMMA_FILE, PROTON_FILE) if not path.is_file()]
if missing_files:
missing = "\n".join(f" - {path}" for path in missing_files)
raise FileNotFoundError(
"Held-out tutorial data is missing. Run "
"explore_public_data.py first. Missing files:\n"
f"{missing}"
)
os.environ["CTLEARN_TUTORIAL_DATA_DIR"] = str(DATA_DIR)
os.environ["CTLEARN_TUTORIAL_CONVERTED_DIR"] = str(CONVERTED_DIR)
os.environ["CTLEARN_TUTORIAL_OUTPUT_DIR"] = str(OUTPUT_DIR)
os.environ["CTLEARN_TUTORIAL_CONFIG_DIR"] = str(CONFIG_DIR.resolve())
os.environ["CTLEARN_TUTORIAL_MAX_EVENTS_SUFFIX"] = MAX_EVENTS_SUFFIX
print(f"Converted held-out data: {CONVERTED_DIR}")
print(f"Trained model outputs: {OUTPUT_DIR}")
print(f"Prediction outputs: {PREDICTION_DIR}")
print(f"Reader configuration: {DL1DH_CONFIG}")
def run_command_line(command):
print(f"Running command: $ {command.strip()}")
result = subprocess.run(
command,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True,
)
print(result.stdout, end="")
result.check_returncode()
Converted held-out data: /home/runner/.cache/ctlearn/tutorial-data/ctapipe-0.33.0-max500
Trained model outputs: /home/runner/.cache/ctlearn/tutorial-training
Prediction outputs: /home/runner/.cache/ctlearn/tutorial-training/predictions
Reader configuration: /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json
Explore the CTLearn prediction tools#
Installing CTLearn provides several command-line tools for running and
managing different parts of the workflow. For model inference, we use the
ctlearn-predict-{mono,stereo}-model command. The -h option displays a
short version of the help message, showing the main command-line options and
their usage. For a complete description of all available options, including
the configuration parameters of the different components, use --help-all.
Although the command is executed from this Jupyter notebook for convenience
and documentation, ctlearn-predict-{mono,stereo}-model is a
command-line tool. In a typical workflow, the prediction command would be
executed directly from a terminal or submitted as part of a cluster job,
for example through sbatch on an HPC system.
run_command_line("ctlearn-predict-mono-model -h")
run_command_line("ctlearn-predict-stereo-model -h")
Running command: $ ctlearn-predict-mono-model -h
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189588.784867 6335 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189588.822188 6335 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189589.614732 6335 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
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
----------
name : str
Name of the tool.
description : str
Description of the tool.
examples : str
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.
Options
=======
The options below are convenience aliases to configurable class-options,
as listed in the "Equivalent to" description-line of the aliases.
To see all configurable class-options for some <cmd>, use:
<cmd> --help-all
--debug
Set log-level to debug, for the most verbose logging.
Equivalent to: [--Application.log_level=10]
--show-config
Show the application's configuration (human-readable format)
Equivalent to: [--Application.show_config=True]
--show-config-json
Show the application's configuration (json format)
Equivalent to: [--Application.show_config_json=True]
-q, --quiet
Disable console logging.
Equivalent to: [--Tool.quiet=True]
-v, --verbose
Set log level to DEBUG
Equivalent to: [--Tool.log_level=DEBUG]
--overwrite
Overwrite the output file if it exists
Equivalent to: [--HDF5Merger.overwrite=True]
--no-overwrite
Do not overwrite the output file if it exists
Equivalent to: [--HDF5Merger.overwrite=False]
--dl1-features
Include dl1 features
Equivalent to: [--PredictCTLearnModel.dl1_features=True]
--no-dl1-features
Exclude dl1 features
Equivalent to: [--PredictCTLearnModel.dl1_features=False]
--dl2-telescope
Include dl2 telescope-event-wise data in the output file
Equivalent to: [--PredictCTLearnModel.dl2_telescope=True]
--no-dl2-telescope
Exclude dl2 telescope-event-wise data in the output file
Equivalent to: [--PredictCTLearnModel.dl2_telescope=False]
--dl2-subarray
Include dl2 subarray-event-wise data in the output file
Equivalent to: [--PredictCTLearnModel.dl2_subarray=True]
--no-dl2-subarray
Exclude dl2 subarray-event-wise data in the output file
Equivalent to: [--PredictCTLearnModel.dl2_subarray=False]
--r0-waveforms
Include r0 waveforms
Equivalent to: [--HDF5Merger.r0_waveforms=True]
--no-r0-waveforms
Exclude r0 waveforms
Equivalent to: [--HDF5Merger.r0_waveforms=False]
--r1-waveforms
Include r1 waveforms
Equivalent to: [--HDF5Merger.r1_waveforms=True]
--no-r1-waveforms
Exclude r1 waveforms
Equivalent to: [--HDF5Merger.r1_waveforms=False]
--dl1-parameters
Include dl1 parameters
Equivalent to: [--HDF5Merger.dl1_parameters=True]
--no-dl1-parameters
Exclude dl1 parameters
Equivalent to: [--HDF5Merger.dl1_parameters=False]
--dl1-images
Include dl1 images
Equivalent to: [--HDF5Merger.dl1_images=True]
--no-dl1-images
Exclude dl1 images
Equivalent to: [--HDF5Merger.dl1_images=False]
--true-parameters
Include true parameters
Equivalent to: [--HDF5Merger.true_parameters=True]
--no-true-parameters
Exclude true parameters
Equivalent to: [--HDF5Merger.true_parameters=False]
--true-images
Include true images
Equivalent to: [--HDF5Merger.true_images=True]
--no-true-images
Exclude true images
Equivalent to: [--HDF5Merger.true_images=False]
-c, --config=<list-item-1>...
List of configuration files with parameters to load in addition to command-
line parameters. The order listed is the order of precedence (later config
parameters overwrite earlier ones), however parameters specified on the
command line always have the highest precedence. Config files may be in
JSON, YAML, TOML, or Python format
Default: []
Equivalent to: [--Tool.config_files]
--log-level=<Enum>
Set the log level by value or name.
Choices: any of [0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL']
Default: 30
Equivalent to: [--Tool.log_level]
-l, --log-file=<Path>
Filename for the log
Default: None
Equivalent to: [--Tool.log_file]
--log-file-level=<Enum>
Logging Level for File Logging
Choices: any of [0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL']
Default: 'INFO'
Equivalent to: [--Tool.log_file_level]
--provenance-log=<Path>
Default: None
Equivalent to: [--Tool.provenance_log]
-i, --input_url=<Path>
Input ctapipe HDF5 files including pixel-wise image or waveform data
Default: None
Equivalent to: [--PredictCTLearnModel.input_url]
-t, --type_model=<Path>
Path to a Keras or PyTorch model file for the classification of the primary
particle type. Requires Keras/PyTorch consistency with other model paths.
Default: None
Equivalent to: [--PredictCTLearnModel.load_type_model_from]
-e, --energy_model=<Path>
Path to a Keras or PyTorch model file for the regression of the primary
particle energy. Requires Keras/PyTorch consistency with other model paths.
Default: None
Equivalent to: [--PredictCTLearnModel.load_energy_model_from]
-d, --cameradirection_model=<Path>
Path to a Keras or PyTorch model file for the reconstruction of the primary
particle arrival direction based on camera coordinate offsets. Requires
Keras/PyTorch consistency with other model paths.
Default: None
Equivalent to: [--PredictCTLearnModel.load_cameradirection_model_from]
-s, --skydirection_model=<Path>
Path to a Keras or PyTorch model file for the reconstruction of the primary
particle arrival direction based on spherical coordinate offsets. Requires
Keras/PyTorch consistency with other model paths.
Default: None
Equivalent to: [--PredictCTLearnModel.load_skydirection_model_from]
-o, --output=<Path>
Output path to save the dl2 prediction results
Default: './output.dl2.h5'
Equivalent to: [--PredictCTLearnModel.output_path]
Examples
--------
To predict from pixel-wise image data in mono mode using trained CTLearn models:
> 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
To predict from pixel-wise waveform data in mono mode using trained CTLearn models:
> 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
To see all available configurables, use `--help-all`.
Running command: $ ctlearn-predict-stereo-model -h
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189594.062697 6349 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189594.100080 6349 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189594.894807 6349 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
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
----------
name : str
Name of the tool.
description : str
Description of the tool.
examples : str
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.
Options
=======
The options below are convenience aliases to configurable class-options,
as listed in the "Equivalent to" description-line of the aliases.
To see all configurable class-options for some <cmd>, use:
<cmd> --help-all
--debug
Set log-level to debug, for the most verbose logging.
Equivalent to: [--Application.log_level=10]
--show-config
Show the application's configuration (human-readable format)
Equivalent to: [--Application.show_config=True]
--show-config-json
Show the application's configuration (json format)
Equivalent to: [--Application.show_config_json=True]
-q, --quiet
Disable console logging.
Equivalent to: [--Tool.quiet=True]
-v, --verbose
Set log level to DEBUG
Equivalent to: [--Tool.log_level=DEBUG]
--overwrite
Overwrite the output file if it exists
Equivalent to: [--HDF5Merger.overwrite=True]
--no-overwrite
Do not overwrite the output file if it exists
Equivalent to: [--HDF5Merger.overwrite=False]
--dl1-features
Include dl1 features
Equivalent to: [--PredictCTLearnModel.dl1_features=True]
--no-dl1-features
Exclude dl1 features
Equivalent to: [--PredictCTLearnModel.dl1_features=False]
--dl2-telescope
Include dl2 telescope-event-wise data in the output file
Equivalent to: [--PredictCTLearnModel.dl2_telescope=True]
--no-dl2-telescope
Exclude dl2 telescope-event-wise data in the output file
Equivalent to: [--PredictCTLearnModel.dl2_telescope=False]
--dl2-subarray
Include dl2 subarray-event-wise data in the output file
Equivalent to: [--PredictCTLearnModel.dl2_subarray=True]
--no-dl2-subarray
Exclude dl2 subarray-event-wise data in the output file
Equivalent to: [--PredictCTLearnModel.dl2_subarray=False]
--r0-waveforms
Include r0 waveforms
Equivalent to: [--HDF5Merger.r0_waveforms=True]
--no-r0-waveforms
Exclude r0 waveforms
Equivalent to: [--HDF5Merger.r0_waveforms=False]
--r1-waveforms
Include r1 waveforms
Equivalent to: [--HDF5Merger.r1_waveforms=True]
--no-r1-waveforms
Exclude r1 waveforms
Equivalent to: [--HDF5Merger.r1_waveforms=False]
--dl1-parameters
Include dl1 parameters
Equivalent to: [--HDF5Merger.dl1_parameters=True]
--no-dl1-parameters
Exclude dl1 parameters
Equivalent to: [--HDF5Merger.dl1_parameters=False]
--dl1-images
Include dl1 images
Equivalent to: [--HDF5Merger.dl1_images=True]
--no-dl1-images
Exclude dl1 images
Equivalent to: [--HDF5Merger.dl1_images=False]
--true-parameters
Include true parameters
Equivalent to: [--HDF5Merger.true_parameters=True]
--no-true-parameters
Exclude true parameters
Equivalent to: [--HDF5Merger.true_parameters=False]
--true-images
Include true images
Equivalent to: [--HDF5Merger.true_images=True]
--no-true-images
Exclude true images
Equivalent to: [--HDF5Merger.true_images=False]
-c, --config=<list-item-1>...
List of configuration files with parameters to load in addition to command-
line parameters. The order listed is the order of precedence (later config
parameters overwrite earlier ones), however parameters specified on the
command line always have the highest precedence. Config files may be in
JSON, YAML, TOML, or Python format
Default: []
Equivalent to: [--Tool.config_files]
--log-level=<Enum>
Set the log level by value or name.
Choices: any of [0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL']
Default: 30
Equivalent to: [--Tool.log_level]
-l, --log-file=<Path>
Filename for the log
Default: None
Equivalent to: [--Tool.log_file]
--log-file-level=<Enum>
Logging Level for File Logging
Choices: any of [0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL']
Default: 'INFO'
Equivalent to: [--Tool.log_file_level]
--provenance-log=<Path>
Default: None
Equivalent to: [--Tool.provenance_log]
-i, --input_url=<Path>
Input ctapipe HDF5 files including pixel-wise image or waveform data
Default: None
Equivalent to: [--PredictCTLearnModel.input_url]
-t, --type_model=<Path>
Path to a Keras or PyTorch model file for the classification of the primary
particle type. Requires Keras/PyTorch consistency with other model paths.
Default: None
Equivalent to: [--PredictCTLearnModel.load_type_model_from]
-e, --energy_model=<Path>
Path to a Keras or PyTorch model file for the regression of the primary
particle energy. Requires Keras/PyTorch consistency with other model paths.
Default: None
Equivalent to: [--PredictCTLearnModel.load_energy_model_from]
-d, --cameradirection_model=<Path>
Path to a Keras or PyTorch model file for the reconstruction of the primary
particle arrival direction based on camera coordinate offsets. Requires
Keras/PyTorch consistency with other model paths.
Default: None
Equivalent to: [--PredictCTLearnModel.load_cameradirection_model_from]
-s, --skydirection_model=<Path>
Path to a Keras or PyTorch model file for the reconstruction of the primary
particle arrival direction based on spherical coordinate offsets. Requires
Keras/PyTorch consistency with other model paths.
Default: None
Equivalent to: [--PredictCTLearnModel.load_skydirection_model_from]
-o, --output=<Path>
Output path to save the dl2 prediction results
Default: './output.dl2.h5'
Equivalent to: [--PredictCTLearnModel.output_path]
Examples
--------
To predict from pixel-wise image data in stereo mode using trained CTLearn models:
> 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
To see all available configurables, use `--help-all`.
Part A3 Monoscopic CNN-based model inference#
We perform inference using the three previously trained CTLearn models from
train_ctlearn_model.py: the primary particle type (classification),
primary particle energy (regression), and arrival direction (regression)
models. The models are applied to both gamma-ray (signal) and proton
(background) input data. The three inference tasks are executed sequentially
within a single tool invocation. The prediction tool provides several
options for selecting which data levels from the input file are copied to
the output file. By default, the goal is to progress to the next data level
while keeping the output file as compact as possible. However, retaining
additional data levels can be useful for debugging and for inspecting
individual events in more detail. The resulting file contains the model
predictions together with the selected input data levels and follows the
CTAO reference data model.
Important: The same configuration settings used during training should
be used for inference whenever applicable. In particular, the data
preprocessing and data reader configuration must be consistent with those
used to train the models. The 01 files are used here as held-out input
data, and the paths to each model are shown directly in the commands.
1. Keras monoscopic model prediction#
run_command_line(
"""ctlearn-predict-mono-model --verbose \\
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/gamma-diffuse_with_images_01.dl2.h5" \\
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5" \\
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \\
--type_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-classification/ctlearn_model.keras" \\
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-energy/ctlearn_model.keras" \\
--cameradirection_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-cameradirection/ctlearn_model.keras" \\
--PredictCTLearnModel.batch_size 16 \\
--overwrite"""
)
run_command_line(
"""ctlearn-predict-mono-model --verbose \\
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/proton_with_images_01.dl2.h5" \\
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/proton_with_images_01.ctlearn.dl2.h5" \\
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \\
--type_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-classification/ctlearn_model.keras" \\
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-energy/ctlearn_model.keras" \\
--cameradirection_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-cameradirection/ctlearn_model.keras" \\
--PredictCTLearnModel.batch_size 16 \\
--overwrite"""
)
Running command: $ ctlearn-predict-mono-model --verbose \
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/gamma-diffuse_with_images_01.dl2.h5" \
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5" \
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \
--type_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-classification/ctlearn_model.keras" \
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-energy/ctlearn_model.keras" \
--cameradirection_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-cameradirection/ctlearn_model.keras" \
--PredictCTLearnModel.batch_size 16 \
--overwrite
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189599.352587 6363 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189599.390127 6363 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189600.234596 6363 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2026-11-20 15:46:40,909 INFO [ctlearn.ctlearn-predict-mono-model] (tool.initialize): Loading config from '[PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')]'
2026-11-20 15:46:40,909 DEBUG [ctlearn.ctlearn-predict-mono-model] (application._load_config_files): Looking for /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config in /home/runner/work/ctlearn/ctlearn/examples/tutorials
2026-11-20 15:46:40,909 DEBUG [ctlearn.ctlearn-predict-mono-model] (application._load_config_files): Loaded config file: /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json
2026-11-20 15:46:40,911 INFO [ctlearn.ctlearn-predict-mono-model] (tool.initialize): ctapipe version 0.33.0
2026-11-20 15:46:40,911 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): ctlearn version 0.11.2.dev2+g312165f28
2026-11-20 15:46:40,911 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): HDF5Merger: waveforms and images will not be copied to the DL2 output by default; set 'r0_waveforms', 'r1_waveforms', 'dl1_images' and/or 'true_images' to true in the configuration to enable waveform and/or image copying.
2026-11-20 15:46:40,911 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Copying to output destination.
2026-11-20 15:46:41,470 INFO [ctlearn.ctlearn-predict-mono-model.HDF5Merger] (hdf5merger._get_required_nodes): Updated required nodes to ['/configuration/observation/observation_block', '/configuration/observation/scheduling_block', '/configuration/simulation/run', '/configuration/telescope/pointing', '/dl0/event/subarray/trigger', '/dl0/event/telescope/trigger', '/dl1/event/telescope/parameters', '/simulation', '/simulation/event/subarray/shower', '/simulation/event/telescope/images', '/simulation/event/telescope/impact', '/simulation/event/telescope/parameters', '/simulation/service/shower_distribution']
E0000 00:00:1795189601.702275 6363 cuda_platform.cc:52] failed call to cuInit: INTERNAL: CUDA error: Failed call to cuInit: UNKNOWN ERROR (303)
2026-11-20 15:46:41,723 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Framework selected: Keras
2026-11-20 15:46:41,723 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Using Keras MirroredStrategy with 1 replica(s).
2026-11-20 15:46:41,723 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Loading data reader:
2026-11-20 15:46:41,723 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): For a large dataset, this may take a while...
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Observation Block ID != Simulation Run Identifier). Using Simulation Run Identifier for merged output [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0' [astropy.utils.metadata.merge]
2026-11-20 15:46:42,450 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Number of events loaded: 59
2026-11-20 15:46:42,484 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._ensure_subarray_consistency): SubarrayDescription was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5'
2026-11-20 15:46:42,720 DEBUG [ctlearn.ctlearn-predict-mono-model] (tool.run): CONFIG: {'MonoPredictCTLearnModel': {'batch_size': 16, 'config_files': [PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')], 'dl1_features': False, 'dl1dh_reader_type': 'DLImageReader', 'dl2_subarray': True, 'dl2_telescope': True, 'input_url': PosixPath('/home/runner/.cache/ctlearn/tutorial-data/ctapipe-0.33.0-max500/gamma-diffuse_with_images_01.dl2.h5'), 'load_cameradirection_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/keras-cameradirection/ctlearn_model.keras'), 'load_energy_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/keras-energy/ctlearn_model.keras'), 'load_skydirection_model_from': None, 'load_type_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/keras-classification/ctlearn_model.keras'), 'log_config': {}, 'log_datefmt': '%Y-%m-%d %H:%M:%S', 'log_file': None, 'log_file_level': 'INFO', 'log_format': '[%(name)s]%(highlevel)s %(message)s', 'log_level': 10, 'logging_config': {}, 'output_path': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5'), 'overwrite': False, 'prefixes': {'type': 'CTLearnClassifier', 'energy': 'CTLearnRegressor', 'cameradirection': 'CTLearnCameraReconstructor', 'skydirection': 'CTLearnSkyReconstructor', 'all': 'CTLearn'}, 'provenance_log': PosixPath('/home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-mono-model.provenance.log'), 'quiet': False, 'show_config': False, 'show_config_json': False, 'sort_by_intensity': False, 'stack_telescope_images': False, 'stereo_combiner_cls': 'StereoMeanCombiner', 'DLImageReader': {'allowed_tel_types': ['LST_LST_LSTCam'], 'allowed_tels': None, 'channels': ['image', 'relative_peak_time'], 'enforce_subarray_equality': True, 'focal_length_choice': <FocalLengthKind.EFFECTIVE: 1>, 'force_dl1_lookup': False, 'image_mapper_type': [('type', '*', 'BilinearMapper')], 'min_telescopes': 1, 'min_telescopes_of_type': [('type', '*', 0)], 'mode': 'mono', 'skip_incompatible_files': False, 'TableQualityQuery': {'passed_all_column_name': 'PASSED_ALL', 'quality_criteria': [['> 1000 phe', 'hillas_intensity > 1000']]}}}}
2026-11-20 15:46:42,720 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing the telescope pointings...
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0' [astropy.utils.metadata.merge]
2026-11-20 15:46:42,737 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_001'
2026-11-20 15:46:42,744 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_002'
2026-11-20 15:46:42,751 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_003'
2026-11-20 15:46:42,758 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_004'
2026-11-20 15:46:42,759 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Starting the prediction...
2026-11-20 15:46:42,759 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._predict_particletype): Predicting for the classification of the primary particle type...
I0000 00:00:1795189603.884116 6363 generator_dataset_op.cc:213] Memory patch applied: M_TRIM_THRESHOLD=128 kb was set.
1/3 ━━━━━━━━━━━━━━━━━━━━ 2s 1s/step
2/3 ━━━━━━━━━━━━━━━━━━━━ 0s 618ms/step
3/3 ━━━━━━━━━━━━━━━━━━━━ 0s 607ms/step
3/3 ━━━━━━━━━━━━━━━━━━━━ 2s 609ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 962ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 1s 967ms/step
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:46:47,314 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_001'
2026-11-20 15:46:47,319 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_002'
2026-11-20 15:46:47,323 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_003'
2026-11-20 15:46:47,328 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_004'
2026-11-20 15:46:47,328 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing and storing the subarray type prediction...
2026-11-20 15:46:47,757 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/subarray/particle_type/CTLearnClassifier'
2026-11-20 15:46:47,761 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnClassifier'
2026-11-20 15:46:47,761 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._predict_energy): Predicting for the regression of the primary particle energy...
1/3 ━━━━━━━━━━━━━━━━━━━━ 2s 1s/step
2/3 ━━━━━━━━━━━━━━━━━━━━ 0s 608ms/step
3/3 ━━━━━━━━━━━━━━━━━━━━ 0s 610ms/step
3/3 ━━━━━━━━━━━━━━━━━━━━ 2s 612ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 988ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 1s 993ms/step
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:46:52,110 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_001'
2026-11-20 15:46:52,114 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_002'
2026-11-20 15:46:52,119 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_003'
2026-11-20 15:46:52,123 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_004'
2026-11-20 15:46:52,123 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing and storing the subarray energy prediction...
2026-11-20 15:46:52,129 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/subarray/energy/CTLearnRegressor'
2026-11-20 15:46:52,133 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnRegressor'
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:46:52,137 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._predict_cameradirection): Predicting for the reconstruction of the primary particle arrival direction based on camera coordinate offsets...
WARNING:tensorflow:5 out of the last 9 calls to <function TensorFlowTrainer.make_predict_function.<locals>.one_step_on_data_distributed at 0x7f6bc0c877e0> triggered tf.function retracing. Tracing is expensive and the excessive number of tracings could be due to (1) creating @tf.function repeatedly in a loop, (2) passing tensors with different shapes, (3) passing Python objects instead of tensors. For (1), please define your @tf.function outside of the loop. For (2), @tf.function has reduce_retracing=True option that can avoid unnecessary retracing. For (3), please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
1/3 ━━━━━━━━━━━━━━━━━━━━ 2s 1s/step
2/3 ━━━━━━━━━━━━━━━━━━━━ 0s 599ms/step
3/3 ━━━━━━━━━━━━━━━━━━━━ 0s 595ms/step
3/3 ━━━━━━━━━━━━━━━━━━━━ 2s 597ms/step
WARNING:tensorflow:6 out of the last 12 calls to <function TensorFlowTrainer.make_predict_function.<locals>.one_step_on_data_distributed at 0x7f6bc0c877e0> triggered tf.function retracing. Tracing is expensive and the excessive number of tracings could be due to (1) creating @tf.function repeatedly in a loop, (2) passing tensors with different shapes, (3) passing Python objects instead of tensors. For (1), please define your @tf.function outside of the loop. For (2), @tf.function has reduce_retracing=True option that can avoid unnecessary retracing. For (3), please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 957ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 1s 961ms/step
2026-11-20 15:46:56,197 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_001'
2026-11-20 15:46:56,211 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_002'
2026-11-20 15:46:56,224 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_003'
2026-11-20 15:46:56,237 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_004'
2026-11-20 15:46:56,237 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing and storing the subarray geometry prediction...
2026-11-20 15:46:56,253 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/event/subarray/geometry/CTLearnCameraReconstructor'
2026-11-20 15:46:56,256 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnCameraReconstructor'
2026-11-20 15:46:56,262 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.finish): Tool is shutting down
2026-11-20 15:46:56,263 INFO [ctlearn.ctlearn-predict-mono-model] (tool.write_provenance): Output: /home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.dl2.h5
2026-11-20 15:46:56,263 DEBUG [ctlearn.ctlearn-predict-mono-model] (tool.write_provenance): PROVENANCE: 'Details about provenance is found in /home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-mono-model.provenance.log'
2026-11-20 15:46:56,264 INFO [ctlearn.ctlearn-predict-mono-model] (tool.run): Finished ctlearn-predict-mono-model
2026-11-20 15:46:56,264 DEBUG [ctlearn.ctlearn-predict-mono-model] (application.exit): Exiting application: ctlearn-predict-mono-model
Running command: $ ctlearn-predict-mono-model --verbose \
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/proton_with_images_01.dl2.h5" \
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/proton_with_images_01.ctlearn.dl2.h5" \
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \
--type_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-classification/ctlearn_model.keras" \
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-energy/ctlearn_model.keras" \
--cameradirection_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-cameradirection/ctlearn_model.keras" \
--PredictCTLearnModel.batch_size 16 \
--overwrite
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189620.455505 6475 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189620.493708 6475 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189621.332677 6475 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2026-11-20 15:47:02,027 INFO [ctlearn.ctlearn-predict-mono-model] (tool.initialize): Loading config from '[PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')]'
2026-11-20 15:47:02,028 DEBUG [ctlearn.ctlearn-predict-mono-model] (application._load_config_files): Looking for /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config in /home/runner/work/ctlearn/ctlearn/examples/tutorials
2026-11-20 15:47:02,028 DEBUG [ctlearn.ctlearn-predict-mono-model] (application._load_config_files): Loaded config file: /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json
2026-11-20 15:47:02,029 INFO [ctlearn.ctlearn-predict-mono-model] (tool.initialize): ctapipe version 0.33.0
2026-11-20 15:47:02,029 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): ctlearn version 0.11.2.dev2+g312165f28
2026-11-20 15:47:02,029 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): HDF5Merger: waveforms and images will not be copied to the DL2 output by default; set 'r0_waveforms', 'r1_waveforms', 'dl1_images' and/or 'true_images' to true in the configuration to enable waveform and/or image copying.
2026-11-20 15:47:02,029 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Copying to output destination.
2026-11-20 15:47:02,713 INFO [ctlearn.ctlearn-predict-mono-model.HDF5Merger] (hdf5merger._get_required_nodes): Updated required nodes to ['/configuration/observation/observation_block', '/configuration/observation/scheduling_block', '/configuration/simulation/run', '/configuration/telescope/pointing', '/dl0/event/subarray/trigger', '/dl0/event/telescope/trigger', '/dl1/event/telescope/parameters', '/simulation', '/simulation/event/subarray/shower', '/simulation/event/telescope/images', '/simulation/event/telescope/impact', '/simulation/event/telescope/parameters', '/simulation/service/shower_distribution']
E0000 00:00:1795189623.272043 6475 cuda_platform.cc:52] failed call to cuInit: INTERNAL: CUDA error: Failed call to cuInit: UNKNOWN ERROR (303)
2026-11-20 15:47:03,292 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Framework selected: Keras
2026-11-20 15:47:03,292 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Using Keras MirroredStrategy with 1 replica(s).
2026-11-20 15:47:03,292 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Loading data reader:
2026-11-20 15:47:03,292 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): For a large dataset, this may take a while...
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Observation Block ID != Simulation Run Identifier). Using Simulation Run Identifier for merged output [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0' [astropy.utils.metadata.merge]
2026-11-20 15:47:04,009 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Number of events loaded: 38
2026-11-20 15:47:04,043 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._ensure_subarray_consistency): SubarrayDescription was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5'
2026-11-20 15:47:04,282 DEBUG [ctlearn.ctlearn-predict-mono-model] (tool.run): CONFIG: {'MonoPredictCTLearnModel': {'batch_size': 16, 'config_files': [PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')], 'dl1_features': False, 'dl1dh_reader_type': 'DLImageReader', 'dl2_subarray': True, 'dl2_telescope': True, 'input_url': PosixPath('/home/runner/.cache/ctlearn/tutorial-data/ctapipe-0.33.0-max500/proton_with_images_01.dl2.h5'), 'load_cameradirection_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/keras-cameradirection/ctlearn_model.keras'), 'load_energy_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/keras-energy/ctlearn_model.keras'), 'load_skydirection_model_from': None, 'load_type_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/keras-classification/ctlearn_model.keras'), 'log_config': {}, 'log_datefmt': '%Y-%m-%d %H:%M:%S', 'log_file': None, 'log_file_level': 'INFO', 'log_format': '[%(name)s]%(highlevel)s %(message)s', 'log_level': 10, 'logging_config': {}, 'output_path': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5'), 'overwrite': False, 'prefixes': {'type': 'CTLearnClassifier', 'energy': 'CTLearnRegressor', 'cameradirection': 'CTLearnCameraReconstructor', 'skydirection': 'CTLearnSkyReconstructor', 'all': 'CTLearn'}, 'provenance_log': PosixPath('/home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-mono-model.provenance.log'), 'quiet': False, 'show_config': False, 'show_config_json': False, 'sort_by_intensity': False, 'stack_telescope_images': False, 'stereo_combiner_cls': 'StereoMeanCombiner', 'DLImageReader': {'allowed_tel_types': ['LST_LST_LSTCam'], 'allowed_tels': None, 'channels': ['image', 'relative_peak_time'], 'enforce_subarray_equality': True, 'focal_length_choice': <FocalLengthKind.EFFECTIVE: 1>, 'force_dl1_lookup': False, 'image_mapper_type': [('type', '*', 'BilinearMapper')], 'min_telescopes': 1, 'min_telescopes_of_type': [('type', '*', 0)], 'mode': 'mono', 'skip_incompatible_files': False, 'TableQualityQuery': {'passed_all_column_name': 'PASSED_ALL', 'quality_criteria': [['> 1000 phe', 'hillas_intensity > 1000']]}}}}
2026-11-20 15:47:04,283 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing the telescope pointings...
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0' [astropy.utils.metadata.merge]
2026-11-20 15:47:04,299 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_001'
2026-11-20 15:47:04,306 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_002'
2026-11-20 15:47:04,313 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_003'
2026-11-20 15:47:04,319 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_004'
2026-11-20 15:47:04,320 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Starting the prediction...
2026-11-20 15:47:04,320 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._predict_particletype): Predicting for the classification of the primary particle type...
I0000 00:00:1795189625.447085 6475 generator_dataset_op.cc:213] Memory patch applied: M_TRIM_THRESHOLD=128 kb was set.
1/2 ━━━━━━━━━━━━━━━━━━━━ 1s 1s/step
2/2 ━━━━━━━━━━━━━━━━━━━━ 0s 631ms/step
2/2 ━━━━━━━━━━━━━━━━━━━━ 2s 635ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 766ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 1s 771ms/step
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:47:08,589 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_001'
2026-11-20 15:47:08,594 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_002'
2026-11-20 15:47:08,598 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_003'
2026-11-20 15:47:08,603 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_004'
2026-11-20 15:47:08,603 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing and storing the subarray type prediction...
2026-11-20 15:47:08,614 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/subarray/particle_type/CTLearnClassifier'
2026-11-20 15:47:08,617 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnClassifier'
2026-11-20 15:47:08,617 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._predict_energy): Predicting for the regression of the primary particle energy...
1/2 ━━━━━━━━━━━━━━━━━━━━ 1s 1s/step
2/2 ━━━━━━━━━━━━━━━━━━━━ 0s 624ms/step
2/2 ━━━━━━━━━━━━━━━━━━━━ 2s 628ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 1s/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 1s 1s/step
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:47:12,200 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_001'
2026-11-20 15:47:12,205 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_002'
2026-11-20 15:47:12,209 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_003'
2026-11-20 15:47:12,213 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_004'
2026-11-20 15:47:12,213 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing and storing the subarray energy prediction...
2026-11-20 15:47:12,219 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/subarray/energy/CTLearnRegressor'
2026-11-20 15:47:12,223 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnRegressor'
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:47:12,227 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._predict_cameradirection): Predicting for the reconstruction of the primary particle arrival direction based on camera coordinate offsets...
WARNING:tensorflow:5 out of the last 7 calls to <function TensorFlowTrainer.make_predict_function.<locals>.one_step_on_data_distributed at 0x7f6fe9443a60> triggered tf.function retracing. Tracing is expensive and the excessive number of tracings could be due to (1) creating @tf.function repeatedly in a loop, (2) passing tensors with different shapes, (3) passing Python objects instead of tensors. For (1), please define your @tf.function outside of the loop. For (2), @tf.function has reduce_retracing=True option that can avoid unnecessary retracing. For (3), please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
1/2 ━━━━━━━━━━━━━━━━━━━━ 1s 1s/step
2/2 ━━━━━━━━━━━━━━━━━━━━ 0s 586ms/step
2/2 ━━━━━━━━━━━━━━━━━━━━ 2s 590ms/step
WARNING:tensorflow:6 out of the last 9 calls to <function TensorFlowTrainer.make_predict_function.<locals>.one_step_on_data_distributed at 0x7f6fe9443a60> triggered tf.function retracing. Tracing is expensive and the excessive number of tracings could be due to (1) creating @tf.function repeatedly in a loop, (2) passing tensors with different shapes, (3) passing Python objects instead of tensors. For (1), please define your @tf.function outside of the loop. For (2), @tf.function has reduce_retracing=True option that can avoid unnecessary retracing. For (3), please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 766ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 1s 770ms/step
2026-11-20 15:47:15,484 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_001'
2026-11-20 15:47:15,498 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_002'
2026-11-20 15:47:15,511 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_003'
2026-11-20 15:47:15,525 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_004'
2026-11-20 15:47:15,525 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing and storing the subarray geometry prediction...
2026-11-20 15:47:15,540 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/event/subarray/geometry/CTLearnCameraReconstructor'
2026-11-20 15:47:15,544 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnCameraReconstructor'
2026-11-20 15:47:15,550 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.finish): Tool is shutting down
2026-11-20 15:47:15,550 INFO [ctlearn.ctlearn-predict-mono-model] (tool.write_provenance): Output: /home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.dl2.h5
2026-11-20 15:47:15,550 DEBUG [ctlearn.ctlearn-predict-mono-model] (tool.write_provenance): PROVENANCE: 'Details about provenance is found in /home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-mono-model.provenance.log'
2026-11-20 15:47:15,552 INFO [ctlearn.ctlearn-predict-mono-model] (tool.run): Finished ctlearn-predict-mono-model
2026-11-20 15:47:15,552 DEBUG [ctlearn.ctlearn-predict-mono-model] (application.exit): Exiting application: ctlearn-predict-mono-model
2. PyTorch monoscopic model prediction#
The same prediction tasks can be run with the PyTorch models. The model
paths below point to the corresponding PyTorch outputs from
train_ctlearn_model.py.
run_command_line(
"""ctlearn-predict-mono-model --verbose \\
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/gamma-diffuse_with_images_01.dl2.h5" \\
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5" \\
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \\
--type_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-classification/ctlearn_model.pth" \\
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-energy/ctlearn_model.pth" \\
--cameradirection_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-cameradirection/ctlearn_model.pth" \\
--PredictCTLearnModel.batch_size 16 \\
--overwrite"""
)
run_command_line(
"""ctlearn-predict-mono-model --verbose \\
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/proton_with_images_01.dl2.h5" \\
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5" \\
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \\
--type_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-classification/ctlearn_model.pth" \\
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-energy/ctlearn_model.pth" \\
--cameradirection_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-cameradirection/ctlearn_model.pth" \\
--PredictCTLearnModel.batch_size 16 \\
--overwrite"""
)
Running command: $ ctlearn-predict-mono-model --verbose \
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/gamma-diffuse_with_images_01.dl2.h5" \
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5" \
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \
--type_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-classification/ctlearn_model.pth" \
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-energy/ctlearn_model.pth" \
--cameradirection_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-cameradirection/ctlearn_model.pth" \
--PredictCTLearnModel.batch_size 16 \
--overwrite
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189639.714314 6585 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189639.751815 6585 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189640.564274 6585 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2026-11-20 15:47:21,257 INFO [ctlearn.ctlearn-predict-mono-model] (tool.initialize): Loading config from '[PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')]'
2026-11-20 15:47:21,257 DEBUG [ctlearn.ctlearn-predict-mono-model] (application._load_config_files): Looking for /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config in /home/runner/work/ctlearn/ctlearn/examples/tutorials
2026-11-20 15:47:21,257 DEBUG [ctlearn.ctlearn-predict-mono-model] (application._load_config_files): Loaded config file: /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json
2026-11-20 15:47:21,259 INFO [ctlearn.ctlearn-predict-mono-model] (tool.initialize): ctapipe version 0.33.0
2026-11-20 15:47:21,259 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): ctlearn version 0.11.2.dev2+g312165f28
2026-11-20 15:47:21,259 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): HDF5Merger: waveforms and images will not be copied to the DL2 output by default; set 'r0_waveforms', 'r1_waveforms', 'dl1_images' and/or 'true_images' to true in the configuration to enable waveform and/or image copying.
2026-11-20 15:47:21,259 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Copying to output destination.
2026-11-20 15:47:21,818 INFO [ctlearn.ctlearn-predict-mono-model.HDF5Merger] (hdf5merger._get_required_nodes): Updated required nodes to ['/configuration/observation/observation_block', '/configuration/observation/scheduling_block', '/configuration/simulation/run', '/configuration/telescope/pointing', '/dl0/event/subarray/trigger', '/dl0/event/telescope/trigger', '/dl1/event/telescope/parameters', '/simulation', '/simulation/event/subarray/shower', '/simulation/event/telescope/images', '/simulation/event/telescope/impact', '/simulation/event/telescope/parameters', '/simulation/service/shower_distribution']
2026-11-20 15:47:22,046 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Framework selected: PyTorch
2026-11-20 15:47:22,047 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Using PyTorch CPU device.
2026-11-20 15:47:22,047 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Loading data reader:
2026-11-20 15:47:22,047 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): For a large dataset, this may take a while...
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Observation Block ID != Simulation Run Identifier). Using Simulation Run Identifier for merged output [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0' [astropy.utils.metadata.merge]
2026-11-20 15:47:22,777 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Number of events loaded: 59
2026-11-20 15:47:22,812 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._ensure_subarray_consistency): SubarrayDescription was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5'
2026-11-20 15:47:23,053 DEBUG [ctlearn.ctlearn-predict-mono-model] (tool.run): CONFIG: {'MonoPredictCTLearnModel': {'batch_size': 16, 'config_files': [PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')], 'dl1_features': False, 'dl1dh_reader_type': 'DLImageReader', 'dl2_subarray': True, 'dl2_telescope': True, 'input_url': PosixPath('/home/runner/.cache/ctlearn/tutorial-data/ctapipe-0.33.0-max500/gamma-diffuse_with_images_01.dl2.h5'), 'load_cameradirection_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/pytorch-cameradirection/ctlearn_model.pth'), 'load_energy_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/pytorch-energy/ctlearn_model.pth'), 'load_skydirection_model_from': None, 'load_type_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/pytorch-classification/ctlearn_model.pth'), 'log_config': {}, 'log_datefmt': '%Y-%m-%d %H:%M:%S', 'log_file': None, 'log_file_level': 'INFO', 'log_format': '[%(name)s]%(highlevel)s %(message)s', 'log_level': 10, 'logging_config': {}, 'output_path': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5'), 'overwrite': False, 'prefixes': {'type': 'CTLearnClassifier', 'energy': 'CTLearnRegressor', 'cameradirection': 'CTLearnCameraReconstructor', 'skydirection': 'CTLearnSkyReconstructor', 'all': 'CTLearn'}, 'provenance_log': PosixPath('/home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-mono-model.provenance.log'), 'quiet': False, 'show_config': False, 'show_config_json': False, 'sort_by_intensity': False, 'stack_telescope_images': False, 'stereo_combiner_cls': 'StereoMeanCombiner', 'DLImageReader': {'allowed_tel_types': ['LST_LST_LSTCam'], 'allowed_tels': None, 'channels': ['image', 'relative_peak_time'], 'enforce_subarray_equality': True, 'focal_length_choice': <FocalLengthKind.EFFECTIVE: 1>, 'force_dl1_lookup': False, 'image_mapper_type': [('type', '*', 'BilinearMapper')], 'min_telescopes': 1, 'min_telescopes_of_type': [('type', '*', 0)], 'mode': 'mono', 'skip_incompatible_files': False, 'TableQualityQuery': {'passed_all_column_name': 'PASSED_ALL', 'quality_criteria': [['> 1000 phe', 'hillas_intensity > 1000']]}}}}
2026-11-20 15:47:23,054 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing the telescope pointings...
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0' [astropy.utils.metadata.merge]
2026-11-20 15:47:23,070 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_001'
2026-11-20 15:47:23,077 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_002'
2026-11-20 15:47:23,084 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_003'
2026-11-20 15:47:23,091 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_004'
2026-11-20 15:47:23,092 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Starting the prediction...
2026-11-20 15:47:23,092 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._predict_particletype): Predicting for the classification of the primary particle type...
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:47:29,465 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_001'
2026-11-20 15:47:29,469 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_002'
2026-11-20 15:47:29,473 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_003'
2026-11-20 15:47:29,476 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_004'
2026-11-20 15:47:29,476 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing and storing the subarray type prediction...
2026-11-20 15:47:29,487 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/subarray/particle_type/CTLearnClassifier'
2026-11-20 15:47:29,490 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnClassifier'
2026-11-20 15:47:29,490 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._predict_energy): Predicting for the regression of the primary particle energy...
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:47:35,491 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_001'
2026-11-20 15:47:35,496 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_002'
2026-11-20 15:47:35,500 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_003'
2026-11-20 15:47:35,504 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_004'
2026-11-20 15:47:35,504 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing and storing the subarray energy prediction...
2026-11-20 15:47:35,511 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/subarray/energy/CTLearnRegressor'
2026-11-20 15:47:35,514 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnRegressor'
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:47:35,518 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._predict_cameradirection): Predicting for the reconstruction of the primary particle arrival direction based on camera coordinate offsets...
2026-11-20 15:47:41,607 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_001'
2026-11-20 15:47:41,621 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_002'
2026-11-20 15:47:41,634 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_003'
2026-11-20 15:47:41,647 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_004'
2026-11-20 15:47:41,647 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing and storing the subarray geometry prediction...
2026-11-20 15:47:41,663 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/subarray/geometry/CTLearnCameraReconstructor'
2026-11-20 15:47:41,667 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnCameraReconstructor'
2026-11-20 15:47:41,673 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.finish): Tool is shutting down
2026-11-20 15:47:41,673 INFO [ctlearn.ctlearn-predict-mono-model] (tool.write_provenance): Output: /home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5
2026-11-20 15:47:41,673 DEBUG [ctlearn.ctlearn-predict-mono-model] (tool.write_provenance): PROVENANCE: 'Details about provenance is found in /home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-mono-model.provenance.log'
2026-11-20 15:47:41,674 INFO [ctlearn.ctlearn-predict-mono-model] (tool.run): Finished ctlearn-predict-mono-model
2026-11-20 15:47:41,675 DEBUG [ctlearn.ctlearn-predict-mono-model] (application.exit): Exiting application: ctlearn-predict-mono-model
Running command: $ ctlearn-predict-mono-model --verbose \
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/proton_with_images_01.dl2.h5" \
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5" \
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \
--type_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-classification/ctlearn_model.pth" \
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-energy/ctlearn_model.pth" \
--cameradirection_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-cameradirection/ctlearn_model.pth" \
--PredictCTLearnModel.batch_size 16 \
--overwrite
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189665.857623 6600 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189665.895212 6600 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189666.710612 6600 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2026-11-20 15:47:47,404 INFO [ctlearn.ctlearn-predict-mono-model] (tool.initialize): Loading config from '[PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')]'
2026-11-20 15:47:47,404 DEBUG [ctlearn.ctlearn-predict-mono-model] (application._load_config_files): Looking for /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config in /home/runner/work/ctlearn/ctlearn/examples/tutorials
2026-11-20 15:47:47,405 DEBUG [ctlearn.ctlearn-predict-mono-model] (application._load_config_files): Loaded config file: /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json
2026-11-20 15:47:47,406 INFO [ctlearn.ctlearn-predict-mono-model] (tool.initialize): ctapipe version 0.33.0
2026-11-20 15:47:47,406 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): ctlearn version 0.11.2.dev2+g312165f28
2026-11-20 15:47:47,406 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): HDF5Merger: waveforms and images will not be copied to the DL2 output by default; set 'r0_waveforms', 'r1_waveforms', 'dl1_images' and/or 'true_images' to true in the configuration to enable waveform and/or image copying.
2026-11-20 15:47:47,406 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Copying to output destination.
2026-11-20 15:47:48,089 INFO [ctlearn.ctlearn-predict-mono-model.HDF5Merger] (hdf5merger._get_required_nodes): Updated required nodes to ['/configuration/observation/observation_block', '/configuration/observation/scheduling_block', '/configuration/simulation/run', '/configuration/telescope/pointing', '/dl0/event/subarray/trigger', '/dl0/event/telescope/trigger', '/dl1/event/telescope/parameters', '/simulation', '/simulation/event/subarray/shower', '/simulation/event/telescope/images', '/simulation/event/telescope/impact', '/simulation/event/telescope/parameters', '/simulation/service/shower_distribution']
2026-11-20 15:47:48,644 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Framework selected: PyTorch
2026-11-20 15:47:48,644 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Using PyTorch CPU device.
2026-11-20 15:47:48,644 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Loading data reader:
2026-11-20 15:47:48,644 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): For a large dataset, this may take a while...
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Observation Block ID != Simulation Run Identifier). Using Simulation Run Identifier for merged output [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0' [astropy.utils.metadata.merge]
2026-11-20 15:47:49,363 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Number of events loaded: 38
2026-11-20 15:47:49,398 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._ensure_subarray_consistency): SubarrayDescription was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5'
2026-11-20 15:47:49,633 DEBUG [ctlearn.ctlearn-predict-mono-model] (tool.run): CONFIG: {'MonoPredictCTLearnModel': {'batch_size': 16, 'config_files': [PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')], 'dl1_features': False, 'dl1dh_reader_type': 'DLImageReader', 'dl2_subarray': True, 'dl2_telescope': True, 'input_url': PosixPath('/home/runner/.cache/ctlearn/tutorial-data/ctapipe-0.33.0-max500/proton_with_images_01.dl2.h5'), 'load_cameradirection_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/pytorch-cameradirection/ctlearn_model.pth'), 'load_energy_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/pytorch-energy/ctlearn_model.pth'), 'load_skydirection_model_from': None, 'load_type_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/pytorch-classification/ctlearn_model.pth'), 'log_config': {}, 'log_datefmt': '%Y-%m-%d %H:%M:%S', 'log_file': None, 'log_file_level': 'INFO', 'log_format': '[%(name)s]%(highlevel)s %(message)s', 'log_level': 10, 'logging_config': {}, 'output_path': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5'), 'overwrite': False, 'prefixes': {'type': 'CTLearnClassifier', 'energy': 'CTLearnRegressor', 'cameradirection': 'CTLearnCameraReconstructor', 'skydirection': 'CTLearnSkyReconstructor', 'all': 'CTLearn'}, 'provenance_log': PosixPath('/home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-mono-model.provenance.log'), 'quiet': False, 'show_config': False, 'show_config_json': False, 'sort_by_intensity': False, 'stack_telescope_images': False, 'stereo_combiner_cls': 'StereoMeanCombiner', 'DLImageReader': {'allowed_tel_types': ['LST_LST_LSTCam'], 'allowed_tels': None, 'channels': ['image', 'relative_peak_time'], 'enforce_subarray_equality': True, 'focal_length_choice': <FocalLengthKind.EFFECTIVE: 1>, 'force_dl1_lookup': False, 'image_mapper_type': [('type', '*', 'BilinearMapper')], 'min_telescopes': 1, 'min_telescopes_of_type': [('type', '*', 0)], 'mode': 'mono', 'skip_incompatible_files': False, 'TableQualityQuery': {'passed_all_column_name': 'PASSED_ALL', 'quality_criteria': [['> 1000 phe', 'hillas_intensity > 1000']]}}}}
2026-11-20 15:47:49,633 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing the telescope pointings...
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0' [astropy.utils.metadata.merge]
2026-11-20 15:47:49,649 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_001'
2026-11-20 15:47:49,656 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_002'
2026-11-20 15:47:49,663 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_003'
2026-11-20 15:47:49,669 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_004'
2026-11-20 15:47:49,670 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Starting the prediction...
2026-11-20 15:47:49,670 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._predict_particletype): Predicting for the classification of the primary particle type...
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:47:53,786 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_001'
2026-11-20 15:47:53,790 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_002'
2026-11-20 15:47:53,793 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_003'
2026-11-20 15:47:53,797 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/particle_type/CTLearnClassifier/tel_004'
2026-11-20 15:47:53,797 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing and storing the subarray type prediction...
2026-11-20 15:47:53,808 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/subarray/particle_type/CTLearnClassifier'
2026-11-20 15:47:53,811 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnClassifier'
2026-11-20 15:47:53,811 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._predict_energy): Predicting for the regression of the primary particle energy...
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:47:57,757 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_001'
2026-11-20 15:47:57,761 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_002'
2026-11-20 15:47:57,765 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_003'
2026-11-20 15:47:57,769 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_004'
2026-11-20 15:47:57,769 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing and storing the subarray energy prediction...
2026-11-20 15:47:57,776 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/subarray/energy/CTLearnRegressor'
2026-11-20 15:47:57,779 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnRegressor'
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:47:57,783 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._predict_cameradirection): Predicting for the reconstruction of the primary particle arrival direction based on camera coordinate offsets...
2026-11-20 15:48:01,681 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_001'
2026-11-20 15:48:01,694 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_002'
2026-11-20 15:48:01,707 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_003'
2026-11-20 15:48:01,720 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/telescope/geometry/CTLearnCameraReconstructor/tel_004'
2026-11-20 15:48:01,720 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing and storing the subarray geometry prediction...
2026-11-20 15:48:01,735 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/event/subarray/geometry/CTLearnCameraReconstructor'
2026-11-20 15:48:01,739 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnCameraReconstructor'
2026-11-20 15:48:01,745 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.finish): Tool is shutting down
2026-11-20 15:48:01,745 INFO [ctlearn.ctlearn-predict-mono-model] (tool.write_provenance): Output: /home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.dl2.h5
2026-11-20 15:48:01,745 DEBUG [ctlearn.ctlearn-predict-mono-model] (tool.write_provenance): PROVENANCE: 'Details about provenance is found in /home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-mono-model.provenance.log'
2026-11-20 15:48:01,746 INFO [ctlearn.ctlearn-predict-mono-model] (tool.run): Finished ctlearn-predict-mono-model
2026-11-20 15:48:01,746 DEBUG [ctlearn.ctlearn-predict-mono-model] (application.exit): Exiting application: ctlearn-predict-mono-model
Part B3 Exploring the produced CTLearn DL2 data#
In the following cells, we will explore the DL2 predictions produced by the CTLearn models. Keep in mind that, for this hands-on tutorial, we trained the models on very small datasets with limited statistics to keep the training time manageable. The datasets used here represent only a tiny fraction of the statistics typically used for a production-level CNN-based analysis, where GPU resources are also used to accelerate the training process. Consequently, the performance metrics and resolution curves obtained in this tutorial should not be considered representative of a production analysis, compared directly with published results, or used for scientific conclusions. The main goal here is to understand how the analysis workflow is conducted: how the predictions are loaded, how the different performance metrics are calculated, and how the corresponding distributions and resolution curves are visualized. Once we are familiar with the complete workflow, we can increase the statistics and repeat the analysis using a full production of simulated data. The full production simulations used by the CTAO collaboration are not publicly available. However, the statistics available in the CTAO Open Data are sufficient to obtain meaningful proof-of-concept results and to explore the analysis workflow in much greater detail.
The first cell loads the data using the TableLoader from ctapipe. The produced files follow the reference implementation of the CTAO data model, allowing the DL2 information to be read in a standardized format. The cell also selects and prepares the relevant quantities from the predictions so that they can be conveniently used in the following cells for plotting the classifier performance, energy reconstruction, angular reconstruction, and other performance metrics.
def read_valid_telescope_events(filename):
with TableLoader(input_url=filename) as loader:
telescope_events = loader.read_telescope_events(
telescopes=["LST_LST_LSTCam"],
dl1_images=False,
dl1_parameters=False,
dl1_muons=False,
dl2=True,
simulated=True,
true_images=False,
true_parameters=False,
instrument=False,
observation_info=False,
)
return telescope_events[telescope_events["CTLearnRegressor_tel_is_valid"]]
gamma_keras_events = read_valid_telescope_events(
PREDICTION_DIR / "gamma-diffuse_with_images_01.ctlearn.dl2.h5"
)
proton_keras_events = read_valid_telescope_events(
PREDICTION_DIR / "proton_with_images_01.ctlearn.dl2.h5"
)
gamma_pytorch_events = read_valid_telescope_events(
PREDICTION_DIR / "gamma-diffuse_with_images_01.pytorch.ctlearn.dl2.h5"
)
proton_pytorch_events = read_valid_telescope_events(
PREDICTION_DIR / "proton_with_images_01.pytorch.ctlearn.dl2.h5"
)
gamma_keras_predictions = np.asarray(
gamma_keras_events["CTLearnClassifier_tel_prediction"]
)
proton_keras_predictions = np.asarray(
proton_keras_events["CTLearnClassifier_tel_prediction"]
)
gamma_pytorch_predictions = np.asarray(
gamma_pytorch_events["CTLearnClassifier_tel_prediction"]
)
proton_pytorch_predictions = np.asarray(
proton_pytorch_events["CTLearnClassifier_tel_prediction"]
)
gamma_scores = gamma_keras_predictions[gamma_keras_predictions != 0.0]
proton_scores = proton_keras_predictions[proton_keras_predictions != 0.0]
gamma_pytorch_scores = gamma_pytorch_predictions[gamma_pytorch_predictions != 0.0]
proton_pytorch_scores = proton_pytorch_predictions[proton_pytorch_predictions != 0.0]
reco_energy = np.asarray(gamma_keras_events["CTLearnRegressor_tel_energy"])
true_energy = np.asarray(gamma_keras_events["true_energy"])
proton_true_energy = np.asarray(proton_keras_events["true_energy"])
reco_alt = np.asarray(gamma_keras_events["CTLearnCameraReconstructor_tel_alt"])
true_alt = np.asarray(gamma_keras_events["true_alt"])
reco_az = np.asarray(gamma_keras_events["CTLearnCameraReconstructor_tel_az"])
true_az = np.asarray(gamma_keras_events["true_az"])
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0'
warnings.warn(
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/astropy/utils/metadata/merge.py:289: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0'
warnings.warn(
1. Particle classification performance#
This cell visualizes the particle classification performance of the CTLearn model, with the goal of discriminating gamma-ray signal events from proton background events. Three complementary plots are shown: on the left, the distribution of the classifier output, or gammaness, for gamma-ray and proton events; in the middle, the Receiver Operating Characteristic (ROC) curve, which shows the trade-off between the true positive rate and the false positive rate as the classification threshold is varied, together with the corresponding Area Under the Curve (AUC); and on the right, the AUC as a function of true energy, showing how the classification performance changes across the energy range of the simulated events. Together, these plots provide an overview of the classifier performance, both globally and as a function of energy. As with the other performance metrics presented in this tutorial, these results are intended to illustrate the analysis workflow rather than provide production-level performance estimates.
The same plots compare the Keras and PyTorch classifiers.
y_true = np.concatenate([np.ones(len(gamma_scores)), np.zeros(len(proton_scores))])
y_score = np.concatenate([gamma_scores, proton_scores])
fpr, tpr, _ = roc_curve(y_true, y_score)
roc_auc = auc(fpr, tpr)
torch_y_true = np.concatenate(
[
np.ones(len(gamma_pytorch_scores)),
np.zeros(len(proton_pytorch_scores)),
]
)
torch_y_score = np.concatenate([gamma_pytorch_scores, proton_pytorch_scores])
torch_fpr, torch_tpr, _ = roc_curve(torch_y_true, torch_y_score)
torch_roc_auc = auc(torch_fpr, torch_tpr)
gamma_energy_auc = true_energy[gamma_keras_predictions != 0.0]
proton_energy_auc = proton_true_energy[proton_keras_predictions != 0.0]
true_energy_auc = np.concatenate([gamma_energy_auc, proton_energy_auc])
energy_bins_auc = np.logspace(np.log10(0.03), np.log10(100), 15) * u.TeV
energy_bins_auc, auc_scores = ctaplot.roc_auc_per_energy(
true_type=y_true,
gammaness=y_score,
true_energy=true_energy_auc * u.TeV,
energy_bins=energy_bins_auc,
)
gamma_pytorch_energy_auc = np.asarray(gamma_pytorch_events["true_energy"])[
gamma_pytorch_predictions != 0.0
]
proton_pytorch_energy_auc = np.asarray(proton_pytorch_events["true_energy"])[
proton_pytorch_predictions != 0.0
]
pytorch_true_energy_auc = np.concatenate(
[gamma_pytorch_energy_auc, proton_pytorch_energy_auc]
)
pytorch_energy_bins_auc, pytorch_auc_scores = ctaplot.roc_auc_per_energy(
true_type=torch_y_true,
gammaness=torch_y_score,
true_energy=pytorch_true_energy_auc * u.TeV,
energy_bins=np.logspace(np.log10(0.03), np.log10(100), 15) * u.TeV,
)
fig, axes = plt.subplots(1, 3, figsize=(18, 5), constrained_layout=True)
score_bins = np.linspace(0, 1, 50)
axes[0].hist(
gamma_scores,
bins=score_bins,
histtype="step",
linewidth=1.5,
label="Keras signal (gamma)",
)
axes[0].hist(
proton_scores,
bins=score_bins,
histtype="step",
linewidth=1.5,
label="Keras background (proton)",
)
axes[0].hist(
gamma_pytorch_scores,
bins=score_bins,
histtype="step",
linewidth=1.5,
label="PyTorch signal (gamma)",
)
axes[0].hist(
proton_pytorch_scores,
bins=score_bins,
histtype="step",
linewidth=1.5,
label="PyTorch background (proton)",
)
axes[0].set_xlabel("Classifier value (gammaness)")
axes[0].set_ylabel("Counts")
axes[0].set_title("Gammaness distribution")
axes[0].legend(loc="upper center", fontsize="small")
axes[1].plot(fpr, tpr, lw=2, label=f"Keras classifier (AUC = {roc_auc:.3f})")
axes[1].plot(
torch_fpr,
torch_tpr,
lw=2,
label=f"PyTorch classifier (AUC = {torch_roc_auc:.3f})",
)
axes[1].plot([0, 1], [0, 1], "k--", alpha=0.5, label="Random classifier")
axes[1].set_xlabel("False positive rate")
axes[1].set_ylabel("True positive rate")
axes[1].set_title("ROC curve")
axes[1].set_xlim(0, 1)
axes[1].set_ylim(0, 1)
axes[1].grid(alpha=0.3)
axes[1].legend(loc="lower right")
ctaplot.plot_roc_auc_per_energy(
energy_bins=energy_bins_auc,
auc_scores=auc_scores,
label="Keras classifier",
ax=axes[2],
)
ctaplot.plot_roc_auc_per_energy(
energy_bins=pytorch_energy_bins_auc,
auc_scores=pytorch_auc_scores,
label="PyTorch classifier",
ax=axes[2],
)
axes[2].set_title("AUC vs. energy")
axes[2].set_ylim(0.5, 1.0)
axes[2].legend()
plt.show()

/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/ctaplot/plots/plots.py:2183: UserWarning: This axis already has a converter set and is updating to a potentially incompatible converter
ax.errorbar(energy_means, auc_scores, xerr=xerr, **kwargs)
2. Regression migration matrices#
The next cell shows the migration matrices for the regression tasks of the CTLearn model, covering the reconstructed energy and arrival direction. The figure contains three subplots: the energy migration matrix on the left, the altitude migration matrix in the middle, and the azimuth migration matrix on the right. In each case, the true value is shown on the x-axis and the reconstructed value on the y-axis, allowing us to visualize how the reconstructed quantities are distributed with respect to their true values. The azimuth is wrapped around (0º/360º) because the simulated observations are pointing towards the north, so (0º) and (360º) represent the same direction. The black diagonal lines indicate perfect reconstruction, where the reconstructed value is exactly equal to the true value. The closer the event distribution is concentrated around this diagonal, the more accurately the corresponding regression task reconstructs the physical quantity.
fig, axes = plt.subplots(1, 3, figsize=(18, 5.5))
energy_bins = np.logspace(np.log10(1), np.log10(100), 50)
hist_energy, true_energy_edges, reco_energy_edges = np.histogram2d(
true_energy, reco_energy, bins=[energy_bins, energy_bins]
)
energy_mesh = axes[0].pcolormesh(
true_energy_edges,
reco_energy_edges,
np.ma.masked_where(hist_energy == 0, hist_energy).T,
cmap="viridis",
shading="auto",
)
axes[0].plot(
energy_bins,
energy_bins,
"k--",
linewidth=1.5,
label="Perfect reconstruction",
)
axes[0].set_xscale("log")
axes[0].set_yscale("log")
axes[0].set_xlabel("True energy [TeV]")
axes[0].set_ylabel("Reconstructed energy [TeV]")
axes[0].set_title("Energy migration")
axes[0].legend(loc="upper left")
fig.colorbar(energy_mesh, ax=axes[0]).set_label("Number of events")
altitude_bins = np.linspace(
min(true_alt.min(), reco_alt.min()),
max(true_alt.max(), reco_alt.max()),
50,
)
hist_altitude, true_altitude_edges, reco_altitude_edges = np.histogram2d(
true_alt, reco_alt, bins=[altitude_bins, altitude_bins]
)
altitude_mesh = axes[1].pcolormesh(
true_altitude_edges,
reco_altitude_edges,
np.ma.masked_where(hist_altitude == 0, hist_altitude).T,
cmap="viridis",
shading="auto",
)
axes[1].plot(
altitude_bins,
altitude_bins,
"k--",
linewidth=1.5,
label="Perfect reconstruction",
)
axes[1].set_xlabel("True altitude [deg]")
axes[1].set_ylabel("Reconstructed altitude [deg]")
axes[1].set_title("Altitude migration")
axes[1].legend(loc="upper left")
fig.colorbar(altitude_mesh, ax=axes[1]).set_label("Number of events")
true_az_wrapped = (true_az + 180) % 360 - 180
reco_az_wrapped = (reco_az + 180) % 360 - 180
azimuth_bins = np.linspace(-15, 15, 61)
hist_azimuth, true_azimuth_edges, reco_azimuth_edges = np.histogram2d(
true_az_wrapped, reco_az_wrapped, bins=[azimuth_bins, azimuth_bins]
)
azimuth_mesh = axes[2].pcolormesh(
true_azimuth_edges,
reco_azimuth_edges,
np.ma.masked_where(hist_azimuth == 0, hist_azimuth).T,
cmap="viridis",
shading="auto",
)
axes[2].plot(
[-15, 15],
[-15, 15],
"k--",
linewidth=1.5,
label="Perfect reconstruction",
)
axes[2].set_xlim(-15, 15)
axes[2].set_ylim(-15, 15)
axes[2].set_xlabel("True azimuth relative to 0° [deg]")
axes[2].set_ylabel("Reconstructed azimuth relative to 0° [deg]")
axes[2].set_title("Azimuth migration")
axes[2].set_xticks([-15, -10, -5, 0, 5, 10, 15])
axes[2].set_yticks([-15, -10, -5, 0, 5, 10, 15])
axes[2].legend(loc="upper left")
fig.colorbar(azimuth_mesh, ax=axes[2]).set_label("Number of events")
plt.tight_layout()
plt.show()

3. IACT-specific performance metrics#
The last cell shows some IACT-specific performance metrics, in particular the energy resolution and angular resolution of the reconstructed events. These plots provide a first visual impression of how well the model reconstructs the physical properties of the gamma-ray events. It is important to note that these are simple plots of the reconstruction performance without applying any selection cuts based on the gammaness classifier. Therefore, they should not be confused with the Instrument Response Functions (IRFs) used in standard IACT analyses. The production of IRFs involves a dedicated analysis workflow and additional selections and calculations. Separate tools within ctapipe are available to build these higher-level analysis products, and they can be applied directly to the CTLearn DL2 data because the files follow the reference implementation of the CTAO data model.
For this tutorial, the purpose is simply to obtain a first visual impression of the energy and angular reconstruction performance and to become familiar with the corresponding analysis workflow. As emphasized throughout this tutorial, the available statistics are very limited, so the resulting curves should not be interpreted as meaningful or competitive instrument performance measurements, nor should they be compared directly with published IACT performance results.
fig, axes = plt.subplots(1, 2, figsize=(16, 7))
ctaplot.plot_energy_resolution(
true_energy * u.TeV,
reco_energy * u.TeV,
label="CTLearn",
ax=axes[0],
)
ctaplot.plot_energy_resolution_cta_requirement("north", ax=axes[0], color="black")
axes[0].legend()
axes[0].set_title("Energy resolution")
ctaplot.plot_angular_resolution_per_energy(
true_alt * u.deg,
reco_alt * u.deg,
true_az * u.deg,
reco_az * u.deg,
true_energy * u.TeV,
label="CTLearn",
ax=axes[1],
)
ctaplot.plot_angular_resolution_cta_requirement("north", ax=axes[1], color="black")
axes[1].legend()
axes[1].set_title("Angular resolution")
plt.tight_layout()
plt.show()

/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/ctaplot/plots/plots.py:979: UserWarning: This axis already has a converter set and is updating to a potentially incompatible converter
ax.plot(e_cta, ar_cta, **kwargs)
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/ctaplot/plots/plots.py:729: UserWarning: This axis already has a converter set and is updating to a potentially incompatible converter
ax.plot(e_cta, ar_cta, **kwargs)
4. Browsing through the HDF5 files via ViTables#
Use ViTables, a convenient GUI, to explore the CTLearn DL2 predictions. The file follows the reference implementation of the CTAO data model.
pip install vitables
vitables $HOME/.cache/ctlearn/tutorial-training/predictions/*.dl2.h5
Note that the ViTables GUI is not available in this notebook environment, so the command is shown here for reference. In a local environment, you can run the command in a terminal to open the ViTables GUI and explore the DL2 predictions interactively. The GUI allows you to browse through the tables, view the data and metadata, and perform basic operations on the HDF5 files. This can be useful for inspecting individual events, checking the structure of the data, and verifying that the predictions are stored correctly.
Part C3 Stereoscopic CNN-based model inference#
We perform inference with the previously trained stereoscopic energy model. The telescope images are combined channel-wise and passed to the CNN, allowing the model to use information from multiple telescopes simultaneously. As above, the same configuration used during training should be used for inference, in particular the stereoscopic image reader settings and telescope stacking options. Since the stereoscopic input is larger than the monoscopic input, a reduced batch size may be required to account for the increased memory consumption.
The following commands run the inference with both the Keras and PyTorch models.
1. Keras stereoscopic model prediction#
run_command_line(
"""ctlearn-predict-stereo-model --verbose \\
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/gamma-diffuse_with_images_01.dl2.h5" \\
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/gamma-diffuse_with_images_01.ctlearn.stereo.dl2.h5" \\
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \\
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-stereo-energy/ctlearn_model.keras" \\
--DLImageReader.mode stereo --DLImageReader.min_telescopes 2 \\
--TableQualityQuery.quality_criteria "[]" \\
--PredictCTLearnModel.stack_telescope_images True \\
--PredictCTLearnModel.batch_size 2 \\
--overwrite"""
)
run_command_line(
"""ctlearn-predict-stereo-model --verbose \\
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/proton_with_images_01.dl2.h5" \\
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/proton_with_images_01.ctlearn.stereo.dl2.h5" \\
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \\
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-stereo-energy/ctlearn_model.keras" \\
--DLImageReader.mode stereo --DLImageReader.min_telescopes 2 \\
--TableQualityQuery.quality_criteria "[]" \\
--PredictCTLearnModel.stack_telescope_images True \\
--PredictCTLearnModel.batch_size 2 \\
--overwrite"""
)
Running command: $ ctlearn-predict-stereo-model --verbose \
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/gamma-diffuse_with_images_01.dl2.h5" \
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/gamma-diffuse_with_images_01.ctlearn.stereo.dl2.h5" \
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-stereo-energy/ctlearn_model.keras" \
--DLImageReader.mode stereo --DLImageReader.min_telescopes 2 \
--TableQualityQuery.quality_criteria "[]" \
--PredictCTLearnModel.stack_telescope_images True \
--PredictCTLearnModel.batch_size 2 \
--overwrite
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189687.384457 6618 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189687.422407 6618 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189688.236002 6618 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2026-11-20 15:48:08,914 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.initialize): Loading config from '[PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')]'
2026-11-20 15:48:08,915 DEBUG [ctlearn.ctlearn-predict-stereo-model] (application._load_config_files): Looking for /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config in /home/runner/work/ctlearn/ctlearn/examples/tutorials
2026-11-20 15:48:08,915 DEBUG [ctlearn.ctlearn-predict-stereo-model] (application._load_config_files): Loaded config file: /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json
2026-11-20 15:48:08,916 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.initialize): ctapipe version 0.33.0
2026-11-20 15:48:08,916 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): ctlearn version 0.11.2.dev2+g312165f28
2026-11-20 15:48:08,916 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): HDF5Merger: waveforms and images will not be copied to the DL2 output by default; set 'r0_waveforms', 'r1_waveforms', 'dl1_images' and/or 'true_images' to true in the configuration to enable waveform and/or image copying.
2026-11-20 15:48:08,916 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Copying to output destination.
2026-11-20 15:48:09,468 INFO [ctlearn.ctlearn-predict-stereo-model.HDF5Merger] (hdf5merger._get_required_nodes): Updated required nodes to ['/configuration/observation/observation_block', '/configuration/observation/scheduling_block', '/configuration/simulation/run', '/configuration/telescope/pointing', '/dl0/event/subarray/trigger', '/dl0/event/telescope/trigger', '/dl1/event/telescope/parameters', '/simulation', '/simulation/event/subarray/shower', '/simulation/event/telescope/images', '/simulation/event/telescope/impact', '/simulation/event/telescope/parameters', '/simulation/service/shower_distribution']
E0000 00:00:1795189689.701629 6618 cuda_platform.cc:52] failed call to cuInit: INTERNAL: CUDA error: Failed call to cuInit: UNKNOWN ERROR (303)
2026-11-20 15:48:09,725 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Framework selected: Keras
2026-11-20 15:48:09,725 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Using Keras MirroredStrategy with 1 replica(s).
2026-11-20 15:48:09,725 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Loading data reader:
2026-11-20 15:48:09,725 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): For a large dataset, this may take a while...
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Observation Block ID != Simulation Run Identifier). Using Simulation Run Identifier for merged output [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0' [astropy.utils.metadata.merge]
2026-11-20 15:48:10,504 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Number of events loaded: 140
2026-11-20 15:48:10,538 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model._ensure_subarray_consistency): SubarrayDescription was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.stereo.dl2.h5'
2026-11-20 15:48:10,751 DEBUG [ctlearn.ctlearn-predict-stereo-model] (tool.run): CONFIG: {'StereoPredictCTLearnModel': {'batch_size': 2, 'config_files': [PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')], 'dl1_features': False, 'dl1dh_reader_type': 'DLImageReader', 'dl2_subarray': True, 'dl2_telescope': True, 'input_url': PosixPath('/home/runner/.cache/ctlearn/tutorial-data/ctapipe-0.33.0-max500/gamma-diffuse_with_images_01.dl2.h5'), 'load_cameradirection_model_from': None, 'load_energy_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/keras-stereo-energy/ctlearn_model.keras'), 'load_skydirection_model_from': None, 'load_type_model_from': None, 'log_config': {}, 'log_datefmt': '%Y-%m-%d %H:%M:%S', 'log_file': None, 'log_file_level': 'INFO', 'log_format': '[%(name)s]%(highlevel)s %(message)s', 'log_level': 10, 'logging_config': {}, 'output_path': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.stereo.dl2.h5'), 'overwrite': False, 'prefixes': {'type': 'CTLearnClassifier', 'energy': 'CTLearnRegressor', 'cameradirection': 'CTLearnCameraReconstructor', 'skydirection': 'CTLearnSkyReconstructor', 'all': 'CTLearn'}, 'provenance_log': PosixPath('/home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-stereo-model.provenance.log'), 'quiet': False, 'show_config': False, 'show_config_json': False, 'sort_by_intensity': False, 'stack_telescope_images': True, 'DLImageReader': {'allowed_tel_types': ['LST_LST_LSTCam'], 'allowed_tels': None, 'channels': ['image', 'relative_peak_time'], 'enforce_subarray_equality': True, 'focal_length_choice': <FocalLengthKind.EFFECTIVE: 1>, 'force_dl1_lookup': False, 'image_mapper_type': [('type', '*', 'BilinearMapper')], 'min_telescopes': 2, 'min_telescopes_of_type': [('type', '*', 0)], 'mode': 'stereo', 'skip_incompatible_files': False, 'TableQualityQuery': {'passed_all_column_name': 'PASSED_ALL', 'quality_criteria': []}}}}
2026-11-20 15:48:10,752 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): Processing the telescope pointings...
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:48:10,811 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model._store_mc_subarray_pointing): DL1 subarray pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.stereo.dl2.h5' under '/dl1/monitoring/subarray/pointing'
2026-11-20 15:48:10,811 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): Starting the prediction...
2026-11-20 15:48:10,811 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model._predict_energy): Predicting for the regression of the primary particle energy...
I0000 00:00:1795189691.928425 6618 generator_dataset_op.cc:213] Memory patch applied: M_TRIM_THRESHOLD=128 kb was set.
1/70 ━━━━━━━━━━━━━━━━━━━━ 37s 550ms/step
2/70 ━━━━━━━━━━━━━━━━━━━━ 5s 78ms/step
3/70 ━━━━━━━━━━━━━━━━━━━━ 5s 77ms/step
4/70 ━━━━━━━━━━━━━━━━━━━━ 5s 76ms/step
5/70 ━━━━━━━━━━━━━━━━━━━━ 4s 76ms/step
6/70 ━━━━━━━━━━━━━━━━━━━━ 4s 78ms/step
7/70 ━━━━━━━━━━━━━━━━━━━━ 4s 78ms/step
8/70 ━━━━━━━━━━━━━━━━━━━━ 4s 77ms/step
9/70 ━━━━━━━━━━━━━━━━━━━━ 4s 77ms/step
10/70 ━━━━━━━━━━━━━━━━━━━━ 4s 77ms/step
11/70 ━━━━━━━━━━━━━━━━━━━━ 4s 77ms/step
12/70 ━━━━━━━━━━━━━━━━━━━━ 4s 77ms/step
13/70 ━━━━━━━━━━━━━━━━━━━━ 4s 77ms/step
14/70 ━━━━━━━━━━━━━━━━━━━━ 4s 77ms/step
15/70 ━━━━━━━━━━━━━━━━━━━━ 4s 77ms/step
16/70 ━━━━━━━━━━━━━━━━━━━━ 4s 77ms/step
17/70 ━━━━━━━━━━━━━━━━━━━━ 4s 77ms/step
18/70 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
19/70 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
20/70 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
21/70 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
22/70 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
23/70 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
24/70 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
25/70 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
26/70 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
27/70 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
28/70 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
29/70 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
30/70 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
31/70 ━━━━━━━━━━━━━━━━━━━━ 2s 77ms/step
32/70 ━━━━━━━━━━━━━━━━━━━━ 2s 77ms/step
33/70 ━━━━━━━━━━━━━━━━━━━━ 2s 77ms/step
34/70 ━━━━━━━━━━━━━━━━━━━━ 2s 77ms/step
35/70 ━━━━━━━━━━━━━━━━━━━━ 2s 77ms/step
36/70 ━━━━━━━━━━━━━━━━━━━━ 2s 77ms/step
37/70 ━━━━━━━━━━━━━━━━━━━━ 2s 77ms/step
38/70 ━━━━━━━━━━━━━━━━━━━━ 2s 77ms/step
39/70 ━━━━━━━━━━━━━━━━━━━━ 2s 77ms/step
40/70 ━━━━━━━━━━━━━━━━━━━━ 2s 77ms/step
41/70 ━━━━━━━━━━━━━━━━━━━━ 2s 77ms/step
42/70 ━━━━━━━━━━━━━━━━━━━━ 2s 77ms/step
43/70 ━━━━━━━━━━━━━━━━━━━━ 2s 77ms/step
44/70 ━━━━━━━━━━━━━━━━━━━━ 1s 77ms/step
45/70 ━━━━━━━━━━━━━━━━━━━━ 1s 77ms/step
46/70 ━━━━━━━━━━━━━━━━━━━━ 1s 77ms/step
47/70 ━━━━━━━━━━━━━━━━━━━━ 1s 77ms/step
48/70 ━━━━━━━━━━━━━━━━━━━━ 1s 77ms/step
49/70 ━━━━━━━━━━━━━━━━━━━━ 1s 77ms/step
50/70 ━━━━━━━━━━━━━━━━━━━━ 1s 77ms/step
51/70 ━━━━━━━━━━━━━━━━━━━━ 1s 77ms/step
52/70 ━━━━━━━━━━━━━━━━━━━━ 1s 77ms/step
53/70 ━━━━━━━━━━━━━━━━━━━━ 1s 77ms/step
54/70 ━━━━━━━━━━━━━━━━━━━━ 1s 77ms/step
55/70 ━━━━━━━━━━━━━━━━━━━━ 1s 77ms/step
56/70 ━━━━━━━━━━━━━━━━━━━━ 1s 77ms/step
57/70 ━━━━━━━━━━━━━━━━━━━━ 1s 77ms/step
58/70 ━━━━━━━━━━━━━━━━━━━━ 0s 77ms/step
59/70 ━━━━━━━━━━━━━━━━━━━━ 0s 77ms/step
60/70 ━━━━━━━━━━━━━━━━━━━━ 0s 77ms/step
61/70 ━━━━━━━━━━━━━━━━━━━━ 0s 77ms/step
62/70 ━━━━━━━━━━━━━━━━━━━━ 0s 77ms/step
63/70 ━━━━━━━━━━━━━━━━━━━━ 0s 77ms/step
64/70 ━━━━━━━━━━━━━━━━━━━━ 0s 77ms/step
65/70 ━━━━━━━━━━━━━━━━━━━━ 0s 77ms/step
66/70 ━━━━━━━━━━━━━━━━━━━━ 0s 77ms/step
67/70 ━━━━━━━━━━━━━━━━━━━━ 0s 77ms/step
68/70 ━━━━━━━━━━━━━━━━━━━━ 0s 77ms/step
69/70 ━━━━━━━━━━━━━━━━━━━━ 0s 77ms/step
70/70 ━━━━━━━━━━━━━━━━━━━━ 0s 77ms/step
70/70 ━━━━━━━━━━━━━━━━━━━━ 6s 77ms/step
2026-11-20 15:48:17,830 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.stereo.dl2.h5' under '/dl2/event/subarray/energy/CTLearnRegressor'
2026-11-20 15:48:17,834 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.stereo.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnRegressor'
2026-11-20 15:48:17,841 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.finish): Tool is shutting down
2026-11-20 15:48:17,841 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.write_provenance): Output: /home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.ctlearn.stereo.dl2.h5
2026-11-20 15:48:17,841 DEBUG [ctlearn.ctlearn-predict-stereo-model] (tool.write_provenance): PROVENANCE: 'Details about provenance is found in /home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-stereo-model.provenance.log'
2026-11-20 15:48:17,842 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.run): Finished ctlearn-predict-stereo-model
2026-11-20 15:48:17,842 DEBUG [ctlearn.ctlearn-predict-stereo-model] (application.exit): Exiting application: ctlearn-predict-stereo-model
Running command: $ ctlearn-predict-stereo-model --verbose \
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/proton_with_images_01.dl2.h5" \
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/proton_with_images_01.ctlearn.stereo.dl2.h5" \
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-stereo-energy/ctlearn_model.keras" \
--DLImageReader.mode stereo --DLImageReader.min_telescopes 2 \
--TableQualityQuery.quality_criteria "[]" \
--PredictCTLearnModel.stack_telescope_images True \
--PredictCTLearnModel.batch_size 2 \
--overwrite
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189701.806382 6658 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189701.843900 6658 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189702.648900 6658 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2026-11-20 15:48:23,333 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.initialize): Loading config from '[PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')]'
2026-11-20 15:48:23,333 DEBUG [ctlearn.ctlearn-predict-stereo-model] (application._load_config_files): Looking for /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config in /home/runner/work/ctlearn/ctlearn/examples/tutorials
2026-11-20 15:48:23,333 DEBUG [ctlearn.ctlearn-predict-stereo-model] (application._load_config_files): Loaded config file: /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json
2026-11-20 15:48:23,335 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.initialize): ctapipe version 0.33.0
2026-11-20 15:48:23,335 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): ctlearn version 0.11.2.dev2+g312165f28
2026-11-20 15:48:23,335 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): HDF5Merger: waveforms and images will not be copied to the DL2 output by default; set 'r0_waveforms', 'r1_waveforms', 'dl1_images' and/or 'true_images' to true in the configuration to enable waveform and/or image copying.
2026-11-20 15:48:23,335 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Copying to output destination.
2026-11-20 15:48:24,010 INFO [ctlearn.ctlearn-predict-stereo-model.HDF5Merger] (hdf5merger._get_required_nodes): Updated required nodes to ['/configuration/observation/observation_block', '/configuration/observation/scheduling_block', '/configuration/simulation/run', '/configuration/telescope/pointing', '/dl0/event/subarray/trigger', '/dl0/event/telescope/trigger', '/dl1/event/telescope/parameters', '/simulation', '/simulation/event/subarray/shower', '/simulation/event/telescope/images', '/simulation/event/telescope/impact', '/simulation/event/telescope/parameters', '/simulation/service/shower_distribution']
E0000 00:00:1795189704.571808 6658 cuda_platform.cc:52] failed call to cuInit: INTERNAL: CUDA error: Failed call to cuInit: UNKNOWN ERROR (303)
2026-11-20 15:48:24,592 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Framework selected: Keras
2026-11-20 15:48:24,592 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Using Keras MirroredStrategy with 1 replica(s).
2026-11-20 15:48:24,592 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Loading data reader:
2026-11-20 15:48:24,592 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): For a large dataset, this may take a while...
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Observation Block ID != Simulation Run Identifier). Using Simulation Run Identifier for merged output [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0' [astropy.utils.metadata.merge]
2026-11-20 15:48:25,371 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Number of events loaded: 113
2026-11-20 15:48:25,423 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model._ensure_subarray_consistency): SubarrayDescription was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.stereo.dl2.h5'
2026-11-20 15:48:25,633 DEBUG [ctlearn.ctlearn-predict-stereo-model] (tool.run): CONFIG: {'StereoPredictCTLearnModel': {'batch_size': 2, 'config_files': [PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')], 'dl1_features': False, 'dl1dh_reader_type': 'DLImageReader', 'dl2_subarray': True, 'dl2_telescope': True, 'input_url': PosixPath('/home/runner/.cache/ctlearn/tutorial-data/ctapipe-0.33.0-max500/proton_with_images_01.dl2.h5'), 'load_cameradirection_model_from': None, 'load_energy_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/keras-stereo-energy/ctlearn_model.keras'), 'load_skydirection_model_from': None, 'load_type_model_from': None, 'log_config': {}, 'log_datefmt': '%Y-%m-%d %H:%M:%S', 'log_file': None, 'log_file_level': 'INFO', 'log_format': '[%(name)s]%(highlevel)s %(message)s', 'log_level': 10, 'logging_config': {}, 'output_path': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.stereo.dl2.h5'), 'overwrite': False, 'prefixes': {'type': 'CTLearnClassifier', 'energy': 'CTLearnRegressor', 'cameradirection': 'CTLearnCameraReconstructor', 'skydirection': 'CTLearnSkyReconstructor', 'all': 'CTLearn'}, 'provenance_log': PosixPath('/home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-stereo-model.provenance.log'), 'quiet': False, 'show_config': False, 'show_config_json': False, 'sort_by_intensity': False, 'stack_telescope_images': True, 'DLImageReader': {'allowed_tel_types': ['LST_LST_LSTCam'], 'allowed_tels': None, 'channels': ['image', 'relative_peak_time'], 'enforce_subarray_equality': True, 'focal_length_choice': <FocalLengthKind.EFFECTIVE: 1>, 'force_dl1_lookup': False, 'image_mapper_type': [('type', '*', 'BilinearMapper')], 'min_telescopes': 2, 'min_telescopes_of_type': [('type', '*', 0)], 'mode': 'stereo', 'skip_incompatible_files': False, 'TableQualityQuery': {'passed_all_column_name': 'PASSED_ALL', 'quality_criteria': []}}}}
2026-11-20 15:48:25,633 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): Processing the telescope pointings...
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:48:25,685 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model._store_mc_subarray_pointing): DL1 subarray pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.stereo.dl2.h5' under '/dl1/monitoring/subarray/pointing'
2026-11-20 15:48:25,685 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): Starting the prediction...
2026-11-20 15:48:25,685 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model._predict_energy): Predicting for the regression of the primary particle energy...
I0000 00:00:1795189706.796919 6658 generator_dataset_op.cc:213] Memory patch applied: M_TRIM_THRESHOLD=128 kb was set.
1/56 ━━━━━━━━━━━━━━━━━━━━ 30s 559ms/step
2/56 ━━━━━━━━━━━━━━━━━━━━ 4s 78ms/step
3/56 ━━━━━━━━━━━━━━━━━━━━ 4s 78ms/step
4/56 ━━━━━━━━━━━━━━━━━━━━ 4s 78ms/step
5/56 ━━━━━━━━━━━━━━━━━━━━ 4s 79ms/step
6/56 ━━━━━━━━━━━━━━━━━━━━ 3s 78ms/step
7/56 ━━━━━━━━━━━━━━━━━━━━ 3s 78ms/step
8/56 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
9/56 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
10/56 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
11/56 ━━━━━━━━━━━━━━━━━━━━ 3s 77ms/step
12/56 ━━━━━━━━━━━━━━━━━━━━ 3s 78ms/step
13/56 ━━━━━━━━━━━━━━━━━━━━ 3s 78ms/step
14/56 ━━━━━━━━━━━━━━━━━━━━ 3s 78ms/step
15/56 ━━━━━━━━━━━━━━━━━━━━ 3s 78ms/step
16/56 ━━━━━━━━━━━━━━━━━━━━ 3s 78ms/step
17/56 ━━━━━━━━━━━━━━━━━━━━ 3s 78ms/step
18/56 ━━━━━━━━━━━━━━━━━━━━ 2s 78ms/step
19/56 ━━━━━━━━━━━━━━━━━━━━ 2s 78ms/step
20/56 ━━━━━━━━━━━━━━━━━━━━ 2s 78ms/step
21/56 ━━━━━━━━━━━━━━━━━━━━ 2s 78ms/step
22/56 ━━━━━━━━━━━━━━━━━━━━ 2s 78ms/step
23/56 ━━━━━━━━━━━━━━━━━━━━ 2s 78ms/step
24/56 ━━━━━━━━━━━━━━━━━━━━ 2s 78ms/step
25/56 ━━━━━━━━━━━━━━━━━━━━ 2s 78ms/step
26/56 ━━━━━━━━━━━━━━━━━━━━ 2s 78ms/step
27/56 ━━━━━━━━━━━━━━━━━━━━ 2s 78ms/step
28/56 ━━━━━━━━━━━━━━━━━━━━ 2s 78ms/step
29/56 ━━━━━━━━━━━━━━━━━━━━ 2s 79ms/step
30/56 ━━━━━━━━━━━━━━━━━━━━ 2s 79ms/step
31/56 ━━━━━━━━━━━━━━━━━━━━ 1s 79ms/step
32/56 ━━━━━━━━━━━━━━━━━━━━ 1s 79ms/step
33/56 ━━━━━━━━━━━━━━━━━━━━ 1s 79ms/step
34/56 ━━━━━━━━━━━━━━━━━━━━ 1s 79ms/step
35/56 ━━━━━━━━━━━━━━━━━━━━ 1s 79ms/step
36/56 ━━━━━━━━━━━━━━━━━━━━ 1s 79ms/step
37/56 ━━━━━━━━━━━━━━━━━━━━ 1s 79ms/step
38/56 ━━━━━━━━━━━━━━━━━━━━ 1s 79ms/step
39/56 ━━━━━━━━━━━━━━━━━━━━ 1s 79ms/step
40/56 ━━━━━━━━━━━━━━━━━━━━ 1s 79ms/step
41/56 ━━━━━━━━━━━━━━━━━━━━ 1s 79ms/step
42/56 ━━━━━━━━━━━━━━━━━━━━ 1s 79ms/step
43/56 ━━━━━━━━━━━━━━━━━━━━ 1s 79ms/step
44/56 ━━━━━━━━━━━━━━━━━━━━ 0s 79ms/step
45/56 ━━━━━━━━━━━━━━━━━━━━ 0s 79ms/step
46/56 ━━━━━━━━━━━━━━━━━━━━ 0s 79ms/step
47/56 ━━━━━━━━━━━━━━━━━━━━ 0s 79ms/step
48/56 ━━━━━━━━━━━━━━━━━━━━ 0s 79ms/step
49/56 ━━━━━━━━━━━━━━━━━━━━ 0s 79ms/step
50/56 ━━━━━━━━━━━━━━━━━━━━ 0s 79ms/step
51/56 ━━━━━━━━━━━━━━━━━━━━ 0s 79ms/step
52/56 ━━━━━━━━━━━━━━━━━━━━ 0s 79ms/step
53/56 ━━━━━━━━━━━━━━━━━━━━ 0s 79ms/step
54/56 ━━━━━━━━━━━━━━━━━━━━ 0s 79ms/step
55/56 ━━━━━━━━━━━━━━━━━━━━ 0s 79ms/step
56/56 ━━━━━━━━━━━━━━━━━━━━ 0s 79ms/step
56/56 ━━━━━━━━━━━━━━━━━━━━ 5s 79ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 634ms/step
1/1 ━━━━━━━━━━━━━━━━━━━━ 1s 638ms/step
2026-11-20 15:48:32,391 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.stereo.dl2.h5' under '/dl2/event/subarray/energy/CTLearnRegressor'
2026-11-20 15:48:32,394 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.stereo.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnRegressor'
2026-11-20 15:48:32,400 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.finish): Tool is shutting down
2026-11-20 15:48:32,401 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.write_provenance): Output: /home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.ctlearn.stereo.dl2.h5
2026-11-20 15:48:32,401 DEBUG [ctlearn.ctlearn-predict-stereo-model] (tool.write_provenance): PROVENANCE: 'Details about provenance is found in /home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-stereo-model.provenance.log'
2026-11-20 15:48:32,402 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.run): Finished ctlearn-predict-stereo-model
2026-11-20 15:48:32,402 DEBUG [ctlearn.ctlearn-predict-stereo-model] (application.exit): Exiting application: ctlearn-predict-stereo-model
2. PyTorch stereoscopic model prediction#
run_command_line(
"""ctlearn-predict-stereo-model --verbose \\
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/gamma-diffuse_with_images_01.dl2.h5" \\
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.stereo.dl2.h5" \\
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \\
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-stereo-energy/ctlearn_model.pth" \\
--DLImageReader.mode stereo --DLImageReader.min_telescopes 2 \\
--TableQualityQuery.quality_criteria "[]" \\
--PredictCTLearnModel.stack_telescope_images True \\
--PredictCTLearnModel.batch_size 2 \\
--overwrite"""
)
run_command_line(
"""ctlearn-predict-stereo-model --verbose \\
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/proton_with_images_01.dl2.h5" \\
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/proton_with_images_01.pytorch.ctlearn.stereo.dl2.h5" \\
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \\
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-stereo-energy/ctlearn_model.pth" \\
--DLImageReader.mode stereo --DLImageReader.min_telescopes 2 \\
--TableQualityQuery.quality_criteria "[]" \\
--PredictCTLearnModel.stack_telescope_images True \\
--PredictCTLearnModel.batch_size 2 \\
--overwrite"""
)
Running command: $ ctlearn-predict-stereo-model --verbose \
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/gamma-diffuse_with_images_01.dl2.h5" \
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.stereo.dl2.h5" \
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-stereo-energy/ctlearn_model.pth" \
--DLImageReader.mode stereo --DLImageReader.min_telescopes 2 \
--TableQualityQuery.quality_criteria "[]" \
--PredictCTLearnModel.stack_telescope_images True \
--PredictCTLearnModel.batch_size 2 \
--overwrite
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189716.576286 6712 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189716.613783 6712 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189717.449739 6712 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2026-11-20 15:48:38,148 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.initialize): Loading config from '[PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')]'
2026-11-20 15:48:38,148 DEBUG [ctlearn.ctlearn-predict-stereo-model] (application._load_config_files): Looking for /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config in /home/runner/work/ctlearn/ctlearn/examples/tutorials
2026-11-20 15:48:38,148 DEBUG [ctlearn.ctlearn-predict-stereo-model] (application._load_config_files): Loaded config file: /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json
2026-11-20 15:48:38,150 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.initialize): ctapipe version 0.33.0
2026-11-20 15:48:38,150 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): ctlearn version 0.11.2.dev2+g312165f28
2026-11-20 15:48:38,150 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): HDF5Merger: waveforms and images will not be copied to the DL2 output by default; set 'r0_waveforms', 'r1_waveforms', 'dl1_images' and/or 'true_images' to true in the configuration to enable waveform and/or image copying.
2026-11-20 15:48:38,150 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Copying to output destination.
2026-11-20 15:48:38,710 INFO [ctlearn.ctlearn-predict-stereo-model.HDF5Merger] (hdf5merger._get_required_nodes): Updated required nodes to ['/configuration/observation/observation_block', '/configuration/observation/scheduling_block', '/configuration/simulation/run', '/configuration/telescope/pointing', '/dl0/event/subarray/trigger', '/dl0/event/telescope/trigger', '/dl1/event/telescope/parameters', '/simulation', '/simulation/event/subarray/shower', '/simulation/event/telescope/images', '/simulation/event/telescope/impact', '/simulation/event/telescope/parameters', '/simulation/service/shower_distribution']
2026-11-20 15:48:38,938 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Framework selected: PyTorch
2026-11-20 15:48:38,938 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Using PyTorch CPU device.
2026-11-20 15:48:38,938 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Loading data reader:
2026-11-20 15:48:38,938 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): For a large dataset, this may take a while...
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Observation Block ID != Simulation Run Identifier). Using Simulation Run Identifier for merged output [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0' [astropy.utils.metadata.merge]
2026-11-20 15:48:39,730 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Number of events loaded: 140
2026-11-20 15:48:39,783 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model._ensure_subarray_consistency): SubarrayDescription was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.stereo.dl2.h5'
2026-11-20 15:48:40,001 DEBUG [ctlearn.ctlearn-predict-stereo-model] (tool.run): CONFIG: {'StereoPredictCTLearnModel': {'batch_size': 2, 'config_files': [PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')], 'dl1_features': False, 'dl1dh_reader_type': 'DLImageReader', 'dl2_subarray': True, 'dl2_telescope': True, 'input_url': PosixPath('/home/runner/.cache/ctlearn/tutorial-data/ctapipe-0.33.0-max500/gamma-diffuse_with_images_01.dl2.h5'), 'load_cameradirection_model_from': None, 'load_energy_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/pytorch-stereo-energy/ctlearn_model.pth'), 'load_skydirection_model_from': None, 'load_type_model_from': None, 'log_config': {}, 'log_datefmt': '%Y-%m-%d %H:%M:%S', 'log_file': None, 'log_file_level': 'INFO', 'log_format': '[%(name)s]%(highlevel)s %(message)s', 'log_level': 10, 'logging_config': {}, 'output_path': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.stereo.dl2.h5'), 'overwrite': False, 'prefixes': {'type': 'CTLearnClassifier', 'energy': 'CTLearnRegressor', 'cameradirection': 'CTLearnCameraReconstructor', 'skydirection': 'CTLearnSkyReconstructor', 'all': 'CTLearn'}, 'provenance_log': PosixPath('/home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-stereo-model.provenance.log'), 'quiet': False, 'show_config': False, 'show_config_json': False, 'sort_by_intensity': False, 'stack_telescope_images': True, 'DLImageReader': {'allowed_tel_types': ['LST_LST_LSTCam'], 'allowed_tels': None, 'channels': ['image', 'relative_peak_time'], 'enforce_subarray_equality': True, 'focal_length_choice': <FocalLengthKind.EFFECTIVE: 1>, 'force_dl1_lookup': False, 'image_mapper_type': [('type', '*', 'BilinearMapper')], 'min_telescopes': 2, 'min_telescopes_of_type': [('type', '*', 0)], 'mode': 'stereo', 'skip_incompatible_files': False, 'TableQualityQuery': {'passed_all_column_name': 'PASSED_ALL', 'quality_criteria': []}}}}
2026-11-20 15:48:40,001 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): Processing the telescope pointings...
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:48:40,062 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model._store_mc_subarray_pointing): DL1 subarray pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.stereo.dl2.h5' under '/dl1/monitoring/subarray/pointing'
2026-11-20 15:48:40,062 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): Starting the prediction...
2026-11-20 15:48:40,062 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model._predict_energy): Predicting for the regression of the primary particle energy...
2026-11-20 15:48:50,407 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.stereo.dl2.h5' under '/dl2/event/subarray/energy/CTLearnRegressor'
2026-11-20 15:48:50,411 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.stereo.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnRegressor'
2026-11-20 15:48:50,417 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.finish): Tool is shutting down
2026-11-20 15:48:50,418 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.write_provenance): Output: /home/runner/.cache/ctlearn/tutorial-training/predictions/gamma-diffuse_with_images_01.pytorch.ctlearn.stereo.dl2.h5
2026-11-20 15:48:50,418 DEBUG [ctlearn.ctlearn-predict-stereo-model] (tool.write_provenance): PROVENANCE: 'Details about provenance is found in /home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-stereo-model.provenance.log'
2026-11-20 15:48:50,419 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.run): Finished ctlearn-predict-stereo-model
2026-11-20 15:48:50,419 DEBUG [ctlearn.ctlearn-predict-stereo-model] (application.exit): Exiting application: ctlearn-predict-stereo-model
Running command: $ ctlearn-predict-stereo-model --verbose \
--input_url "$CTLEARN_TUTORIAL_CONVERTED_DIR/proton_with_images_01.dl2.h5" \
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/proton_with_images_01.pytorch.ctlearn.stereo.dl2.h5" \
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-stereo-energy/ctlearn_model.pth" \
--DLImageReader.mode stereo --DLImageReader.min_telescopes 2 \
--TableQualityQuery.quality_criteria "[]" \
--PredictCTLearnModel.stack_telescope_images True \
--PredictCTLearnModel.batch_size 2 \
--overwrite
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189734.514473 6727 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189734.552601 6727 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189735.396687 6727 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2026-11-20 15:48:56,101 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.initialize): Loading config from '[PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')]'
2026-11-20 15:48:56,101 DEBUG [ctlearn.ctlearn-predict-stereo-model] (application._load_config_files): Looking for /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config in /home/runner/work/ctlearn/ctlearn/examples/tutorials
2026-11-20 15:48:56,101 DEBUG [ctlearn.ctlearn-predict-stereo-model] (application._load_config_files): Loaded config file: /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json
2026-11-20 15:48:56,102 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.initialize): ctapipe version 0.33.0
2026-11-20 15:48:56,103 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): ctlearn version 0.11.2.dev2+g312165f28
2026-11-20 15:48:56,103 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): HDF5Merger: waveforms and images will not be copied to the DL2 output by default; set 'r0_waveforms', 'r1_waveforms', 'dl1_images' and/or 'true_images' to true in the configuration to enable waveform and/or image copying.
2026-11-20 15:48:56,103 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Copying to output destination.
2026-11-20 15:48:56,779 INFO [ctlearn.ctlearn-predict-stereo-model.HDF5Merger] (hdf5merger._get_required_nodes): Updated required nodes to ['/configuration/observation/observation_block', '/configuration/observation/scheduling_block', '/configuration/simulation/run', '/configuration/telescope/pointing', '/dl0/event/subarray/trigger', '/dl0/event/telescope/trigger', '/dl1/event/telescope/parameters', '/simulation', '/simulation/event/subarray/shower', '/simulation/event/telescope/images', '/simulation/event/telescope/impact', '/simulation/event/telescope/parameters', '/simulation/service/shower_distribution']
2026-11-20 15:48:57,339 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Framework selected: PyTorch
2026-11-20 15:48:57,340 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Using PyTorch CPU device.
2026-11-20 15:48:57,340 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Loading data reader:
2026-11-20 15:48:57,340 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): For a large dataset, this may take a while...
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.33.0' [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Observation Block ID != Simulation Run Identifier). Using Simulation Run Identifier for merged output [astropy.utils.metadata.merge]
WARNING: MergeConflictWarning: Cannot merge meta key 'CTAPIPE_VERSION' types <class 'str'> and <class 'str'>, choosing CTAPIPE_VERSION='0.17.0' [astropy.utils.metadata.merge]
2026-11-20 15:48:58,116 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.setup): Number of events loaded: 113
2026-11-20 15:48:58,168 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model._ensure_subarray_consistency): SubarrayDescription was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.stereo.dl2.h5'
2026-11-20 15:48:58,383 DEBUG [ctlearn.ctlearn-predict-stereo-model] (tool.run): CONFIG: {'StereoPredictCTLearnModel': {'batch_size': 2, 'config_files': [PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')], 'dl1_features': False, 'dl1dh_reader_type': 'DLImageReader', 'dl2_subarray': True, 'dl2_telescope': True, 'input_url': PosixPath('/home/runner/.cache/ctlearn/tutorial-data/ctapipe-0.33.0-max500/proton_with_images_01.dl2.h5'), 'load_cameradirection_model_from': None, 'load_energy_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/pytorch-stereo-energy/ctlearn_model.pth'), 'load_skydirection_model_from': None, 'load_type_model_from': None, 'log_config': {}, 'log_datefmt': '%Y-%m-%d %H:%M:%S', 'log_file': None, 'log_file_level': 'INFO', 'log_format': '[%(name)s]%(highlevel)s %(message)s', 'log_level': 10, 'logging_config': {}, 'output_path': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.stereo.dl2.h5'), 'overwrite': False, 'prefixes': {'type': 'CTLearnClassifier', 'energy': 'CTLearnRegressor', 'cameradirection': 'CTLearnCameraReconstructor', 'skydirection': 'CTLearnSkyReconstructor', 'all': 'CTLearn'}, 'provenance_log': PosixPath('/home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-stereo-model.provenance.log'), 'quiet': False, 'show_config': False, 'show_config_json': False, 'sort_by_intensity': False, 'stack_telescope_images': True, 'DLImageReader': {'allowed_tel_types': ['LST_LST_LSTCam'], 'allowed_tels': None, 'channels': ['image', 'relative_peak_time'], 'enforce_subarray_equality': True, 'focal_length_choice': <FocalLengthKind.EFFECTIVE: 1>, 'force_dl1_lookup': False, 'image_mapper_type': [('type', '*', 'BilinearMapper')], 'min_telescopes': 2, 'min_telescopes_of_type': [('type', '*', 0)], 'mode': 'stereo', 'skip_incompatible_files': False, 'TableQualityQuery': {'passed_all_column_name': 'PASSED_ALL', 'quality_criteria': []}}}}
2026-11-20 15:48:58,383 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): Processing the telescope pointings...
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Simulation Run Identifier != Observation Block ID). Using Observation Block ID for merged output [astropy.utils.metadata.merge]
2026-11-20 15:48:58,436 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model._store_mc_subarray_pointing): DL1 subarray pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.stereo.dl2.h5' under '/dl1/monitoring/subarray/pointing'
2026-11-20 15:48:58,436 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): Starting the prediction...
2026-11-20 15:48:58,436 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model._predict_energy): Predicting for the regression of the primary particle energy...
2026-11-20 15:49:06,920 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.stereo.dl2.h5' under '/dl2/event/subarray/energy/CTLearnRegressor'
2026-11-20 15:49:06,924 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_stereo_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.stereo.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnRegressor'
2026-11-20 15:49:06,930 INFO [ctlearn.ctlearn-predict-stereo-model] (predict_model.finish): Tool is shutting down
2026-11-20 15:49:06,930 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.write_provenance): Output: /home/runner/.cache/ctlearn/tutorial-training/predictions/proton_with_images_01.pytorch.ctlearn.stereo.dl2.h5
2026-11-20 15:49:06,931 DEBUG [ctlearn.ctlearn-predict-stereo-model] (tool.write_provenance): PROVENANCE: 'Details about provenance is found in /home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-stereo-model.provenance.log'
2026-11-20 15:49:06,932 INFO [ctlearn.ctlearn-predict-stereo-model] (tool.run): Finished ctlearn-predict-stereo-model
2026-11-20 15:49:06,932 DEBUG [ctlearn.ctlearn-predict-stereo-model] (application.exit): Exiting application: ctlearn-predict-stereo-model
Part D3 CNN-based model inference using waveform data#
We perform inference with the previously trained mono energy model using
waveform data. The configuration must be consistent with the training
setup. An important configuration change is required to read waveform data:
the --PredictCTLearnModel.dl1dh_reader_type option must be set to the
appropriate DL1 data reader component for waveform reading
(DLWaveformReader) rather than the default image reader.
For this demonstration, we use the same data file as used during training, since suitable test data are currently not available. This is done only to demonstrate that the software workflow is functional. In a real analysis, using training data for testing is not valid practice.
The following commands run the inference with both the Keras and PyTorch models.
WAVEFORM_FILE = DATA_DIR / f"gamma_prod5{MAX_EVENTS_SUFFIX}.r1.dl1.h5"
if not WAVEFORM_FILE.is_file():
raise FileNotFoundError(
f"Cached waveform data is missing: {WAVEFORM_FILE}. "
"Run explore_public_data.py first."
)
1. Keras waveform model prediction#
run_command_line(
"""ctlearn-predict-mono-model --verbose \\
--input_url "$CTLEARN_TUTORIAL_DATA_DIR/gamma_prod5${CTLEARN_TUTORIAL_MAX_EVENTS_SUFFIX}.r1.dl1.h5" \\
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/gamma_prod5.keras.waveform.dl2.h5" \\
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \\
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-waveform-energy/ctlearn_model.keras" \\
--PredictCTLearnModel.dl1dh_reader_type DLWaveformReader \\
--PredictCTLearnModel.batch_size 2 \\
--TableQualityQuery.quality_criteria "[]" \\
--overwrite"""
)
Running command: $ ctlearn-predict-mono-model --verbose \
--input_url "$CTLEARN_TUTORIAL_DATA_DIR/gamma_prod5${CTLEARN_TUTORIAL_MAX_EVENTS_SUFFIX}.r1.dl1.h5" \
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/gamma_prod5.keras.waveform.dl2.h5" \
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-waveform-energy/ctlearn_model.keras" \
--PredictCTLearnModel.dl1dh_reader_type DLWaveformReader \
--PredictCTLearnModel.batch_size 2 \
--TableQualityQuery.quality_criteria "[]" \
--overwrite
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189751.052005 6744 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189751.089424 6744 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189751.900497 6744 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2026-11-20 15:49:12,588 INFO [ctlearn.ctlearn-predict-mono-model] (tool.initialize): Loading config from '[PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')]'
2026-11-20 15:49:12,588 DEBUG [ctlearn.ctlearn-predict-mono-model] (application._load_config_files): Looking for /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config in /home/runner/work/ctlearn/ctlearn/examples/tutorials
2026-11-20 15:49:12,588 DEBUG [ctlearn.ctlearn-predict-mono-model] (application._load_config_files): Loaded config file: /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json
2026-11-20 15:49:12,590 INFO [ctlearn.ctlearn-predict-mono-model] (tool.initialize): ctapipe version 0.33.0
2026-11-20 15:49:12,590 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): ctlearn version 0.11.2.dev2+g312165f28
2026-11-20 15:49:12,590 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): HDF5Merger: waveforms and images will not be copied to the DL2 output by default; set 'r0_waveforms', 'r1_waveforms', 'dl1_images' and/or 'true_images' to true in the configuration to enable waveform and/or image copying.
2026-11-20 15:49:12,590 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Copying to output destination.
2026-11-20 15:49:15,480 INFO [ctlearn.ctlearn-predict-mono-model.HDF5Merger] (hdf5merger._get_required_nodes): Updated required nodes to ['/configuration/observation/observation_block', '/configuration/observation/scheduling_block', '/configuration/simulation/run', '/configuration/telescope/pointing', '/dl0/event/subarray/trigger', '/dl0/event/telescope/trigger', '/dl1/event/telescope/parameters', '/simulation', '/simulation/event/subarray/shower', '/simulation/event/telescope/images', '/simulation/event/telescope/impact', '/simulation/event/telescope/parameters', '/simulation/service/shower_distribution']
E0000 00:00:1795189755.629111 6744 cuda_platform.cc:52] failed call to cuInit: INTERNAL: CUDA error: Failed call to cuInit: UNKNOWN ERROR (303)
2026-11-20 15:49:15,651 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Framework selected: Keras
2026-11-20 15:49:15,651 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Using Keras MirroredStrategy with 1 replica(s).
2026-11-20 15:49:15,652 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Loading data reader:
2026-11-20 15:49:15,652 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): For a large dataset, this may take a while...
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Observation Block ID != Simulation Run Identifier). Using Simulation Run Identifier for merged output [astropy.utils.metadata.merge]
2026-11-20 15:49:16,465 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Number of events loaded: 10
2026-11-20 15:49:16,514 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._ensure_subarray_consistency): SubarrayDescription was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5'
2026-11-20 15:49:17,765 DEBUG [ctlearn.ctlearn-predict-mono-model] (tool.run): CONFIG: {'MonoPredictCTLearnModel': {'batch_size': 2, 'config_files': [PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')], 'dl1_features': False, 'dl1dh_reader_type': 'DLWaveformReader', 'dl2_subarray': True, 'dl2_telescope': True, 'input_url': PosixPath('/home/runner/.cache/ctlearn/tutorial-data/gamma_prod5-max500.r1.dl1.h5'), 'load_cameradirection_model_from': None, 'load_energy_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/keras-waveform-energy/ctlearn_model.keras'), 'load_skydirection_model_from': None, 'load_type_model_from': None, 'log_config': {}, 'log_datefmt': '%Y-%m-%d %H:%M:%S', 'log_file': None, 'log_file_level': 'INFO', 'log_format': '[%(name)s]%(highlevel)s %(message)s', 'log_level': 10, 'logging_config': {}, 'output_path': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5'), 'overwrite': False, 'prefixes': {'type': 'CTLearnClassifier', 'energy': 'CTLearnRegressor', 'cameradirection': 'CTLearnCameraReconstructor', 'skydirection': 'CTLearnSkyReconstructor', 'all': 'CTLearn'}, 'provenance_log': PosixPath('/home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-mono-model.provenance.log'), 'quiet': False, 'show_config': False, 'show_config_json': False, 'sort_by_intensity': False, 'stack_telescope_images': False, 'stereo_combiner_cls': 'StereoMeanCombiner', 'DLWaveformReader': {'DBSCAN_params': {'eps': 0.5, 'min_samples': 5, 'metric': 'euclidean'}, 'allowed_tel_types': None, 'allowed_tels': {109, 112, 118, 119, 121, 122, 124}, 'cleaning_type': None, 'enforce_subarray_equality': True, 'focal_length_choice': <FocalLengthKind.EFFECTIVE: 1>, 'force_dl1_lookup': False, 'image_mapper_type': [('type', '*', 'BilinearMapper')], 'min_telescopes': 1, 'min_telescopes_of_type': [('type', '*', 0)], 'mode': 'mono', 'sequence_length': 5, 'sequence_position': 'center', 'skip_incompatible_files': False, 'TableQualityQuery': {'passed_all_column_name': 'PASSED_ALL', 'quality_criteria': []}}}}
2026-11-20 15:49:17,765 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing the telescope pointings...
2026-11-20 15:49:17,778 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_109'
2026-11-20 15:49:17,785 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_112'
2026-11-20 15:49:17,792 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_118'
2026-11-20 15:49:17,798 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_119'
2026-11-20 15:49:17,805 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_121'
2026-11-20 15:49:17,811 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_122'
2026-11-20 15:49:17,817 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_124'
2026-11-20 15:49:17,819 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Starting the prediction...
2026-11-20 15:49:17,819 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._predict_energy): Predicting for the regression of the primary particle energy...
I0000 00:00:1795189758.955530 6744 generator_dataset_op.cc:213] Memory patch applied: M_TRIM_THRESHOLD=128 kb was set.
1/5 ━━━━━━━━━━━━━━━━━━━━ 2s 553ms/step
2/5 ━━━━━━━━━━━━━━━━━━━━ 0s 77ms/step
3/5 ━━━━━━━━━━━━━━━━━━━━ 0s 79ms/step
4/5 ━━━━━━━━━━━━━━━━━━━━ 0s 83ms/step
5/5 ━━━━━━━━━━━━━━━━━━━━ 0s 80ms/step
5/5 ━━━━━━━━━━━━━━━━━━━━ 1s 81ms/step
2026-11-20 15:49:19,848 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_109'
2026-11-20 15:49:19,852 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_112'
2026-11-20 15:49:19,856 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_118'
2026-11-20 15:49:19,860 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_119'
2026-11-20 15:49:19,864 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_121'
2026-11-20 15:49:19,868 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_122'
2026-11-20 15:49:19,872 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_124'
2026-11-20 15:49:19,872 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing and storing the subarray energy prediction...
2026-11-20 15:49:19,883 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl2/event/subarray/energy/CTLearnRegressor'
2026-11-20 15:49:19,886 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnRegressor'
2026-11-20 15:49:19,893 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.finish): Tool is shutting down
2026-11-20 15:49:19,893 INFO [ctlearn.ctlearn-predict-mono-model] (tool.write_provenance): Output: /home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.keras.waveform.dl2.h5
2026-11-20 15:49:19,893 DEBUG [ctlearn.ctlearn-predict-mono-model] (tool.write_provenance): PROVENANCE: 'Details about provenance is found in /home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-mono-model.provenance.log'
2026-11-20 15:49:19,895 INFO [ctlearn.ctlearn-predict-mono-model] (tool.run): Finished ctlearn-predict-mono-model
2026-11-20 15:49:19,895 DEBUG [ctlearn.ctlearn-predict-mono-model] (application.exit): Exiting application: ctlearn-predict-mono-model
2. PyTorch waveform model prediction#
run_command_line(
"""ctlearn-predict-mono-model --verbose \\
--input_url "$CTLEARN_TUTORIAL_DATA_DIR/gamma_prod5${CTLEARN_TUTORIAL_MAX_EVENTS_SUFFIX}.r1.dl1.h5" \\
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/gamma_prod5.pytorch.waveform.dl2.h5" \\
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \\
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-waveform-energy/ctlearn_model.pth" \\
--PredictCTLearnModel.dl1dh_reader_type DLWaveformReader \\
--PredictCTLearnModel.batch_size 2 \\
--TableQualityQuery.quality_criteria "[]" \\
--overwrite"""
)
Running command: $ ctlearn-predict-mono-model --verbose \
--input_url "$CTLEARN_TUTORIAL_DATA_DIR/gamma_prod5${CTLEARN_TUTORIAL_MAX_EVENTS_SUFFIX}.r1.dl1.h5" \
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/gamma_prod5.pytorch.waveform.dl2.h5" \
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-waveform-energy/ctlearn_model.pth" \
--PredictCTLearnModel.dl1dh_reader_type DLWaveformReader \
--PredictCTLearnModel.batch_size 2 \
--TableQualityQuery.quality_criteria "[]" \
--overwrite
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189764.049551 6782 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189764.087172 6782 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189764.909048 6782 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2026-11-20 15:49:25,597 INFO [ctlearn.ctlearn-predict-mono-model] (tool.initialize): Loading config from '[PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')]'
2026-11-20 15:49:25,597 DEBUG [ctlearn.ctlearn-predict-mono-model] (application._load_config_files): Looking for /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config in /home/runner/work/ctlearn/ctlearn/examples/tutorials
2026-11-20 15:49:25,597 DEBUG [ctlearn.ctlearn-predict-mono-model] (application._load_config_files): Loaded config file: /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json
2026-11-20 15:49:25,599 INFO [ctlearn.ctlearn-predict-mono-model] (tool.initialize): ctapipe version 0.33.0
2026-11-20 15:49:25,599 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): ctlearn version 0.11.2.dev2+g312165f28
2026-11-20 15:49:25,599 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): HDF5Merger: waveforms and images will not be copied to the DL2 output by default; set 'r0_waveforms', 'r1_waveforms', 'dl1_images' and/or 'true_images' to true in the configuration to enable waveform and/or image copying.
2026-11-20 15:49:25,599 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Copying to output destination.
2026-11-20 15:49:28,492 INFO [ctlearn.ctlearn-predict-mono-model.HDF5Merger] (hdf5merger._get_required_nodes): Updated required nodes to ['/configuration/observation/observation_block', '/configuration/observation/scheduling_block', '/configuration/simulation/run', '/configuration/telescope/pointing', '/dl0/event/subarray/trigger', '/dl0/event/telescope/trigger', '/dl1/event/telescope/parameters', '/simulation', '/simulation/event/subarray/shower', '/simulation/event/telescope/images', '/simulation/event/telescope/impact', '/simulation/event/telescope/parameters', '/simulation/service/shower_distribution']
2026-11-20 15:49:28,636 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Framework selected: PyTorch
2026-11-20 15:49:28,636 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Using PyTorch CPU device.
2026-11-20 15:49:28,636 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Loading data reader:
2026-11-20 15:49:28,636 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): For a large dataset, this may take a while...
WARNING: MergeConflictWarning: In merged column 'obs_id' the 'description' attribute does not match (Observation Block ID != Simulation Run Identifier). Using Simulation Run Identifier for merged output [astropy.utils.metadata.merge]
2026-11-20 15:49:29,437 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.setup): Number of events loaded: 10
2026-11-20 15:49:29,486 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._ensure_subarray_consistency): SubarrayDescription was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5'
2026-11-20 15:49:30,696 DEBUG [ctlearn.ctlearn-predict-mono-model] (tool.run): CONFIG: {'MonoPredictCTLearnModel': {'batch_size': 2, 'config_files': [PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')], 'dl1_features': False, 'dl1dh_reader_type': 'DLWaveformReader', 'dl2_subarray': True, 'dl2_telescope': True, 'input_url': PosixPath('/home/runner/.cache/ctlearn/tutorial-data/gamma_prod5-max500.r1.dl1.h5'), 'load_cameradirection_model_from': None, 'load_energy_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/pytorch-waveform-energy/ctlearn_model.pth'), 'load_skydirection_model_from': None, 'load_type_model_from': None, 'log_config': {}, 'log_datefmt': '%Y-%m-%d %H:%M:%S', 'log_file': None, 'log_file_level': 'INFO', 'log_format': '[%(name)s]%(highlevel)s %(message)s', 'log_level': 10, 'logging_config': {}, 'output_path': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5'), 'overwrite': False, 'prefixes': {'type': 'CTLearnClassifier', 'energy': 'CTLearnRegressor', 'cameradirection': 'CTLearnCameraReconstructor', 'skydirection': 'CTLearnSkyReconstructor', 'all': 'CTLearn'}, 'provenance_log': PosixPath('/home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-mono-model.provenance.log'), 'quiet': False, 'show_config': False, 'show_config_json': False, 'sort_by_intensity': False, 'stack_telescope_images': False, 'stereo_combiner_cls': 'StereoMeanCombiner', 'DLWaveformReader': {'DBSCAN_params': {'eps': 0.5, 'min_samples': 5, 'metric': 'euclidean'}, 'allowed_tel_types': None, 'allowed_tels': {109, 112, 118, 119, 121, 122, 124}, 'cleaning_type': None, 'enforce_subarray_equality': True, 'focal_length_choice': <FocalLengthKind.EFFECTIVE: 1>, 'force_dl1_lookup': False, 'image_mapper_type': [('type', '*', 'BilinearMapper')], 'min_telescopes': 1, 'min_telescopes_of_type': [('type', '*', 0)], 'mode': 'mono', 'sequence_length': 5, 'sequence_position': 'center', 'skip_incompatible_files': False, 'TableQualityQuery': {'passed_all_column_name': 'PASSED_ALL', 'quality_criteria': []}}}}
2026-11-20 15:49:30,697 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing the telescope pointings...
2026-11-20 15:49:30,709 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_109'
2026-11-20 15:49:30,716 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_112'
2026-11-20 15:49:30,722 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_118'
2026-11-20 15:49:30,729 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_119'
2026-11-20 15:49:30,735 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_121'
2026-11-20 15:49:30,741 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_122'
2026-11-20 15:49:30,748 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model._store_mc_telescope_pointing): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_124'
2026-11-20 15:49:30,749 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Starting the prediction...
2026-11-20 15:49:30,749 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model._predict_energy): Predicting for the regression of the primary particle energy...
2026-11-20 15:49:31,502 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_109'
2026-11-20 15:49:31,506 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_112'
2026-11-20 15:49:31,510 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_118'
2026-11-20 15:49:31,514 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_119'
2026-11-20 15:49:31,518 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_121'
2026-11-20 15:49:31,522 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_122'
2026-11-20 15:49:31,526 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl2/event/telescope/energy/CTLearnRegressor/tel_124'
2026-11-20 15:49:31,526 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): Processing and storing the subarray energy prediction...
2026-11-20 15:49:31,536 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl2/event/subarray/energy/CTLearnRegressor'
2026-11-20 15:49:31,540 INFO [ctlearn.ctlearn-predict-mono-model] (predict_mono_model.start): DL2 service telescope event statistics data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5' under '/dl2/service/tel_event_statistics/CTLearnRegressor'
2026-11-20 15:49:31,546 INFO [ctlearn.ctlearn-predict-mono-model] (predict_model.finish): Tool is shutting down
2026-11-20 15:49:31,546 INFO [ctlearn.ctlearn-predict-mono-model] (tool.write_provenance): Output: /home/runner/.cache/ctlearn/tutorial-training/predictions/gamma_prod5.pytorch.waveform.dl2.h5
2026-11-20 15:49:31,546 DEBUG [ctlearn.ctlearn-predict-mono-model] (tool.write_provenance): PROVENANCE: 'Details about provenance is found in /home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-mono-model.provenance.log'
2026-11-20 15:49:31,548 INFO [ctlearn.ctlearn-predict-mono-model] (tool.run): Finished ctlearn-predict-mono-model
2026-11-20 15:49:31,548 DEBUG [ctlearn.ctlearn-predict-mono-model] (application.exit): Exiting application: ctlearn-predict-mono-model
Part E3 CNN-based model inference using LST-1 lstchain data#
The following three cells demonstrate the prediction tool for LST-1 DL1 data in the lstchain format. Since LST-1 data are private to the LST-1 collaboration and cannot be distributed, the first cell creates a mock dataset in the required format. The second cell displays the tool help and its available options. The final cell performs inference on the mock data using the models trained in the previous notebook. The tool predicts gammaness, energy, and arrival direction and writes the results to a ctapipe DL2 output file, together with the relevant LST-1 subarray, trigger, pointing, and DL1b parameter information.
Note: This prediction tool is specifically designed for the lstchain DL1 format and should not be used with other input data formats.
The inference commands below use the Keras and PyTorch models.
n_events = 25
rng = np.random.default_rng(1234)
subarray = get_lst1_subarray_description()
tel_id = 1
n_pixels = subarray.tel[tel_id].camera.geometry.n_pixels
event_ids = np.arange(1, n_events + 1, dtype=np.int64)
mock_lst1_file = PREDICTION_DIR / "mock_data_lst1.dl1.h5"
image_table = Table()
image_table["obs_id"] = np.ones(n_events, dtype=np.int64)
image_table["event_id"] = event_ids
image_table["tel_id"] = np.full(n_events, tel_id, dtype=np.int16)
image_table.add_column(
Column(
rng.uniform(80, 150, size=(n_events, n_pixels)).astype(np.float32),
name="image",
dtype=np.float32,
shape=(n_pixels,),
)
)
image_table.add_column(
Column(
rng.integers(0, 2, size=(n_events, n_pixels), dtype=bool),
name="image_mask",
dtype=bool,
shape=(n_pixels,),
)
)
image_table.add_column(
Column(
rng.normal(5.0, 0.5, size=(n_events, n_pixels)).astype(np.float32),
name="peak_time",
dtype=np.float32,
shape=(n_pixels,),
)
)
parameter_table = Table()
parameter_table["obs_id"] = np.ones(n_events, dtype=np.int64)
parameter_table["event_id"] = event_ids
parameter_table["tel_id"] = np.full(n_events, tel_id, dtype=np.int16)
parameter_table["intensity"] = rng.uniform(90, 140, size=n_events)
parameter_table["x"] = rng.normal(0.0, 0.05, size=n_events)
parameter_table["y"] = rng.normal(0.0, 0.05, size=n_events)
parameter_table["phi"] = rng.uniform(-np.pi, np.pi, size=n_events)
parameter_table["psi"] = rng.uniform(-np.pi, np.pi, size=n_events)
parameter_table["length"] = rng.uniform(0.05, 0.15, size=n_events)
parameter_table["length_uncertainty"] = rng.uniform(0.001, 0.003, size=n_events)
parameter_table["width"] = rng.uniform(0.02, 0.08, size=n_events)
parameter_table["width_uncertainty"] = rng.uniform(0.001, 0.003, size=n_events)
parameter_table["skewness"] = rng.normal(0.0, 0.2, size=n_events)
parameter_table["kurtosis"] = rng.normal(0.0, 0.2, size=n_events)
parameter_table["time_gradient"] = rng.normal(0.0, 0.01, size=n_events)
parameter_table["intercept"] = rng.normal(0.0, 0.01, size=n_events)
parameter_table["n_pixels"] = np.full(n_events, n_pixels, dtype=np.int16)
parameter_table["n_islands"] = np.zeros(n_events, dtype=np.int16)
parameter_table["event_type"] = np.full(n_events, 32, dtype=np.int16)
parameter_table["az_tel"] = np.full(n_events, 1.0)
parameter_table["alt_tel"] = np.full(n_events, 1.2)
parameter_table["dragon_time"] = np.linspace(1_700_000_000, 1_700_000_300, n_events)
subarray.to_hdf(mock_lst1_file, overwrite=True)
write_table(
image_table,
mock_lst1_file,
"/dl1/event/telescope/image/LST_LSTCam",
overwrite=True,
)
write_table(
parameter_table,
mock_lst1_file,
"/dl1/event/telescope/parameters/LST_LSTCam",
overwrite=True,
)
run_command_line("ctlearn-predict-LST1 -h")
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/ctapipe/core/provenance.py:286: MissingReferenceMetadata: Could not read reference metadata for input file: /home/runner/work/ctlearn/ctlearn/src/ctlearn/resources/LST-1_SubarrayDescription.h5
warnings.warn(
Running command: $ ctlearn-predict-LST1 -h
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189775.573679 6798 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189775.610904 6798 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189776.435195 6798 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
Tool to predict the gammaness, energy and arrival direction from lstchain DL1
data.
This tool is used to predict the gammaness, energy and arrival direction from
pixel-wise image data in lstchain format. The tool loads the trained models from
the specified paths and performs inference on the input data. The input data is
expected to be in the DL1 format of lstchain and the output data is stored in
the DL2 format of ctapipe. Besides the DL2 predictions, the tool creates the
SubarrayDescription of the LST-1 telescope and stores it in the output file. In
addition, the tool also creates the trigger, pointing and DL1 parameters tables
and stores them in the output file.
CAUTION: The tool is designed to work with the DL1 data format of lstchain only.
Options
=======
The options below are convenience aliases to configurable class-options,
as listed in the "Equivalent to" description-line of the aliases.
To see all configurable class-options for some <cmd>, use:
<cmd> --help-all
--debug
Set log-level to debug, for the most verbose logging.
Equivalent to: [--Application.log_level=10]
--show-config
Show the application's configuration (human-readable format)
Equivalent to: [--Application.show_config=True]
--show-config-json
Show the application's configuration (json format)
Equivalent to: [--Application.show_config_json=True]
-q, --quiet
Disable console logging.
Equivalent to: [--Tool.quiet=True]
-v, --verbose
Set log level to DEBUG
Equivalent to: [--Tool.log_level=DEBUG]
--overwrite
Overwrite existing output files without asking
Equivalent to: [--Tool.overwrite=True]
--dl1-features
Include dl1 features
Equivalent to: [--LST1PredictionTool.dl1_features=True]
--no-dl1-features
Exclude dl1 features
Equivalent to: [--LST1PredictionTool.dl1_features=False]
--dl2-telescope
Include dl2 telescope-event-wise data in the output file
Equivalent to: [--LST1PredictionTool.dl2_telescope=True]
--no-dl2-telescope
Exclude dl2 telescope-event-wise data in the output file
Equivalent to: [--LST1PredictionTool.dl2_telescope=False]
--dl2-subarray
Include dl2 subarray-event-wise data in the output file
Equivalent to: [--LST1PredictionTool.dl2_subarray=True]
--no-dl2-subarray
Exclude dl2 subarray-event-wise data in the output file
Equivalent to: [--LST1PredictionTool.dl2_subarray=False]
-c, --config=<list-item-1>...
List of configuration files with parameters to load in addition to command-
line parameters. The order listed is the order of precedence (later config
parameters overwrite earlier ones), however parameters specified on the
command line always have the highest precedence. Config files may be in
JSON, YAML, TOML, or Python format
Default: []
Equivalent to: [--Tool.config_files]
--log-level=<Enum>
Set the log level by value or name.
Choices: any of [0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL']
Default: 30
Equivalent to: [--Tool.log_level]
-l, --log-file=<Path>
Filename for the log
Default: None
Equivalent to: [--Tool.log_file]
--log-file-level=<Enum>
Logging Level for File Logging
Choices: any of [0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL']
Default: 'INFO'
Equivalent to: [--Tool.log_file_level]
--provenance-log=<Path>
Default: None
Equivalent to: [--Tool.provenance_log]
-i, --input_url=<Path>
Input LST-1 HDF5 files including pixel-wise image data
Default: None
Equivalent to: [--LST1PredictionTool.input_url]
-t, --type_model=<Path>
Path to a Keras model file (Keras3) for the classification of the primary
particle type.
Default: None
Equivalent to: [--LST1PredictionTool.load_type_model_from]
-e, --energy_model=<Path>
Path to a Keras model file (Keras3) for the regression of the primary
particle energy.
Default: None
Equivalent to: [--LST1PredictionTool.load_energy_model_from]
-d, --cameradirection_model=<Path>
Path to a Keras model file (Keras3) for the regression of the primary
particle arrival direction based on the camera coordinate offsets.
Default: None
Equivalent to: [--LST1PredictionTool.load_cameradirection_model_from]
-o, --output=<Path>
Output path to save the dl2 prediction results
Default: './output.dl2.h5'
Equivalent to: [--LST1PredictionTool.output_path]
Examples
--------
To predict from DL1 lstchain data using trained CTLearn models:
> ctlearn-predict-LST1 --input_url input.subrun.lstchain.dl1.h5 --LST1PredictionTool.batch_size=64 --LST1PredictionTool.channels=cleaned_image --LST1PredictionTool.channels=cleaned_relative_peak_time --LST1PredictionTool.image_mapper_type=BilinearMapper --type_model="/path/to/your/type/ctlearn_model(.keras/.pth)" --energy_model="/path/to/your/energy/ctlearn_model(.keras/.pth)" --cameradirection_model="/path/to/your/direction/ctlearn_model(.keras/.pth)" --output output.dl2.h5 --overwrite
To see all available configurables, use `--help-all`.
1. Keras model prediction using LST-1 lstchain mock data#
run_command_line(
"""ctlearn-predict-LST1 --verbose \\
--input_url "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/mock_data_lst1.dl1.h5" \\
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/mock_data_lst1.keras.ctlearn.dl2.h5" \\
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \\
--type_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-classification/ctlearn_model.keras" \\
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-energy/ctlearn_model.keras" \\
--cameradirection_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-cameradirection/ctlearn_model.keras" \\
--LST1PredictionTool.batch_size 5 \\
--LST1PredictionTool.channels cleaned_image \\
--LST1PredictionTool.channels cleaned_relative_peak_time \\
--LST1PredictionTool.image_mapper_type BilinearMapper \\
--TableQualityQuery.quality_criteria "[]" \\
--overwrite"""
)
Running command: $ ctlearn-predict-LST1 --verbose \
--input_url "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/mock_data_lst1.dl1.h5" \
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/mock_data_lst1.keras.ctlearn.dl2.h5" \
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \
--type_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-classification/ctlearn_model.keras" \
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-energy/ctlearn_model.keras" \
--cameradirection_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/keras-cameradirection/ctlearn_model.keras" \
--LST1PredictionTool.batch_size 5 \
--LST1PredictionTool.channels cleaned_image \
--LST1PredictionTool.channels cleaned_relative_peak_time \
--LST1PredictionTool.image_mapper_type BilinearMapper \
--TableQualityQuery.quality_criteria "[]" \
--overwrite
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189780.908940 6812 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189780.946220 6812 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189781.759754 6812 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2026-11-20 15:49:42,436 INFO [ctlearn.ctlearn-predict-LST1] (tool.initialize): Loading config from '[PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')]'
2026-11-20 15:49:42,437 DEBUG [ctlearn.ctlearn-predict-LST1] (application._load_config_files): Looking for /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config in /home/runner/work/ctlearn/ctlearn/examples/tutorials
2026-11-20 15:49:42,437 DEBUG [ctlearn.ctlearn-predict-LST1] (application._load_config_files): Loaded config file: /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json
2026-11-20 15:49:42,438 INFO [ctlearn.ctlearn-predict-LST1] (tool.initialize): ctapipe version 0.33.0
2026-11-20 15:49:42,438 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.setup): ctlearn version 0.11.2.dev2+g312165f28
E0000 00:00:1795189782.439264 6812 cuda_platform.cc:52] failed call to cuInit: INTERNAL: CUDA error: Failed call to cuInit: UNKNOWN ERROR (303)
2026-11-20 15:49:42,457 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.setup): Framework selected: Keras
2026-11-20 15:49:42,457 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.setup): Using Keras MirroredStrategy with 1 replica(s).
2026-11-20 15:49:42,457 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1._load_model): Loading the model from /home/runner/.cache/ctlearn/tutorial-training/keras-classification/ctlearn_model.keras.
2026-11-20 15:49:43,511 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1._load_model): Loading the model from /home/runner/.cache/ctlearn/tutorial-training/keras-energy/ctlearn_model.keras.
2026-11-20 15:49:44,250 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1._load_model): Loading the model from /home/runner/.cache/ctlearn/tutorial-training/keras-cameradirection/ctlearn_model.keras.
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/ctapipe/core/provenance.py:286: MissingReferenceMetadata: Could not read reference metadata for input file: /opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/ctlearn/resources/LST-1_SubarrayDescription.h5
warnings.warn(
2026-11-20 15:49:45,018 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.setup): SubarrayDescription was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.keras.ctlearn.dl2.h5'
2026-11-20 15:49:45,219 DEBUG [ctlearn.ctlearn-predict-LST1] (tool.run): CONFIG: {'LST1PredictionTool': {'batch_size': 5, 'channels': ['cleaned_image', 'cleaned_relative_peak_time'], 'config_files': [PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')], 'dl1_features': False, 'dl2_subarray': True, 'dl2_telescope': False, 'focal_length_choice': <FocalLengthKind.EFFECTIVE: 1>, 'image_mapper_type': 'BilinearMapper', 'input_url': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.dl1.h5'), 'load_cameradirection_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/keras-cameradirection/ctlearn_model.keras'), 'load_energy_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/keras-energy/ctlearn_model.keras'), 'load_type_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/keras-classification/ctlearn_model.keras'), 'log_config': {}, 'log_datefmt': '%Y-%m-%d %H:%M:%S', 'log_file': None, 'log_file_level': 'INFO', 'log_format': '[%(name)s]%(highlevel)s %(message)s', 'log_level': 10, 'logging_config': {}, 'output_path': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.keras.ctlearn.dl2.h5'), 'override_obs_id': None, 'overwrite': True, 'prefixes': {'type': 'CTLearnClassifier', 'energy': 'CTLearnRegressor', 'cameradirection': 'CTLearnCameraReconstructor', 'all': 'CTLearn'}, 'provenance_log': PosixPath('/home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-LST1.provenance.log'), 'quiet': False, 'show_config': False, 'show_config_json': False, 'TableQualityQuery': {'passed_all_column_name': 'PASSED_ALL', 'quality_criteria': []}, 'BilinearMapper': {'interpolation_image_shape': None}}}
2026-11-20 15:49:45,227 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.keras.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_001'
2026-11-20 15:49:45,230 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): DL1 telescope trigger table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.keras.ctlearn.dl2.h5' under '/dl1/event/telescope/trigger'
2026-11-20 15:49:45,233 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): DL1 subarray trigger table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.keras.ctlearn.dl2.h5' under '/dl1/event/subarray/trigger'
2026-11-20 15:49:45,238 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): DL1 parameters table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.keras.ctlearn.dl2.h5' under '/dl1/event/telescope/parameters/tel_001'
2026-11-20 15:49:45,239 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): Starting the prediction...
2026-11-20 15:49:45,239 DEBUG [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): Processing chunk from '0' to '4'.
WARNING:tensorflow:5 out of the last 5 calls to <function TensorFlowTrainer.make_predict_function.<locals>.one_step_on_data_distributed at 0x7f36316b14e0> triggered tf.function retracing. Tracing is expensive and the excessive number of tracings could be due to (1) creating @tf.function repeatedly in a loop, (2) passing tensors with different shapes, (3) passing Python objects instead of tensors. For (1), please define your @tf.function outside of the loop. For (2), @tf.function has reduce_retracing=True option that can avoid unnecessary retracing. For (3), please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
WARNING:tensorflow:6 out of the last 6 calls to <function TensorFlowTrainer.make_predict_function.<locals>.one_step_on_data_distributed at 0x7f36316b1f80> triggered tf.function retracing. Tracing is expensive and the excessive number of tracings could be due to (1) creating @tf.function repeatedly in a loop, (2) passing tensors with different shapes, (3) passing Python objects instead of tensors. For (1), please define your @tf.function outside of the loop. For (2), @tf.function has reduce_retracing=True option that can avoid unnecessary retracing. For (3), please refer to https://www.tensorflow.org/guide/function#controlling_retracing and https://www.tensorflow.org/api_docs/python/tf/function for more details.
2026-11-20 15:49:47,045 DEBUG [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): Processing chunk from '5' to '9'.
2026-11-20 15:49:47,569 DEBUG [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): Processing chunk from '10' to '14'.
2026-11-20 15:49:48,086 DEBUG [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): Processing chunk from '15' to '19'.
2026-11-20 15:49:48,616 DEBUG [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): Processing chunk from '20' to '24'.
2026-11-20 15:49:49,137 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.keras.ctlearn.dl2.h5' under '/dl2/event/subarray/particle_type/CTLearnClassifier'
2026-11-20 15:49:49,141 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.keras.ctlearn.dl2.h5' under '/dl2/event/subarray/energy/CTLearnRegressor'
2026-11-20 15:49:49,156 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.keras.ctlearn.dl2.h5' under '/dl2/event/subarray/geometry/CTLearnCameraReconstructor'
2026-11-20 15:49:49,156 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.finish): Tool is shutting down
2026-11-20 15:49:49,157 INFO [ctlearn.ctlearn-predict-LST1] (tool.write_provenance): Output:
2026-11-20 15:49:49,157 DEBUG [ctlearn.ctlearn-predict-LST1] (tool.write_provenance): PROVENANCE: 'Details about provenance is found in /home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-LST1.provenance.log'
2026-11-20 15:49:49,158 INFO [ctlearn.ctlearn-predict-LST1] (tool.run): Finished ctlearn-predict-LST1
2026-11-20 15:49:49,158 DEBUG [ctlearn.ctlearn-predict-LST1] (application.exit): Exiting application: ctlearn-predict-LST1
2. PyTorch model prediction using LST-1 lstchain mock data#
run_command_line(
"""ctlearn-predict-LST1 --verbose \\
--input_url "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/mock_data_lst1.dl1.h5" \\
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/mock_data_lst1.pytorch.ctlearn.dl2.h5" \\
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \\
--type_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-classification/ctlearn_model.pth" \\
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-energy/ctlearn_model.pth" \\
--cameradirection_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-cameradirection/ctlearn_model.pth" \\
--LST1PredictionTool.batch_size 5 \\
--LST1PredictionTool.channels cleaned_image \\
--LST1PredictionTool.channels cleaned_relative_peak_time \\
--LST1PredictionTool.image_mapper_type BilinearMapper \\
--TableQualityQuery.quality_criteria "[]" \\
--overwrite"""
)
Running command: $ ctlearn-predict-LST1 --verbose \
--input_url "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/mock_data_lst1.dl1.h5" \
--output "$CTLEARN_TUTORIAL_OUTPUT_DIR/predictions/mock_data_lst1.pytorch.ctlearn.dl2.h5" \
--config "$CTLEARN_TUTORIAL_CONFIG_DIR/dl1dh_example_config.json" \
--type_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-classification/ctlearn_model.pth" \
--energy_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-energy/ctlearn_model.pth" \
--cameradirection_model "$CTLEARN_TUTORIAL_OUTPUT_DIR/pytorch-cameradirection/ctlearn_model.pth" \
--LST1PredictionTool.batch_size 5 \
--LST1PredictionTool.channels cleaned_image \
--LST1PredictionTool.channels cleaned_relative_peak_time \
--LST1PredictionTool.image_mapper_type BilinearMapper \
--TableQualityQuery.quality_criteria "[]" \
--overwrite
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189793.116553 6836 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
I0000 00:00:1795189793.153706 6836 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 AVX512_FP16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 AMX_FP16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1795189793.959913 6836 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2026-11-20 15:49:54,624 INFO [ctlearn.ctlearn-predict-LST1] (tool.initialize): Loading config from '[PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')]'
2026-11-20 15:49:54,624 DEBUG [ctlearn.ctlearn-predict-LST1] (application._load_config_files): Looking for /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config in /home/runner/work/ctlearn/ctlearn/examples/tutorials
2026-11-20 15:49:54,624 DEBUG [ctlearn.ctlearn-predict-LST1] (application._load_config_files): Loaded config file: /home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json
2026-11-20 15:49:54,625 INFO [ctlearn.ctlearn-predict-LST1] (tool.initialize): ctapipe version 0.33.0
2026-11-20 15:49:54,625 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.setup): ctlearn version 0.11.2.dev2+g312165f28
2026-11-20 15:49:54,626 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.setup): Framework selected: PyTorch
2026-11-20 15:49:54,626 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.setup): Using PyTorch CPU device.
2026-11-20 15:49:54,626 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1._load_model): Loading the model from /home/runner/.cache/ctlearn/tutorial-training/pytorch-classification/ctlearn_model.pth.
2026-11-20 15:49:54,646 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1._load_model): Loading the model from /home/runner/.cache/ctlearn/tutorial-training/pytorch-energy/ctlearn_model.pth.
2026-11-20 15:49:54,663 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1._load_model): Loading the model from /home/runner/.cache/ctlearn/tutorial-training/pytorch-cameradirection/ctlearn_model.pth.
/opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/ctapipe/core/provenance.py:286: MissingReferenceMetadata: Could not read reference metadata for input file: /opt/hostedtoolcache/Python/3.12.16/x64/lib/python3.12/site-packages/ctlearn/resources/LST-1_SubarrayDescription.h5
warnings.warn(
2026-11-20 15:49:54,710 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.setup): SubarrayDescription was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.pytorch.ctlearn.dl2.h5'
2026-11-20 15:49:54,904 DEBUG [ctlearn.ctlearn-predict-LST1] (tool.run): CONFIG: {'LST1PredictionTool': {'batch_size': 5, 'channels': ['cleaned_image', 'cleaned_relative_peak_time'], 'config_files': [PosixPath('/home/runner/work/ctlearn/ctlearn/docs/source/config/dl1dh_example_config.json')], 'dl1_features': False, 'dl2_subarray': True, 'dl2_telescope': False, 'focal_length_choice': <FocalLengthKind.EFFECTIVE: 1>, 'image_mapper_type': 'BilinearMapper', 'input_url': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.dl1.h5'), 'load_cameradirection_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/pytorch-cameradirection/ctlearn_model.pth'), 'load_energy_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/pytorch-energy/ctlearn_model.pth'), 'load_type_model_from': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/pytorch-classification/ctlearn_model.pth'), 'log_config': {}, 'log_datefmt': '%Y-%m-%d %H:%M:%S', 'log_file': None, 'log_file_level': 'INFO', 'log_format': '[%(name)s]%(highlevel)s %(message)s', 'log_level': 10, 'logging_config': {}, 'output_path': PosixPath('/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.pytorch.ctlearn.dl2.h5'), 'override_obs_id': None, 'overwrite': True, 'prefixes': {'type': 'CTLearnClassifier', 'energy': 'CTLearnRegressor', 'cameradirection': 'CTLearnCameraReconstructor', 'all': 'CTLearn'}, 'provenance_log': PosixPath('/home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-LST1.provenance.log'), 'quiet': False, 'show_config': False, 'show_config_json': False, 'TableQualityQuery': {'passed_all_column_name': 'PASSED_ALL', 'quality_criteria': []}, 'BilinearMapper': {'interpolation_image_shape': None}}}
2026-11-20 15:49:54,912 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): DL1 telescope pointing table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.pytorch.ctlearn.dl2.h5' under '/dl1/monitoring/telescope/pointing/tel_001'
2026-11-20 15:49:54,916 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): DL1 telescope trigger table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.pytorch.ctlearn.dl2.h5' under '/dl1/event/telescope/trigger'
2026-11-20 15:49:54,918 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): DL1 subarray trigger table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.pytorch.ctlearn.dl2.h5' under '/dl1/event/subarray/trigger'
2026-11-20 15:49:54,923 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): DL1 parameters table was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.pytorch.ctlearn.dl2.h5' under '/dl1/event/telescope/parameters/tel_001'
2026-11-20 15:49:54,924 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): Starting the prediction...
2026-11-20 15:49:54,924 DEBUG [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): Processing chunk from '0' to '4'.
2026-11-20 15:49:55,876 DEBUG [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): Processing chunk from '5' to '9'.
2026-11-20 15:49:56,800 DEBUG [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): Processing chunk from '10' to '14'.
2026-11-20 15:49:57,788 DEBUG [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): Processing chunk from '15' to '19'.
2026-11-20 15:49:58,727 DEBUG [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): Processing chunk from '20' to '24'.
2026-11-20 15:49:59,665 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.pytorch.ctlearn.dl2.h5' under '/dl2/event/subarray/particle_type/CTLearnClassifier'
2026-11-20 15:49:59,669 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.pytorch.ctlearn.dl2.h5' under '/dl2/event/subarray/energy/CTLearnRegressor'
2026-11-20 15:49:59,683 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.start): DL2 prediction data was stored in '/home/runner/.cache/ctlearn/tutorial-training/predictions/mock_data_lst1.pytorch.ctlearn.dl2.h5' under '/dl2/event/subarray/geometry/CTLearnCameraReconstructor'
2026-11-20 15:49:59,683 INFO [ctlearn.ctlearn-predict-LST1] (predict_LST1.finish): Tool is shutting down
2026-11-20 15:49:59,684 INFO [ctlearn.ctlearn-predict-LST1] (tool.write_provenance): Output:
2026-11-20 15:49:59,684 DEBUG [ctlearn.ctlearn-predict-LST1] (tool.write_provenance): PROVENANCE: 'Details about provenance is found in /home/runner/work/ctlearn/ctlearn/examples/tutorials/ctlearn-predict-LST1.provenance.log'
2026-11-20 15:49:59,685 INFO [ctlearn.ctlearn-predict-LST1] (tool.run): Finished ctlearn-predict-LST1
2026-11-20 15:49:59,685 DEBUG [ctlearn.ctlearn-predict-LST1] (application.exit): Exiting application: ctlearn-predict-LST1
Total running time of the script: (3 minutes 34.802 seconds)