nectarchain.data.container.core.TriggerMapContainer#

class TriggerMapContainer(prefix=None, **fields)[source]#

Bases: Container

Class representing a TriggerMapContainer.

This class inherits from the Container class and is used to store trigger mappings of containers.

Attributes:

containers (Field): A field representing the trigger mapping of containers.

Methods:

is_empty(): Checks if the TriggerMapContainer is empty. validate(): Validates the TriggerMapContainer by checking if all the containers mapped are filled by correct type.

Example:
>>> container = TriggerMapContainer()
>>> container.is_empty()
True
>>> container.validate()
None
Attributes:
containersField(default=Map(ctapipe.core.container.Container))

trigger mapping of Container

metadict

dict of attached metadata

prefixstr

Prefix attached to column names when saved to a table or file

Methods

as_dict

Convert the Container into a dictionary

from_hdf5

Reads a container from an HDF5 file.

is_empty

This method check if the container is empty.

items

Generator over (key, value) pairs for the items

keys

Get the keys of the container

reset

Reset all values back to their default values

update

update more than one parameter at once (e.g. update(x=3,y=4) or update(**dict_of_values)).

validate

Apply the validate method recursively to all the containers that are mapped within the TriggerMapContainer.

values

Get the keys of the container

Attributes

containers

meta

prefix

default_prefix

fields

classmethod from_hdf5(path, slice_index=None, index_component=0)[source]#

Reads a container from an HDF5 file.

Parameters: path (str or Path): The path to the HDF5 file. slice_index (int, optional): The index of the slice of data within the hdf5 file to read. Default is None.This method will call the _container_from_hdf5 method with the container argument associated to its own class (ArrayDataContainer)

Yields: Container: The container generator linked to the HDF5 file.

Example: >>> container = ArrayDataContainer.from_hdf5(‘path_to_file.h5’)

is_empty()[source]#

This method check if the container is empty.

Returns:

bool: True if the container is empty, False otherwise.

validate()[source]#

Apply the validate method recursively to all the containers that are mapped within the TriggerMapContainer.

Raises:

FieldValidationError: if one container is not valid.