diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a9df9240..439f37e41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ All notable changes to this project will be documented in this file. - ATA has been added to the list of known telescopes. ### Fixed +- Bug in the `uvh5._add` method that expected keys which could be +optional for some phase-center catalog-entry types. This was noticed as an issue when +adding two uvh5 objects that were of type "sidereal" which did not have "info_source" +entries in their phase-center catalogs. - Bug in the `look_in_catalog` utility function that expected keys which could be optional for some phase-center catalog-entry types. This was noticed as an issue when adding two uvh5 objects that were of type "sidereal" which did not have "cat_times" diff --git a/src/pyuvdata/data/ata.LoA.C0352.uvh5_60647_62965_9760406_3c286_0001.uvh5 b/src/pyuvdata/data/ata.LoA.C0352.uvh5_60647_62965_9760406_3c286_0001.uvh5 new file mode 100644 index 000000000..2148dc7fd Binary files /dev/null and b/src/pyuvdata/data/ata.LoA.C0352.uvh5_60647_62965_9760406_3c286_0001.uvh5 differ diff --git a/src/pyuvdata/data/ata.LoA.C0544.uvh5_60647_62965_9760406_3c286_0001.uvh5 b/src/pyuvdata/data/ata.LoA.C0544.uvh5_60647_62965_9760406_3c286_0001.uvh5 new file mode 100644 index 000000000..ca2a9481b Binary files /dev/null and b/src/pyuvdata/data/ata.LoA.C0544.uvh5_60647_62965_9760406_3c286_0001.uvh5 differ diff --git a/src/pyuvdata/uvdata/uvdata.py b/src/pyuvdata/uvdata/uvdata.py index 266a5c1d5..13666c5f5 100644 --- a/src/pyuvdata/uvdata/uvdata.py +++ b/src/pyuvdata/uvdata/uvdata.py @@ -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"] + self.phase_center_catalog[cat_id]["info_source"] = cat_entry.get( + "info_source" + ) 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"] diff --git a/tests/uvdata/test_uvh5.py b/tests/uvdata/test_uvh5.py index d408de6f9..b3950080e 100644 --- a/tests/uvdata/test_uvh5.py +++ b/tests/uvdata/test_uvh5.py @@ -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): """