-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tgalvin
committed
Jan 13, 2024
1 parent
6908086
commit 9a46524
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |