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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
7ee4bcd4
Commit
7ee4bcd4
authored
3 years ago
by
Stefano Di Frischia
Browse files
Options
Downloads
Plain Diff
Merge branch '
L2SS-523
-delay-calibration-table' into 'master'
L2SS-523
"Add signal delay calibration table to BEAM" Closes
L2SS-523
See merge request
!227
parents
bc6b899b
cbc04c10
No related branches found
No related tags found
1 merge request
!227
L2SS-523 "Add signal delay calibration table to BEAM"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tangostationcontrol/tangostationcontrol/devices/beam.py
+14
-4
14 additions, 4 deletions
tangostationcontrol/tangostationcontrol/devices/beam.py
tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py
+9
-2
9 additions, 2 deletions
...trol/tangostationcontrol/test/devices/test_beam_device.py
with
23 additions
and
6 deletions
tangostationcontrol/tangostationcontrol/devices/beam.py
+
14
−
4
View file @
7ee4bcd4
...
...
@@ -47,6 +47,12 @@ class Beam(lofar_device):
default_value
=
numpy
.
tile
(
numpy
.
array
([
3826923.546
,
460915.441
,
5064643.489
]),(
96
,
16
,
1
))
# CS001LBA, in ITRF2005 timestamp 2012.5
)
HBAT_signal_input_delays
=
device_property
(
dtype
=
'
DevVarFloatArray
'
,
mandatory
=
False
,
default_value
=
numpy
.
zeros
((
96
,
32
),
dtype
=
numpy
.
float64
)
)
# ----------
# Attributes
# ----------
...
...
@@ -99,16 +105,19 @@ class Beam(lofar_device):
return
delays
@staticmethod
def
_calculate_HBAT_bf_delays
(
delays
:
numpy
.
ndarray
):
def
_calculate_HBAT_bf_delays
(
delays
:
numpy
.
ndarray
,
HBAT_signal_input_delays
:
numpy
.
ndarray
):
"""
Helper function that converts a signal path delay (in seconds) to an analog beam weight,
which is a value per tile per dipole per polarisation.
"""
# Duplicate delay values per polarisation
polarised_delays
=
numpy
.
tile
(
delays
,
2
)
# output dims -> 96x32
polarised_delays
=
numpy
.
tile
(
delays
,
2
)
# output dims -> 96x32
# Add signal input delay
summed_delays
=
numpy
.
add
(
polarised_delays
,
HBAT_signal_input_delays
)
# Divide by 0.5ns and round
HBAT_bf_delays
=
numpy
.
array
(
polaris
ed_delays
/
0.5e-09
,
dtype
=
numpy
.
int64
)
HBAT_bf_delays
=
numpy
.
array
(
summ
ed_delays
/
0.5e-09
,
dtype
=
numpy
.
int64
)
return
HBAT_bf_delays
...
...
@@ -118,8 +127,9 @@ class Beam(lofar_device):
"""
# Retrieve delays from casacore
delays
=
self
.
_HBAT_delays
(
pointing_direction
,
timestamp
)
# Convert delays into beam weights
HBAT_bf_delays
=
self
.
_calculate_HBAT_bf_delays
(
delays
)
HBAT_bf_delays
=
self
.
_calculate_HBAT_bf_delays
(
delays
,
self
.
HBAT_signal_input_delays
)
# Write weights to RECV
self
.
recv_proxy
.
HBAT_BF_delays_RW
=
HBAT_bf_delays
...
...
This diff is collapsed.
Click to expand it.
tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py
+
9
−
2
View file @
7ee4bcd4
...
...
@@ -68,7 +68,14 @@ class TestBeamDevice(base.TestCase):
proxy
.
on
()
self
.
assertEqual
(
DevState
.
ON
,
proxy
.
state
())
# verify property is retrieved (workaround)
HBAT_signal_input_delays
=
beam
.
Beam
.
HBAT_signal_input_delays
.
default_value
self
.
assertTrue
((
HBAT_signal_input_delays
==
numpy
.
zeros
((
96
,
32
),
dtype
=
numpy
.
float64
)).
all
())
# verify if values are actually transformed
HBAT_delays
=
proxy
.
HBAT_delays
(
numpy
.
array
([[
"
J2000
"
,
"
0deg
"
,
"
0deg
"
]]
*
96
).
flatten
())
HBAT_bf_delays
=
beam
.
Beam
.
_calculate_HBAT_bf_delays
(
HBAT_delays
)
HBAT_delays_flat
=
proxy
.
HBAT_delays
(
numpy
.
array
([[
"
J2000
"
,
"
0deg
"
,
"
0deg
"
]]
*
96
).
flatten
())
HBAT_delays
=
numpy
.
array
(
HBAT_delays_flat
).
reshape
(
96
,
16
)
HBAT_bf_delays
=
beam
.
Beam
.
_calculate_HBAT_bf_delays
(
HBAT_delays
,
HBAT_signal_input_delays
)
self
.
assertNotEqual
(
HBAT_delays
,
HBAT_bf_delays
)
self
.
assertTrue
(
HBAT_bf_delays
[
0
][
0
]
==
numpy
.
int64
((
HBAT_delays
[
0
][
0
]
+
HBAT_signal_input_delays
[
0
][
0
])
/
0.5e-09
))
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