FeatureGenerator

class ctapipe.core.FeatureGenerator(**kwargs: Any)[source]

Bases: ctapipe.core.component.Component

Generate features for astropy.table.Table.

Raises Exceptions in two cases: 1. If a feature already exists in the table 2. If a feature cannot be built with the given expression

Attributes Summary

features

List of 2-Tuples of Strings: (‘new_feature_name’, ‘expression to generate feature’).

Methods Summary

__call__(table, **kwargs)

Apply feature generation to the input table.

Attributes Documentation

features

List of 2-Tuples of Strings: (‘new_feature_name’, ‘expression to generate feature’). You can use numpy as np and astropy.units as u. Several math functions are usable without the np-prefix. Use feature.quantity.to_value(unit) to create features without units.

Methods Documentation

__call__(table, **kwargs)[source]

Apply feature generation to the input table.

This method returns a shallow copy of the input table with the new features added. Existing columns will share the underlying data, however the new columns won’t be visible in the input table.