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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
009060b6
Commit
009060b6
authored
3 years ago
by
Stefano Di Frischia
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-578
: fix integration test
parent
5d950448
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!228
Resolve L2SS-578 "Precise hbat delay steps"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_beam.py
+34
-29
34 additions, 29 deletions
...ationcontrol/integration_test/devices/test_device_beam.py
with
34 additions
and
29 deletions
tangostationcontrol/tangostationcontrol/integration_test/devices/test_device_beam.py
+
34
−
29
View file @
009060b6
...
@@ -8,7 +8,10 @@
...
@@ -8,7 +8,10 @@
# See LICENSE.txt for more info.
# See LICENSE.txt for more info.
import
numpy
import
numpy
from
tango.test_context
import
DeviceTestContext
from
tangostationcontrol.integration_test.device_proxy
import
TestDeviceProxy
from
tangostationcontrol.integration_test.device_proxy
import
TestDeviceProxy
from
tangostationcontrol.devices
import
beam
from
.base
import
AbstractTestBases
from
.base
import
AbstractTestBases
...
@@ -19,33 +22,35 @@ class TestDeviceBeam(AbstractTestBases.TestDeviceBase):
...
@@ -19,33 +22,35 @@ class TestDeviceBeam(AbstractTestBases.TestDeviceBase):
def
test_write_HBAT_delays
(
self
):
def
test_write_HBAT_delays
(
self
):
"""
Test whether the delay values are correctly saved into the relative RECV attribute
"""
"""
Test whether the delay values are correctly saved into the relative RECV attribute
"""
with
DeviceTestContext
(
beam
.
Beam
,
process
=
True
)
as
proxy
:
proxy
.
initialise
()
proxy
.
on
()
# setup RECV as well
recv_proxy
=
TestDeviceProxy
(
"
STAT/RECV/1
"
)
recv_proxy
.
off
()
recv_proxy
.
initialise
()
recv_proxy
.
set_defaults
()
recv_proxy
.
on
()
proxy
.
recv_proxy
=
recv_proxy
# Verify attribute is present (all zeros if never used before)
HBAT_delays_r1
=
numpy
.
array
(
recv_proxy
.
read_attribute
(
'
HBAT_BF_delays_RW
'
).
value
)
self
.
assertIsNotNone
(
HBAT_delays_r1
)
# verify if values are actually transformed
HBAT_delays_flat
=
proxy
.
HBAT_delays
(
numpy
.
array
([[
"
J2000
"
,
"
0deg
"
,
"
0deg
"
]]
*
96
).
flatten
())
HBAT_delays
=
numpy
.
array
(
HBAT_delays_flat
).
reshape
(
96
,
16
)
HBAT_signal_input_delays
=
numpy
.
zeros
((
96
,
32
),
dtype
=
numpy
.
float64
)
# Property of Beam-device
HBAT_bf_delay_step_delays
=
recv_proxy
.
HBAT_bf_delay_step_delays
HBAT_bf_delays
=
beam
.
Beam
.
_calculate_HBAT_bf_delays
(
HBAT_delays
,
HBAT_signal_input_delays
,
HBAT_bf_delay_step_delays
)
self
.
assertNotEqual
(
HBAT_delays
,
HBAT_bf_delays
)
# Verify writing operation does not lead to errors
proxy
.
HBAT_set_pointing
(
numpy
.
array
([[
"
J2000
"
,
"
0deg
"
,
"
0deg
"
]]
*
96
).
flatten
())
# write values to RECV
HBAT_delays_r2
=
numpy
.
array
(
recv_proxy
.
read_attribute
(
'
HBAT_BF_delays_RW
'
).
value
)
self
.
assertIsNotNone
(
HBAT_delays_r2
)
self
.
proxy
.
initialise
()
self
.
proxy
.
on
()
# setup RECV as well
recv_proxy
=
TestDeviceProxy
(
"
STAT/RECV/1
"
)
recv_proxy
.
off
()
recv_proxy
.
initialise
()
recv_proxy
.
set_defaults
()
recv_proxy
.
on
()
self
.
proxy
.
recv_proxy
=
recv_proxy
# Verify attribute is present (all zeros if never used before)
HBAT_delays_r1
=
numpy
.
array
(
recv_proxy
.
read_attribute
(
'
HBAT_BF_delays_RW
'
).
value
)
self
.
assertIsNotNone
(
HBAT_delays_r1
)
# Verify writing operation does not lead to errors
self
.
proxy
.
HBAT_set_pointing
(
numpy
.
array
([[
"
J2000
"
,
"
0deg
"
,
"
0deg
"
]]
*
96
).
flatten
())
# write values to RECV
HBAT_delays_r2
=
numpy
.
array
(
recv_proxy
.
read_attribute
(
'
HBAT_BF_delays_RW
'
).
value
)
self
.
assertIsNotNone
(
HBAT_delays_r2
)
# verify if values are actually transformed
HBAT_delays_flat
=
self
.
proxy
.
HBAT_delays
(
numpy
.
array
([[
"
J2000
"
,
"
0deg
"
,
"
0deg
"
]]
*
96
).
flatten
())
HBAT_delays
=
numpy
.
array
(
HBAT_delays_flat
).
reshape
(
96
,
16
)
HBAT_signal_input_delays
=
numpy
.
zeros
((
96
,
32
),
dtype
=
numpy
.
float64
)
# Property of Beam-device
HBAT_bf_delay_step_delays
=
recv_proxy
.
HBAT_bf_delay_step_delays
HBAT_bf_delays
=
self
.
proxy
.
_calculate_HBAT_bf_delays
(
HBAT_delays
,
HBAT_signal_input_delays
,
HBAT_bf_delay_step_delays
)
self
.
assertNotEqual
(
HBAT_delays
,
HBAT_bf_delays
)
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