PSpecContainer
Class¶
PSpecContainer
is a container for organizing collections of UVPSpec
objects. It is based on HDF5.
-
class
hera_pspec.
PSpecContainer
(filename, mode='r', keep_open=True, swmr=False, tsleep=0.1, maxiter=1)[source]¶ Container class for managing multiple UVPSpec objects.
-
get_pspec
(group, psname=None, **kwargs)[source]¶ Get a UVPSpec power spectrum object from a given group.
Parameters: - group (str) – Which group the power spectrum belongs to.
- psname (str, optional) – The name of the power spectrum to return. If None, extract all available power spectra.
- kwargs (dict) – UVPSpec.read_from_group partial IO keyword arguments
Returns: uvp – The specified power spectrum as a UVPSpec object (or a list of all power spectra in the group, if psname was not specified).
Return type: UVPSpec or list of UVPSpec
-
groups
()[source]¶ Return list of groups in the container.
Returns: group_list – List of group names. Return type: list of str
-
set_pspec
(group, psname, pspec, overwrite=False)[source]¶ Store a delay power spectrum in the container.
Parameters: - group (str) – Which group the power spectrum belongs to.
- psname (str or list of str) – The name(s) of the power spectrum to return from within the group.
- pspec (UVPSpec or list of UVPSpec) – Power spectrum object(s) to store in the container.
- overwrite (bool, optional) – If the power spectrum already exists in the file, whether it should overwrite it or raise an error. Default: False (does not overwrite).
-