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 committed Jun 13, 2023
1 parent e5f808f commit 7aed6ae
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions pyradiosky/tests/test_skymodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2689,16 +2689,20 @@ def test_read_votable_errors():


def test_fhd_catalog_reader():
catfile = os.path.join(SKY_DATA_PATH, "fhd_catalog.sav")

with uvtest.check_warnings(
UserWarning, match="Source IDs are not unique. Defining unique IDs."
):
skyobj = SkyModel.from_fhd_catalog(catfile, expand_extended=False)
for fname in ["catalog", "source_array"]:
catfile = os.path.join(SKY_DATA_PATH, f"fhd_{fname}.sav")

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)


def test_fhd_catalog_reader_extended_sources():
Expand Down

0 comments on commit 7aed6ae

Please sign in to comment.