diff --git a/flint/data/tests/SB39400.RACS_0635-31.beam0-MFS-subimage_rms.fits b/flint/data/tests/SB39400.RACS_0635-31.beam0-MFS-subimage_rms.fits new file mode 100644 index 00000000..adb8c363 Binary files /dev/null and b/flint/data/tests/SB39400.RACS_0635-31.beam0-MFS-subimage_rms.fits differ diff --git a/tests/test_ms.py b/tests/test_ms.py new file mode 100644 index 00000000..1ed847e5 --- /dev/null +++ b/tests/test_ms.py @@ -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 diff --git a/tests/test_validation.py b/tests/test_validation.py new file mode 100644 index 00000000..4e521222 --- /dev/null +++ b/tests/test_validation.py @@ -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)