1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
import shutil
import sys
import pytest
from utils import check_output, compare_rms_fits, validate_call
# Append current directory to system path in order to import testconfig
sys.path.append(".")
# Import configuration variables as test configuration (tcf)
import config_vars as tcf
class TestGridders:
def test_basic(self):
if "W-Towers" not in check_output([tcf.WSCLEAN, "--version"]).decode():
pytest.skip("WSClean was not compiled with W-Towers.")
wgridder = (
f"{tcf.WSCLEAN} -name wgridder_basic -gridder wgridder "
"-no-update-model-required "
"-mgain 0.95 -nmiter 1 -niter 6000 "
f"-size 2000 2000 -scale 1asec {tcf.LOFAR_3C196_MS}"
)
validate_call(wgridder.split())
wtowers = (
f"{tcf.WSCLEAN} -name wtower_basic -gridder wtowers "
"-no-update-model-required "
"-mgain 0.95 -nmiter 1 -niter 6000 "
f"-size 2000 2000 -scale 1asec {tcf.LOFAR_3C196_MS}"
)
validate_call(wtowers.split())
compare_rms_fits(
"wtower_basic-image.fits",
"wgridder_basic-image.fits",
threshold=1.0e-3,
)
def test_basic_facet_idg(self):
if "IDG" not in check_output([tcf.WSCLEAN, "--version"]).decode():
pytest.skip("WSClean was not compiled with IDG.")
wgridder = (
f"{tcf.WSCLEAN} -name wgridder_basic -gridder wgridder "
"-no-update-model-required "
"-mgain 0.95 -nmiter 1 -niter 6000 "
f"-size 2000 2000 -scale 1asec {tcf.LOFAR_3C196_MS}"
)
validate_call(wgridder.split())
facet_idg = (
f"{tcf.WSCLEAN} -name facet_idg_basic -gridder facet-idg "
"-no-update-model-required "
"-mgain 0.95 -nmiter 1 -niter 6000 "
f"-size 2000 2000 -scale 1asec {tcf.LOFAR_3C196_MS}"
)
validate_call(facet_idg.split())
compare_rms_fits(
"facet_idg_basic-image.fits",
"wgridder_basic-image.fits",
threshold=1.0e-3,
)
|