nectarchain.data.container.core.NectarCAMContainer#

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

Bases: Container

Base 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_dict

Convert the Container into a dictionary

from_hdf5

Reads a container from an HDF5 file.

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

Check that all fields in the Container have the expected characteristics (as defined by the Field metadata).

values

Get the keys of the container

Attributes

meta

prefix

default_prefix

fields

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’)