DispReconstructor

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

Bases: ctapipe.reco.reconstructor.Reconstructor

Predict absolute value and sign for disp origin reconstruction 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 model is trained to predict the natural logarithm of the absolute value.

norm_cls

Which scikit-learn regression model to use.

norm_config

kwargs for the sklearn regressor

prefix

A trait for unicode strings.

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 model is trained to predict the natural logarithm of the absolute value.

norm_cls

Which scikit-learn regression model to use.

norm_config

kwargs for the sklearn regressor

prefix

A trait for unicode strings.

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_norm'

Methods Documentation

__call__(event: ctapipe.containers.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: astropy.table.table.Table)Dict[ctapipe.reco.reconstructor.ReconstructionProperty, astropy.table.table.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]