nectarchain.data.container.gain_container.GainContainer#

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

Bases: NectarCAMContainer

Class representing a GainContainer.

This class is a subclass of NectarCAMContainer and provides additional fields and methods specific to gain calibration data.

Attributes:

is_valid (np.ndarray): Array of booleans indicating the validity of each gain value. high_gain (np.ndarray): Array of high gain values. low_gain (np.ndarray): Array of low gain values. pixels_id (np.ndarray): Array of pixel IDs.

Methods:
from_hdf5(cls, path): Class method to read a GainContainer from an HDF5 file.
Parameters:

path (str or Path): The path to the HDF5 file.

Yields:

GainContainer: The container from the data in the HDF5 file.

Attributes:
is_validField(default=None, dtype=bool, ndim=1, type=ndarray)

is_valid

high_gainField(default=None, dtype=float64, ndim=2, type=ndarray)

high gain

low_gainField(default=None, dtype=float64, ndim=2, type=ndarray)

low gain

pixels_idField(default=None, dtype=uint16, ndim=1, type=ndarray)

pixel ids

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

Class method to read a GainContainer 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

is_valid

high_gain

low_gain

pixels_id

meta

prefix

default_prefix

fields

classmethod from_hdf5(path)[source]#

Class method to read a GainContainer from an HDF5 file.

Args:

path (str or Path): The path to the HDF5 file.

Yields:

GainContainer: The container from the data in the HDF5 file.