diff --git a/pyuvdata/uvcal/tests/test_calh5.py b/pyuvdata/uvcal/tests/test_calh5.py index a17a24f40d..1acf234346 100644 --- a/pyuvdata/uvcal/tests/test_calh5.py +++ b/pyuvdata/uvcal/tests/test_calh5.py @@ -11,9 +11,11 @@ import pyuvdata.tests as uvtest from pyuvdata import UVCal +from pyuvdata.data import DATA_PATH from pyuvdata.uvcal import FastCalH5Meta from pyuvdata.uvcal.tests import extend_jones_axis, time_array_to_time_range from pyuvdata.uvcal.uvcal import _future_array_shapes_warning +from pyuvdata.uvdata import FastUVH5Meta @pytest.mark.filterwarnings("ignore:" + _future_array_shapes_warning) @@ -114,6 +116,18 @@ def test_calh5_meta(gain_data, tmp_path): calobj.write_calh5(write_file, clobber=True) cal_meta = FastCalH5Meta(write_file) + cal_meta2 = FastCalH5Meta(write_file) + assert cal_meta == cal_meta2 + + write_file2 = str(tmp_path / "outtest2.calh5") + calobj.write_calh5(write_file, clobber=True) + + cal_meta2 = FastCalH5Meta(write_file2) + assert cal_meta != cal_meta2 + + uvh5_meta = FastUVH5Meta(os.path.join(DATA_PATH, "zen.2458432.34569.uvh5")) + assert cal_meta != uvh5_meta + ant_nums = cal_meta.antenna_numbers jpol_nums = cal_meta.jones_array jpol_names = cal_meta.pols diff --git a/pyuvdata/uvdata/uvh5.py b/pyuvdata/uvdata/uvh5.py index a8fd89ad6e..86f99acb70 100644 --- a/pyuvdata/uvdata/uvh5.py +++ b/pyuvdata/uvdata/uvh5.py @@ -394,27 +394,6 @@ def channel_width(self) -> float: else: return float(h["channel_width"][()]) - @cached_property - def extra_keywords(self) -> dict: - """The extra_keywords from the file.""" - header = self.header - if "extra_keywords" not in header: - return {} - - extra_keywords = {} - for key in header["extra_keywords"].keys(): - if header["extra_keywords"][key].dtype.type in (np.string_, np.object_): - extra_keywords[key] = bytes(header["extra_keywords"][key][()]).decode( - "utf8" - ) - else: - # special handling for empty datasets == python `None` type - if header["extra_keywords"][key].shape is None: - extra_keywords[key] = None - else: - extra_keywords[key] = header["extra_keywords"][key][()] - return extra_keywords - @cached_property def unique_antpair_1_array(self) -> np.ndarray: """The unique antenna 1 indices in the file."""