nectarchain.data.container.gain_container.GainContainer#
- class GainContainer(prefix=None, **fields)[source]#
Bases:
NectarCAMContainerClass 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_dictConvert the
Containerinto a dictionaryClass method to read a GainContainer 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
is_validhigh_gainlow_gainpixels_idmetaprefixdefault_prefixfields