nectarchain.data.container.core.NectarCAMContainer#
- class NectarCAMContainer(prefix=None, **fields)[source]#
Bases:
ContainerBase class for the NectarCAM containers.
This container cannot be recursive, to be directly written with a HDF5TableWriter.
- Attributes:
- 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.
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)).validateCheck that all fields in the Container have the expected characteristics (as defined by the Field metadata).
valuesGet the keys of the container
Attributes
metaprefixdefault_prefixfields- classmethod from_hdf5(path, index_component=0, group_name='data')[source]#
Reads a container from an HDF5 file.
Parameters: path (str or Path): The path to the HDF5 file.
- 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 = NectarCAMContainer.from_hdf5(‘path_to_file.h5’)