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

AST-1540 Add tFilter.py with filter-after-stationadd test

parent 0e8620a6
Branches
Tags
1 merge request!1259AST-1540 Add tFilter.py with filter-after-stationadd test
...@@ -9,6 +9,7 @@ add_python_tests( ...@@ -9,6 +9,7 @@ add_python_tests(
tClipper tClipper
tColumnReader tColumnReader
tDemix tDemix
tFilter
tGainCal tGainCal
tGainCalH5Parm tGainCalH5Parm
tIDGImager tIDGImager
......
# Copyright (C) 2024 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: GPL-3.0-or-later
import pytest
from subprocess import check_call
# Append current directory to system path in order to import testconfig
import sys
sys.path.append(".")
import testconfig as tcf
from utils import assert_taql, run_in_tmp_path, untar
"""
Integration tests for the Filter step.
Script can be invoked in two ways:
- as standalone from the build/steps/test/integration directory,
using `pytest source/Filter.py` (extended with pytest options of your choice)
- using ctest, see DP3/steps/test/integration/CMakeLists.txt
"""
MSIN = "tNDPPP-generic.MS"
@pytest.fixture(autouse=True)
def source_env(run_in_tmp_path):
untar(f"{tcf.RESOURCEDIR}/{MSIN}.tgz")
def test_filter_added_station():
"""
Adds two stations and filters out the first added station.
"""
MSOUT = "out.ms"
check_call(
[
tcf.DP3EXE,
"checkparset=1",
f"msin={MSIN}",
f"msout={MSOUT}",
"steps=[stationadder,filter]",
"stationadder.stations={CSNEW:[CS001HBA0,CS002HBA0],RSNEW:[RS106HBA,RS208HBA]}",
"filter.baseline=!CSNEW",
"filter.remove=true",
]
)
taql_command = f"select from {MSOUT}/ANTENNA where NAME='CSNEW'"
assert_taql(taql_command, 0)
taql_command = f"select from {MSOUT}/ANTENNA where NAME='RSNEW'"
assert_taql(taql_command, 1)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment