Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uvh5 reader to check for phase_center_catalog not multi_phase_center #1225

Merged
merged 2 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Fixed
- A bug in `UVData.read_uvh5` where `multi_phase_center` was being used to imply the
existence of the `phase_center_catalog` header item, rather than checking for the
presence of that item. This conflicted with the uvh5 memo.

## [2.2.10] - 2022-10-20

### Added
Expand Down
10 changes: 4 additions & 6 deletions pyuvdata/uvdata/uvh5.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,13 @@ def _read_header(
self.flex_spw_id_array = header["flex_spw_id_array"][:]
if "flex_spw_polarization_array" in header:
self.flex_spw_polarization_array = header["flex_spw_polarization_array"][:]
if "multi_phase_center" in header:
if bool(header["multi_phase_center"][()]):
self._set_phased()
self._set_multi_phase_center(preserve_phase_center_info=False)

# Here is where we start handing phase center information. If we have a
# multi phase center dataset, we need to get different header items
if self.multi_phase_center:
if "phase_center_catalog" in header:
self._set_phased()
self._set_multi_phase_center(preserve_phase_center_info=False)

self.Nphase = int(header["Nphase"][()])
self.phase_center_id_array = header["phase_center_id_array"][:]

Expand Down Expand Up @@ -1133,7 +1132,6 @@ def _write_header(self, header):
header["ant_2_array"] = self.ant_2_array
header["antenna_positions"] = self.antenna_positions
header["flex_spw"] = self.flex_spw
header["multi_phase_center"] = self.multi_phase_center
# handle antenna_names; works for lists or arrays
header["antenna_names"] = np.asarray(self.antenna_names, dtype="bytes")

Expand Down