Core Structures and Base Classes (core)#

Introduction#

The ctapipe.core module contains base classes the provide developers with the core functionality to implement an application that processes data.

Container provides a common data class, Component lets one define a module (worker, maker, etc.) for a particular algorithm along with its user-editable configuration parameters, and Tool defines a command-line application, complete with configuration file or command-line parameter processing, and logging setup. In the future this will also handle provenance metadata.

All ctapipe applications should derive from these classes in order to provide a common interface and to make use of the configuration system.

For details about creating command-line tools, see Command-line Tools (tools)

The following shows the conceptual difference between Tools and Components with overall pipelines and stages. Serialization and Deserialization are simply specialized Components that perform data access.

../../_images/tool-component.png

Reference/API#

ctapipe.core Package#

Core functionality of ctapipe

Functions#

non_abstract_children(base)

Return all non-abstract subclasses of a base class recursively.

get_module_version(name)

run_tool(tool[, argv, cwd, raises])

Utility run a certain tool in a python session without exiting.

Classes#

Component(**kwargs)

Base class of all Components.

TelescopeComponent(**kwargs)

A component that needs a SubarrayDescription to be constructed, and which contains configurable TelescopeParameter fields that must be configured on construction.

Container([prefix])

Generic class that can hold and accumulate data to be passed

Tool(**kwargs)

A base class for all executable tools (applications) that handles configuration loading/saving, logging, command-line processing, and provenance meta-data handling.

Field([default, description, unit, ucd, ...])

Class for storing data in a Container.

FeatureGenerator(**kwargs)

Generate features for astropy.table.Table.

DeprecatedField(default[, description, ...])

used to mark which fields may be removed in next version

Map

A dictionary of sub-containers that can be added to a Container.

Provenance(*args, **kw)

Manage the provenance info for a stack of activities

ToolConfigurationError(message)

QualityQuery(**kwargs)

Manages a set of user-configurable (at runtime or in a config file) selection criteria that operate on the same type of input.

QualityCriteriaError

Signal a problem with a user-defined selection criteria function

FieldValidationError

ctapipe.core.component Module#

Class to handle configuration for algorithms

Functions#

non_abstract_children(base)

Return all non-abstract subclasses of a base class recursively.

Classes#

Component(**kwargs)

Base class of all Components.

ctapipe.core.telescope_component Module#

This module defines classes to enable per-telescope configuration of trait values

Classes#

TelescopeComponent(**kwargs)

A component that needs a SubarrayDescription to be constructed, and which contains configurable TelescopeParameter fields that must be configured on construction.

TelescopeParameter(trait[, default_value])

Allow a parameter value to be specified as a simple value (of type dtype), or as a list of patterns that match different telescopes.

TelescopeParameterLookup(...)

TelescopePatternList(*args)

Representation for a list of telescope pattern tuples.

ctapipe.core.tool Module#

Classes to handle configurable command-line user interfaces.

Classes#

Tool(**kwargs)

A base class for all executable tools (applications) that handles configuration loading/saving, logging, command-line processing, and provenance meta-data handling.

ToolConfigurationError(message)

ctapipe.core.container Module#

Classes#

Container([prefix])

Generic class that can hold and accumulate data to be passed

Field([default, description, unit, ucd, ...])

Class for storing data in a Container.

FieldValidationError

Map

A dictionary of sub-containers that can be added to a Container.