Skip to content

Commit

Permalink
added some tests and data
Browse files Browse the repository at this point in the history
  • Loading branch information
tgalvin committed Jan 13, 2024
1 parent 6908086 commit 9a46524
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
Binary file not shown.
13 changes: 13 additions & 0 deletions tests/test_ms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Small tests for items related to measurement sets
and the MS class
"""
from pathlib import Path

from flint.ms import MS


def test_ms_self_attribute():
ex = Path("example/jack_sparrow.ms")
ms = MS(path=ex)

assert ms.ms.path == ex
33 changes: 33 additions & 0 deletions tests/test_validation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""Items related to test functions in the validation stage of flint
"""
import pytest
from pathlib import Path

import pkg_resources
import numpy as np

from flint.validation import RMSImageInfo, get_rms_image_info


@pytest.fixture
def rms_path(tmpdir):
rms_path = Path(
pkg_resources.resource_filename(
"flint", "data/tests/SB39400.RACS_0635-31.beam0-MFS-subimage_rms.fits"
)
)

return rms_path


def test_rms_image_info(rms_path):
rms_info = get_rms_image_info(rms_path=rms_path)

assert isinstance(rms_info, RMSImageInfo)
assert rms_info.path == rms_path
assert rms_info.no_valid_pixels == 150
assert rms_info.shape == (10, 15)
assert np.isclose(0.0001515522, rms_info.median)
assert np.isclose(0.00015135764, rms_info.minimum)
assert np.isclose(0.0001518184, rms_info.maximum)
assert np.isclose(1.1098655e-07, rms_info.std)

0 comments on commit 9a46524

Please sign in to comment.