FastCalH5Meta

class pyuvdata.uvcal.FastCalH5Meta(path: str | Path | File | Group)[source]

A fast read-only interface to CalH5 file metadata that makes some assumptions.

This class is just a really thin wrapper over a CalH5 file that makes it easier to read in parts of the metadata at a time. This makes it much faster to perform small tasks where simple metadata is required, rather than reading in the whole header.

All metadata is available as attributes, through __getattr__ magic. Thus, accessing eg. obj.freq_array will go and get the frequencies directly from the file, and store them in memory.

Anything that is read in is stored in memory so the second access is much faster. However, the memory can be released simply by deleting the attribute (it can be accessed again, and the data will be re-read).

Parameters:

filename (str or Path) – The filename to read from.

Notes

To check if a particular attribute is available, use hasattr(obj, attr). Many attributes will not show up dynamically in an interpreter, because they are gotten dynamically from the file.

has_key(antnum: int | None = None, jpol: str | int | None = None) bool[source]

Check if the file has a given antenna number or antenna number-pol key.

property pols: list[str]

The polarizations in the file, as standardized strings, eg. ‘xx’ or ‘ee’.

to_uvcal(*, check_lsts: bool = False, astrometry_library: str | None = None) UVCal[source]

Convert the file to a UVData object.

The object will be metadata-only.