Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DP3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ResearchAndDevelopment
DP3
Commits
ad9a16bd
Commit
ad9a16bd
authored
1 year ago
by
Maik Nijhuis
Browse files
Options
Downloads
Patches
Plain Diff
AST-1540
Test multiple baseline selection
parent
76e90ed0
No related branches found
No related tags found
1 merge request
!1253
AST-1540 Test multiple baseline selection
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
steps/test/integration/tDemix.py
+32
-8
32 additions, 8 deletions
steps/test/integration/tDemix.py
with
32 additions
and
8 deletions
steps/test/integration/tDemix.py
+
32
−
8
View file @
ad9a16bd
...
@@ -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
"
,
]
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment