Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
LOFAR2.0
tango
Commits
c50691aa
Commit
c50691aa
authored
2 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-917
: Improved tests to detect 90/180 degree errors
parent
b6ddd811
No related branches found
No related tags found
1 merge request
!404
L2SS-917: Digital beamweights need to be negative
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/test/devices/test_beamlet_device.py
+14
-6
14 additions, 6 deletions
...l/tangostationcontrol/test/devices/test_beamlet_device.py
with
14 additions
and
6 deletions
tangostationcontrol/tangostationcontrol/test/devices/test_beamlet_device.py
+
14
−
6
View file @
c50691aa
...
...
@@ -65,15 +65,21 @@ class TestBeamletDevice(base.TestCase):
self
.
assertEqual
(
to_complex
(
bf_weights
[
1
][
2
]),
-
1
+
0j
,
msg
=
f
"
bf_weights =
{
bf_weights
}
"
)
def
test_calculate_bf_weights_actual_numbers
(
self
):
# we test phase offsets with 90 degree increments to weed out:
# - sign errors (-1-2j instead of 1+2j == 180 degree offset)
# - complex conjugation errors (1-2j instead of 1+2j == 180 degree offset)
# - real/imaginary swap errors (2+1j instead of 1+2j == 90 degree offset)
#
# NB: -180 degree rotation == +180 degree rotation, so we need 90 degree
# offsets to detect 180 degree errors as well.
# 2 beamlets, 3 antennas. The antennas are 1 second apart.
delays
=
numpy
.
array
([
[
0.0
,
2.
5e-9
,
5.0e-9
]
[
0.0
,
1.25e-9
,
2.5e-9
,
3.7
5e-9
,
5.0e-9
]
])
# the frequency of the signal is 1.0 Hz and 0.5 Hz respectively,
# so the antennas will be either in phase or in opposite phase
beamlet_frequencies
=
numpy
.
array
([
[
200e6
,
200e6
,
200e6
]
[
200e6
,
200e6
,
200e6
,
200e6
,
200e6
]
])
bf_weights
=
Beamlet
.
_calculate_bf_weights
(
delays
,
beamlet_frequencies
)
...
...
@@ -81,8 +87,10 @@ class TestBeamletDevice(base.TestCase):
self
.
assertEqual
(
delays
.
shape
,
bf_weights
.
shape
)
self
.
assertEqual
(
to_complex
(
bf_weights
[
0
][
0
]),
1
+
0j
,
msg
=
f
"
bf_weights =
{
bf_weights
}
"
)
self
.
assertEqual
(
to_complex
(
bf_weights
[
0
][
1
]),
-
1
+
0j
,
msg
=
f
"
bf_weights =
{
bf_weights
}
"
)
self
.
assertEqual
(
to_complex
(
bf_weights
[
0
][
2
]),
1
+
0j
,
msg
=
f
"
bf_weights =
{
bf_weights
}
"
)
self
.
assertEqual
(
to_complex
(
bf_weights
[
0
][
1
]),
0
-
1j
,
msg
=
f
"
bf_weights =
{
bf_weights
}
"
)
self
.
assertEqual
(
to_complex
(
bf_weights
[
0
][
2
]),
-
1
+
0j
,
msg
=
f
"
bf_weights =
{
bf_weights
}
"
)
self
.
assertEqual
(
to_complex
(
bf_weights
[
0
][
3
]),
0
+
1j
,
msg
=
f
"
bf_weights =
{
bf_weights
}
"
)
self
.
assertEqual
(
to_complex
(
bf_weights
[
0
][
4
]),
1
+
0j
,
msg
=
f
"
bf_weights =
{
bf_weights
}
"
)
def
test_subband_frequencies
(
self
):
subbands
=
numpy
.
array
([
...
...
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