nectarchain.data.container.core.TriggerMapContainer#
- class TriggerMapContainer(prefix=None, **fields)[source]#
Bases:
ContainerClass representing a TriggerMapContainer.
This class inherits from the
Containerclass 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_dictConvert the
Containerinto a dictionaryReads a container from an HDF5 file.
This method check if the container is empty.
itemsGenerator over (key, value) pairs for the items
keysGet the keys of the container
resetReset all values back to their default values
updateupdate more than one parameter at once (e.g.
update(x=3,y=4)orupdate(**dict_of_values)).Apply the validate method recursively to all the containers that are mapped within the TriggerMapContainer.
valuesGet the keys of the container
Attributes
containersmetaprefixdefault_prefixfields- 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’)