class pyuvdata.uvdata.FastUVH5Meta(path: str | pathlib.Path | h5py._hl.files.File |, blt_order: Optional[Union[tuple[str], Literal['determine']]] = None, blts_are_rectangular: Optional[bool] = None, time_axis_faster_than_bls: Optional[bool] = None, recompute_nbls: Optional[bool] = None)[source]

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

This class is just a really thin wrapper over a UVH5 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. However, some attributes are made faster than the default, by assumptions on the data shape – in particular, times and baselines.

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

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

  • blt_order (tuple of str or “determine”, optional) – The order of the baseline-time axis. This can be determined, or read directly from file, however since it has been optional in the past, many existing files do not contain it in the metadata. Some reading operations are significantly faster if this is known, so providing it here can provide a speedup. Default is to try and read it from file, and if not there, just leave it as None. Set to “determine” to auto-detect the blt_order from the metadata (takes extra time to do so).

  • blts_are_rectangular (bool, optional) – Whether the baseline-time axis is rectangular. This can be read from metadata in new files, but many old files do not contain it. If not provided, the rectangularity will be determined from the data. This is a non-negligible operation, so if you know it, it can be provided here to speed up reading.

  • time_axis_faster_than_bls (bool, optional) – If blts are rectangular, this variable specifies whether the time axis is the fastest-moving virtual axis. Various reading functions benefit from knowing this, so if it is known, it can be provided here to speed up reading. It will be determined from the data if not provided.

  • recompute_nbls (bool, optional) – Whether to recompute the number of unique baselines from the data. Before v1.2 of the UVH5 spec, it was possible to have an incorrect number of baselines in the header without error, so this provides an opportunity to rectify it. Old HERA files (< March 2023) may have this issue, but in this case the correct number of baselines can be computed more quickly than by fully re=computing, and so we do this.


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.

is_open() bool[source]

Whether the file is open.


Close the file.


Open the file.

property header: Group

Get the header group.

property datagrp: Group

Get the header group.

get_transactional(item: str, cache: bool = True) Any[source]

Get an attribute from the metadata but close the file object afterwards.

Using this method is safer than direct attribute access when dealing with many files.

  • item – The attribute to get.

  • cache – Whether to cache the attribute in the object so that the next access is faster.

property Nbls: int

The number of unique baselines.

get_blt_order() tuple[str][source]

Get the blt order from analysing metadata.

property blt_order: tuple[str]

Tuple defining order of blts axis.

property blts_are_rectangular: bool

Whether blts axis is rectangular.

That is, this is true if the blts can be reshaped to (Ntimes, Nbls) OR (Nbls, Ntimes). This requires each baseline to have the same number of times associated, AND the blt ordering to either be (time, baseline) or (baseline,time).

property time_axis_faster_than_bls: bool

Whether times move first in the blt axis.

property phase_center_catalog: dict | None

Dictionary of phase centers.

property phase_type: str

The phase type of the data.

property phase_center_id_array

Array of phase center IDs.

property times: ndarray

The unique times in the file.

property lsts: ndarray

The unique LSTs in the file.

property lst_array: ndarray

The LSTs corresponding to each baseline-time.

property channel_width: float

The width of each frequency channel in Hz.

property extra_keywords: dict

The extra_keywords from the file.


Check that LSTs consistent with the time_array and telescope location.

property unique_antpair_1_array: ndarray

The unique antenna 1 indices in the file.

property unique_antpair_2_array: ndarray

The unique antenna 2 indices in the file.

property unique_ants: set

The unique antennas in the file.

property baseline_array: ndarray

The baselines in the file, as unique integers.

property unique_baseline_array: ndarray

The unique baselines in the file, as unique integers.

property antenna_names: list[str]

The antenna names in the file.

property antpairs: list[tuple[int, int]]

Get the unique antenna pairs in the file.

has_key(key: tuple[int, int] | tuple[int, int, str]) bool[source]

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

property pols: list[str]

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

property antpos_enu: ndarray

The antenna positions in ENU coordinates, in meters.

property telescope_location

The telescope location in ECEF coordinates, in meters.

property telescope_location_lat_lon_alt: tuple[float, float, float]

The telescope location in latitude, longitude, and altitude, in degrees.

property telescope_location_lat_lon_alt_degrees: tuple[float, float, float]

The telescope location in latitude, longitude, and altitude, in degrees.

property vis_units: str

The visibility units in the file, as a string.

to_uvdata(check_lsts: bool = False) UVData[source]

Convert the file to a UVData object.

The object will be metadata-only.