ctapipe is not stable yet, so expect large and rapid changes to structure and functionality as we explore various design choices before the 1.0 release.

DispReconstructor#

class ctapipe.reco.DispReconstructor(**kwargs: Any)[source]#

Bases: Reconstructor

Predict absolute value and sign for disp origin reconstruction and convert to altitude and azimuth prediction for each telescope.

Attributes Summary

features

Features to use for both models.

instrument_table

load_path

If given, load serialized model from this path.

log_target

If True, the norm(disp) model is trained to predict ln(norm(disp)) and the output is prefix_parameter = sign_prediction * exp(norm_prediction).

norm_cls

Which scikit-learn regression model to use.

norm_config

kwargs for the sklearn regressor.

prefix

Prefix for the output of this model.

sign_cls

Which scikit-learn classification model to use.

sign_config

kwargs for the sklearn classifier.

stereo_combiner_cls

Which stereo combination method to use.

target

Methods Summary

__call__(event)

Event-wise prediction for the EventSource-Loop.

fit(key, table)

Create and fit new models for key using the data in table.

predict_table(key, table)

Predict on a table of events.

read(path, **kwargs)

Read a joblib-pickled reconstructor from path

write(path[, overwrite])

Attributes Documentation

features#

Features to use for both models.

instrument_table#
load_path#

If given, load serialized model from this path.

log_target#

If True, the norm(disp) model is trained to predict ln(norm(disp)) and the output is prefix_parameter = sign_prediction * exp(norm_prediction).

norm_cls#

Which scikit-learn regression model to use.

norm_config#

kwargs for the sklearn regressor.

prefix#

Prefix for the output of this model. If None, disp is used.

sign_cls#

Which scikit-learn classification model to use.

sign_config#

kwargs for the sklearn classifier.

stereo_combiner_cls#

Which stereo combination method to use.. Possible values: []

target = 'true_disp'#

Methods Documentation

__call__(event: ArrayEventContainer) None[source]#

Event-wise prediction for the EventSource-Loop.

Fills the event.dl2.tel[tel_id].disp[prefix] container and event.dl2.tel[tel_id].geometry[prefix] container.

Parameters:
event: ArrayEventContainer
fit(key, table)[source]#

Create and fit new models for key using the data in table.

predict_table(key, table: Table) dict[ReconstructionProperty, Table][source]#

Predict on a table of events.

Parameters:
tableTable

Table of features

Returns:
disp_tableTable

Table with disp predictions, matches the corresponding container definition

altaz_tableTable

Table with resulting predictions of horizontal coordinates

classmethod read(path, **kwargs)[source]#

Read a joblib-pickled reconstructor from path

Parameters:
pathstr or pathlib.Path

Path to a Reconstructor instance pickled using joblib

parentNone or Component or Tool

Attach a new parent to the loaded class, this will properly

subarraySubarrayDescription

Attach a new subarray to the loaded reconstructor A warning will be raised if the telescope types of the subarray stored in the pickled class do not match with the provided subarray.

**kwargs are set on the loaded instance
Returns:
Reconstructor instance loaded from file
write(path, overwrite=False)[source]#