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

^ uvh5 addition #1511

Merged
Merged
Show file tree
Hide file tree
Changes from 4 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
Binary file not shown.
Binary file not shown.
4 changes: 3 additions & 1 deletion src/pyuvdata/uvdata/uvdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,9 @@ def _consolidate_phase_center_catalogs(
# match, so this is functionally the same source
self._update_phase_center_id(match_id, new_id=cat_id)
# look_in_catalog ignores the "info_source" field, so update it to match
self.phase_center_catalog[cat_id]["info_source"] = cat_entry["info_source"]
info_source = cat_entry.get("info_source")
if info_source is not None:
self.phase_center_catalog[cat_id]["info_source"] = info_source
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change this to:
self.phase_center_catalog[cat_id]["info_source"] = cat_entry.get("info_source")
Realizing this is pretty minor, although the plan for the phase dict is to become an actual object, where these will become optional attributes (which always exist as attributes on the object, but are filled in w/ None when not set), and this will basically make the code easier to migrate.

if ignore_name:
# Make the names match if names were ignored in matching
self.phase_center_catalog[cat_id]["cat_name"] = cat_entry["cat_name"]
Expand Down
17 changes: 17 additions & 0 deletions tests/uvdata/test_uvh5.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,23 @@ def test_uvh5_optional_parameters(casa_uvfits, tmp_path):
return


def test_uvh5_addition():
inputfiles = [
os.path.join(
DATA_PATH, f"ata.LoA.C0{subband}.uvh5_60647_62965_9760406_3c286_0001.uvh5"
)
for subband in ["352", "544"]
]

# write out and read back in
uv1, uv2 = UVData(), UVData()
uv1.read(inputfiles[0])
uv2.read(inputfiles[1])

uv1 + uv2
return


@pytest.mark.filterwarnings("ignore:The uvw_array does not match the expected values")
def test_uvh5_compression_options(casa_uvfits, tmp_path):
"""
Expand Down
Loading