Core Structures and Base Classes (core)


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 modules (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.

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.



ctapipe.core Package

Core functionality of ctapipe



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


run_tool(tool[, argv, cwd])

Utility run a certain tool in a python session without exitinig


Component([config, parent])

Base class of all Components.

TelescopeComponent(subarray[, config, parent])

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


Generic class that can hold and accumulate data to be passed between Components.


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 Containers.

DeprecatedField(default[, description, …])

used to mark which fields may be removed in next version


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


Manage the provenance info for a stack of activities


QualityQuery([config, parent])

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


Signal a problem with a user-defined selection criteria function


Class Inheritance Diagram

Inheritance diagram of ctapipe.core.component.Component, ctapipe.core.component.TelescopeComponent, ctapipe.core.container.Container, ctapipe.core.tool.Tool, ctapipe.core.container.Field, ctapipe.core.container.DeprecatedField, ctapipe.core.container.Map, ctapipe.core.provenance.Provenance, ctapipe.core.tool.ToolConfigurationError, ctapipe.core.qualityquery.QualityQuery, ctapipe.core.qualityquery.QualityCriteriaError, ctapipe.core.container.FieldValidationError