Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LOFAR Station Client
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
LOFAR2.0
LOFAR Station Client
Commits
0b183a14
Commit
0b183a14
authored
Sep 6, 2022
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2DTS-272
: Test transpose of XST data
parent
6cc1fb99
No related branches found
No related tags found
1 merge request
!16
L2DTS-272: Turn XSTs into a matrix before transposing, not afterwards
Pipeline
#35486
failed
Sep 6, 2022
Stage: lint
Stage: test
Stage: package
Stage: integration
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/statistics/test_collector.py
+33
-11
33 additions, 11 deletions
tests/statistics/test_collector.py
with
33 additions
and
11 deletions
tests/statistics/test_collector.py
+
33
−
11
View file @
0b183a14
...
@@ -135,17 +135,19 @@ class TestXSTCollector(base.TestCase):
...
@@ -135,17 +135,19 @@ class TestXSTCollector(base.TestCase):
f
"
but was written to the XST matrix.
"
,
f
"
but was written to the XST matrix.
"
,
)
)
def
test_conjugated_packet
(
self
):
def
test_conjugated_
transposed_
packet
(
self
):
"""
Test packet payload conjugation with a baseline (a,b) where a<b
"""
"""
Test packet payload conjugation
& transpose
with a baseline (a,b) where a<b
"""
collector
=
XSTCollector
()
collector
=
XSTCollector
()
# a valid packet as obtained from SDP, with 64-bit BE 1+1j as payload, at
# a valid packet as obtained from SDP.
# baseline (0,12) VV VV
# the first 72 samples are 1+1j, the second 72 samples are 2+2j (64-bit BE).
# at baseline (0,12) VV VV
packet
=
(
packet
=
(
b
"
X
\x05\x00\x00\x00\x00\x00\x00\x10\x08\x00\x02\xfa\xef\x00
f
\x00\x0c\x0c
"
b
"
X
\x05\x00\x00\x00\x00\x00\x00\x10\x08\x00\x02\xfa\xef\x00
f
\x00\x0c\x0c
"
b
"
\x08\x01
\x14\x00\x00\x01
!
\xd9
&z
\x1b\xb3
"
b
"
\x08\x01
\x14\x00\x00\x01
!
\xd9
&z
\x1b\xb3
"
+
288
*
b
"
\x00\x00\x00\x00\x00\x00\x00\x01
"
+
144
*
b
"
\x00\x00\x00\x00\x00\x00\x00\x01
"
+
144
*
b
"
\x00\x00\x00\x00\x00\x00\x00\x02
"
)
)
# parse it ourselves to extract info nicely
# parse it ourselves to extract info nicely
...
@@ -165,6 +167,11 @@ class TestXSTCollector(base.TestCase):
...
@@ -165,6 +167,11 @@ class TestXSTCollector(base.TestCase):
# zero
# zero
xst_values
=
collector
.
xst_values
()[
0
]
xst_values
=
collector
.
xst_values
()[
0
]
# number of complex values that should end up in the XST matrix
correct_nr_values
=
144
# number of values we've counted so far
actual_nr_values
=
0
for
baseline_a
in
range
(
collector
.
MAX_INPUTS
):
for
baseline_a
in
range
(
collector
.
MAX_INPUTS
):
for
baseline_b
in
range
(
collector
.
MAX_INPUTS
):
for
baseline_b
in
range
(
collector
.
MAX_INPUTS
):
if
baseline_b
>
baseline_a
:
if
baseline_b
>
baseline_a
:
...
@@ -184,12 +191,25 @@ class TestXSTCollector(base.TestCase):
...
@@ -184,12 +191,25 @@ class TestXSTCollector(base.TestCase):
)
)
if
baseline_a_was_in_packet
and
baseline_b_was_in_packet
:
if
baseline_a_was_in_packet
and
baseline_b_was_in_packet
:
# through conjugation, the imaginary part is made negative
# through transposition, the second dimension (b) now is the divider
# between the two distinct values
if
baseline_b
-
fields
.
first_baseline
[
0
]
<
6
:
self
.
assertEqual
(
self
.
assertEqual
(
1
-
1j
,
1
-
1j
,
xst_values
[
baseline_a
][
baseline_b
],
xst_values
[
baseline_a
][
baseline_b
],
msg
=
f
"
element [
{
baseline_a
}
][
{
baseline_b
}
] did not end up
"
msg
=
f
"
element [
{
baseline_a
}
][
{
baseline_b
}
] did not end up
"
f
"
conjugated in XST matrix.
"
,
f
"
conjugated
& transposed
in XST matrix.
"
,
)
)
else
:
self
.
assertEqual
(
2
-
2j
,
xst_values
[
baseline_a
][
baseline_b
],
msg
=
f
"
element [
{
baseline_a
}
][
{
baseline_b
}
] did not end up
"
f
"
conjugated & transposed in XST matrix.
"
,
)
actual_nr_values
+=
1
else
:
else
:
self
.
assertEqual
(
self
.
assertEqual
(
0
+
0j
,
0
+
0j
,
...
@@ -198,6 +218,8 @@ class TestXSTCollector(base.TestCase):
...
@@ -198,6 +218,8 @@ class TestXSTCollector(base.TestCase):
f
"
but was written to the XST matrix.
"
,
f
"
but was written to the XST matrix.
"
,
)
)
self
.
assertEqual
(
correct_nr_values
,
actual_nr_values
,
"
Mismatch between number of values in the packet and in the resulting matrix
"
)
def
test_multiple_subbands
(
self
):
def
test_multiple_subbands
(
self
):
collector
=
XSTCollector
()
collector
=
XSTCollector
()
...
...
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