Skip to content
Snippets Groups Projects
Commit 52c12d0d authored by Maik Nijhuis's avatar Maik Nijhuis
Browse files

Merge branch 'ast-1540-multiple-baseline-selection' into 'master'

AST-1540 Test multiple baseline selection

See merge request !1253
parents 76e90ed0 ad9a16bd
No related branches found
No related tags found
1 merge request!1253AST-1540 Test multiple baseline selection
Pipeline #82130 passed
...@@ -20,7 +20,8 @@ Script can be invoked in two ways: ...@@ -20,7 +20,8 @@ Script can be invoked in two ways:
- using ctest, see DP3/steps/test/integration/CMakeLists.txt - using ctest, see DP3/steps/test/integration/CMakeLists.txt
""" """
MSIN = "tDemix.in_MS" MSIN_DEMIX = "tDemix.in_MS"
MSIN_GENERIC = "tNDPPP-generic.MS"
common_args = [ common_args = [
"msin=tDemix_tmp/tDemix.MS", "msin=tDemix_tmp/tDemix.MS",
...@@ -42,9 +43,9 @@ common_args = [ ...@@ -42,9 +43,9 @@ common_args = [
skymodel_arg = "demix.skymodel='tDemix_tmp/{}'" skymodel_arg = "demix.skymodel='tDemix_tmp/{}'"
@pytest.fixture(autouse=True) @pytest.fixture()
def source_env(run_in_tmp_path): def demix_ms(run_in_tmp_path):
untar(f"{tcf.RESOURCEDIR}/{MSIN}.tgz") untar(f"{tcf.RESOURCEDIR}/{MSIN_DEMIX}.tgz")
check_call( check_call(
[ [
tcf.MAKESOURCEDBEXE, tcf.MAKESOURCEDBEXE,
...@@ -54,8 +55,13 @@ def source_env(run_in_tmp_path): ...@@ -54,8 +55,13 @@ def source_env(run_in_tmp_path):
) )
@pytest.fixture()
def generic_ms(run_in_tmp_path):
untar(f"{tcf.RESOURCEDIR}/{MSIN_GENERIC}.tgz")
@pytest.mark.parametrize("skymodel", ["sky.txt", "sourcedb"]) @pytest.mark.parametrize("skymodel", ["sky.txt", "sourcedb"])
def test_without_target(skymodel): def test_without_target(demix_ms, skymodel):
check_call( check_call(
[ [
tcf.DP3EXE, tcf.DP3EXE,
...@@ -73,7 +79,7 @@ def test_without_target(skymodel): ...@@ -73,7 +79,7 @@ def test_without_target(skymodel):
@pytest.mark.parametrize("skymodel", ["sky.txt", "sourcedb"]) @pytest.mark.parametrize("skymodel", ["sky.txt", "sourcedb"])
def test_with_target_projected_away(skymodel): def test_with_target_projected_away(demix_ms, skymodel):
check_call( check_call(
[ [
tcf.DP3EXE, tcf.DP3EXE,
...@@ -91,7 +97,7 @@ def test_with_target_projected_away(skymodel): ...@@ -91,7 +97,7 @@ def test_with_target_projected_away(skymodel):
@pytest.mark.parametrize("skymodel", ["sky.txt", "sourcedb"]) @pytest.mark.parametrize("skymodel", ["sky.txt", "sourcedb"])
def test_with_target(skymodel): def test_with_target(demix_ms, skymodel):
check_call( check_call(
[ [
tcf.DP3EXE, tcf.DP3EXE,
...@@ -109,7 +115,7 @@ def test_with_target(skymodel): ...@@ -109,7 +115,7 @@ def test_with_target(skymodel):
assert_taql(taql_command) assert_taql(taql_command)
def test_time_freq_resolution(): def test_time_freq_resolution(demix_ms):
check_call( check_call(
[ [
tcf.DP3EXE, tcf.DP3EXE,
...@@ -126,3 +132,21 @@ def test_time_freq_resolution(): ...@@ -126,3 +132,21 @@ def test_time_freq_resolution():
# Compare some columns of the output MS with the reference output. # Compare some columns of the output MS with the reference output.
taql_command = f"select from tDemix_out.MS t1, tDemix_tmp/tDemix_ref1.MS t2 where not all(near(t1.DATA,t2.DATA,1e-3) || (isnan(t1.DATA) && isnan(t2.DATA))) || not all(t1.FLAG = t2.FLAG) || not all(near(t1.WEIGHT_SPECTRUM, t2.WEIGHT_SPECTRUM)) || t1.ANTENNA1 != t2.ANTENNA1 || t1.ANTENNA2 != t2.ANTENNA2 || t1.TIME !~= t2.TIME" taql_command = f"select from tDemix_out.MS t1, tDemix_tmp/tDemix_ref1.MS t2 where not all(near(t1.DATA,t2.DATA,1e-3) || (isnan(t1.DATA) && isnan(t2.DATA))) || not all(t1.FLAG = t2.FLAG) || not all(near(t1.WEIGHT_SPECTRUM, t2.WEIGHT_SPECTRUM)) || t1.ANTENNA1 != t2.ANTENNA1 || t1.ANTENNA2 != t2.ANTENNA2 || t1.TIME !~= t2.TIME"
assert_taql(taql_command) assert_taql(taql_command)
@pytest.mark.skip(reason="Issue #268 is not fixed yet")
def test_multiple_baseline_selection(generic_ms):
# Test for https://git.astron.nl/RD/DP3/-/issues/268, where the baseline
# selection for demix was already applied using msin and filter.
check_call(
[
tcf.DP3EXE,
f"msin={MSIN_GENERIC}",
"msin.baseline=CS*&",
"steps=[filter,demix,null]",
"filter.baseline=CS*&",
"filter.remove=true",
"demix.baseline=CS*&",
f"demix.skymodel={MSIN_GENERIC}/sky",
]
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment