Skip to content
GitLab
Explore
Sign in
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
0cfce8f3
Commit
0cfce8f3
authored
Mar 31, 2022
by
Stefano Di Frischia
Browse files
Options
Downloads
Plain Diff
Merge branch '
L2SS-640
-add-field-reference-recv' into 'master'
Resolve
L2SS-640
"Add field reference recv" Closes
L2SS-640
See merge request
!283
parents
1deccb97
2ba5954c
No related branches found
No related tags found
1 merge request
!283
Resolve L2SS-640 "Add field reference recv"
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tangostationcontrol/tangostationcontrol/devices/recv.py
+25
-0
25 additions, 0 deletions
tangostationcontrol/tangostationcontrol/devices/recv.py
tangostationcontrol/tangostationcontrol/test/devices/test_recv_device.py
+13
-3
13 additions, 3 deletions
...trol/tangostationcontrol/test/devices/test_recv_device.py
with
38 additions
and
3 deletions
tangostationcontrol/tangostationcontrol/devices/recv.py
+
25
−
0
View file @
0cfce8f3
...
...
@@ -126,6 +126,18 @@ class RECV(opcua_device):
# ----- Position information
Antenna_Field_Reference_ITRF
=
device_property
(
doc
=
"
ITRF position (XYZ) of each antenna field
"
,
dtype
=
'
DevVarFloatArray
'
,
mandatory
=
False
)
Antenna_Field_Reference_ETRS
=
device_property
(
doc
=
"
ETRS position (XYZ) of each antenna field
"
,
dtype
=
'
DevVarFloatArray
'
,
mandatory
=
False
)
HBAT_reference_ITRF
=
device_property
(
doc
=
"
ITRF position (XYZ) of each HBAT (leave empty to auto-derive from ETRS)
"
,
dtype
=
'
DevVarFloatArray
'
,
...
...
@@ -218,6 +230,10 @@ class RECV(opcua_device):
# ----- Position information
Antenna_Field_Reference_ITRF_R
=
attribute
(
access
=
AttrWriteType
.
READ
,
doc
=
'
Absolute reference position of antenna field, in ITRF
'
,
dtype
=
(
numpy
.
float
,),
max_dim_x
=
3
)
HBAT_antenna_ITRF_offsets_R
=
attribute
(
access
=
AttrWriteType
.
READ
,
doc
=
'
Offsets of the antennas within a tile, in ITRF (
"
iHBADeltas
"
). True shape: 96x16x3.
'
,
dtype
=
((
numpy
.
float
,),),
max_dim_x
=
48
,
max_dim_y
=
96
)
...
...
@@ -226,6 +242,15 @@ class RECV(opcua_device):
doc
=
'
Absolute reference position of each tile, in ITRF
'
,
dtype
=
((
numpy
.
float
,),),
max_dim_x
=
3
,
max_dim_y
=
96
)
def
read_Antenna_Field_Reference_ITRF_R
(
self
):
# provide ITRF field coordinates if they were configured
if
self
.
Antenna_Field_Reference_ITRF
:
return
numpy
.
array
(
self
.
Antenna_Field_Reference_ITRF
).
reshape
(
3
)
# calculate them from ETRS coordinates if not, using the configured ITRF reference
ETRS_coordinates
=
numpy
.
array
(
self
.
Antenna_Field_Reference_ETRS
).
reshape
(
3
)
return
ETRS_to_ITRF
(
ETRS_coordinates
,
self
.
ITRF_Reference_Frame
,
self
.
ITRF_Reference_Epoch
)
def
read_HBAT_antenna_ITRF_offsets_R
(
self
):
base_antenna_offsets
=
numpy
.
array
(
self
.
HBAT_base_antenna_offsets
).
reshape
(
16
,
3
)
PQR_to_ETRS_rotation_matrix
=
numpy
.
array
(
self
.
HBAT_PQR_to_ETRS_rotation_matrix
).
reshape
(
3
,
3
)
...
...
This diff is collapsed.
Click to expand it.
tangostationcontrol/tangostationcontrol/test/devices/test_recv_device.py
+
13
−
3
View file @
0cfce8f3
...
...
@@ -19,7 +19,8 @@ from tangostationcontrol.test import base
class
TestRecvDevice
(
base
.
TestCase
):
# some dummy values for mandatory properties
recv_properties
=
{
'
OPC_Server_Name
'
:
'
example.com
'
,
'
OPC_Server_Port
'
:
4840
,
'
OPC_Time_Out
'
:
5.0
}
recv_properties
=
{
'
OPC_Server_Name
'
:
'
example.com
'
,
'
OPC_Server_Port
'
:
4840
,
'
OPC_Time_Out
'
:
5.0
,
'
Antenna_Field_Reference_ITRF
'
:
[
3.0
,
3.0
,
3.0
],
'
Antenna_Field_Reference_ETRS
'
:
[
7.0
,
7.0
,
7.0
]}
def
setUp
(
self
):
super
(
TestRecvDevice
,
self
).
setUp
()
...
...
@@ -32,10 +33,19 @@ class TestRecvDevice(base.TestCase):
proxy_patcher
.
start
()
self
.
addCleanup
(
proxy_patcher
.
stop
)
def
test_calculate_HBAT_bf_delay_steps
(
self
):
"""
Verify HBAT beamforming calculations are correctly executed
"""
with
DeviceTestContext
(
recv
.
RECV
,
properties
=
self
.
recv_properties
,
process
=
True
)
as
proxy
:
delays
=
numpy
.
random
.
rand
(
96
,
16
).
flatten
()
HBAT_bf_delay_steps
=
proxy
.
calculate_HBAT_bf_delay_steps
(
delays
)
self
.
assertEqual
(
3072
,
len
(
HBAT_bf_delay_steps
))
# 96x32=3072
def
test_read_Antenna_Field_Reference
(
self
):
"""
Verify if Antenna coordinates are correctly provided
"""
# Device uses ITRF coordinates by default
with
DeviceTestContext
(
recv
.
RECV
,
properties
=
self
.
recv_properties
,
process
=
True
)
as
proxy
:
self
.
assertEqual
(
3.0
,
proxy
.
Antenna_Field_Reference_ITRF_R
[
0
])
# Device derives coordinates from ETRS if ITRF ones are not found
recv_properties_v2
=
{
'
OPC_Server_Name
'
:
'
example.com
'
,
'
OPC_Server_Port
'
:
4840
,
'
OPC_Time_Out
'
:
5.0
,
'
Antenna_Field_Reference_ETRS
'
:
[
7.0
,
7.0
,
7.0
]}
with
DeviceTestContext
(
recv
.
RECV
,
properties
=
recv_properties_v2
,
process
=
True
)
as
proxy
:
self
.
assertNotEqual
(
3.0
,
proxy
.
Antenna_Field_Reference_ITRF_R
[
0
])
# value = 6.948998835785814
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