Skip to content

Commit

Permalink
Add test to read fhd_source_array.sav files
Browse files Browse the repository at this point in the history
  • Loading branch information
dstorer authored and bhazelton committed Dec 14, 2023
1 parent 79e6900 commit ef6a407
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions tests/test_skymodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2945,16 +2945,20 @@ def test_read_votable_errors():


def test_fhd_catalog_reader():
catfile = os.path.join(SKY_DATA_PATH, "fhd_catalog.sav")
for fname in ["catalog", "source_array"]:
catfile = os.path.join(SKY_DATA_PATH, f"fhd_{fname}.sav")

with uvtest.check_warnings(
UserWarning, match="Source IDs are not unique. Defining unique IDs."
):
skyobj = SkyModel.from_fhd_catalog(catfile, expand_extended=False)
if fname == "catalog":
with uvtest.check_warnings(
UserWarning, match="Source IDs are not unique. Defining unique IDs."
):
skyobj = SkyModel.from_fhd_catalog(catfile, expand_extended=False)
else:
skyobj = SkyModel.from_fhd_catalog(catfile, expand_extended=False)

assert skyobj.filename == ["fhd_catalog.sav"]
catalog = scipy.io.readsav(catfile)["catalog"]
assert skyobj.Ncomponents == len(catalog)
assert skyobj.filename == [f"fhd_{fname}.sav"]
catalog = scipy.io.readsav(catfile)[fname]
assert skyobj.Ncomponents == len(catalog)


@pytest.mark.parametrize("extended", [True, False])
Expand Down

0 comments on commit ef6a407

Please sign in to comment.