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
4b266211
Commit
4b266211
authored
3 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-380
: epoch -> timestamp is better naming
parent
253fcc12
No related branches found
No related tags found
1 merge request
!220
Resolve L2SS-480 "Delays to beam weights"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tangostationcontrol/tangostationcontrol/devices/beam.py
+8
-8
8 additions, 8 deletions
tangostationcontrol/tangostationcontrol/devices/beam.py
tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py
+5
-5
5 additions, 5 deletions
...trol/tangostationcontrol/test/devices/test_beam_device.py
with
13 additions
and
13 deletions
tangostationcontrol/tangostationcontrol/devices/beam.py
+
8
−
8
View file @
4b266211
...
...
@@ -10,7 +10,7 @@
import
numpy
import
datetime
from
tango.server
import
attribute
,
command
,
device_property
from
tango
import
AttrWriteType
,
DebugIt
,
DevState
,
DeviceProxy
,
DevVarStringArray
,
DevVarFloatArray
,
DevVarLong64Array
,
DevVarDoubleArray
from
tango
import
AttrWriteType
,
AttrDataFormat
,
DebugIt
,
DevState
,
DeviceProxy
,
DevVarStringArray
,
DevVarFloatArray
,
DevVarLong64Array
,
DevVarDoubleArray
# Additional import
from
tangostationcontrol.common.entrypoint
import
entry
...
...
@@ -30,7 +30,7 @@ __all__ = ["Beam", "main"]
class
Beam
(
lofar_device
):
_hbat_pointing_direction
=
numpy
.
zeros
((
96
,
3
),
dtype
=
numpy
.
str
)
_hbat_pointing_
epoch
=
numpy
.
zeros
(
96
,
dtype
=
numpy
.
double
)
_hbat_pointing_
timestamp
=
numpy
.
zeros
(
96
,
dtype
=
numpy
.
double
)
# -----------------
# Device Properties
...
...
@@ -38,13 +38,13 @@ class Beam(lofar_device):
reference_itrf
=
device_property
(
dtype
=
'
DevVarFloatArray
'
,
mandatory
=
False
,
default_value
=
numpy
.
tile
(
numpy
.
array
([
3826577.066
,
461022.948
,
5064892.786
]),(
96
,
1
))
# CS002LBA, in ITRF2005
epoch
2012.5
default_value
=
numpy
.
tile
(
numpy
.
array
([
3826577.066
,
461022.948
,
5064892.786
]),(
96
,
1
))
# CS002LBA, in ITRF2005
timestamp
2012.5
)
antenna_itrf
=
device_property
(
dtype
=
'
DevVarFloatArray
'
,
mandatory
=
False
,
default_value
=
numpy
.
tile
(
numpy
.
array
([
3826923.546
,
460915.441
,
5064643.489
]),(
96
,
16
,
1
))
# CS001LBA, in ITRF2005
epoch
2012.5
default_value
=
numpy
.
tile
(
numpy
.
array
([
3826923.546
,
460915.441
,
5064643.489
]),(
96
,
16
,
1
))
# CS001LBA, in ITRF2005
timestamp
2012.5
)
# ----------
...
...
@@ -55,9 +55,9 @@ class Beam(lofar_device):
dtype
=
((
numpy
.
str
,),),
max_dim_x
=
3
,
max_dim_y
=
96
,
fget
=
lambda
self
:
self
.
_hbat_pointing_direction
)
HBAT_pointing_
epoch
_R
=
attribute
(
access
=
AttrWriteType
.
READ
,
HBAT_pointing_
timestamp
_R
=
attribute
(
access
=
AttrWriteType
.
READ
,
dtype
=
(
numpy
.
double
,),
max_dim_x
=
96
,
fget
=
lambda
self
:
self
.
_hbat_pointing_
epoch
)
fget
=
lambda
self
:
self
.
_hbat_pointing_
timestamp
)
RECV_name
=
'
stat/recv/1
'
...
...
@@ -134,7 +134,7 @@ class Beam(lofar_device):
for
tile
in
range
(
96
):
if
mask
[
tile
]:
self
.
_hbat_pointing_direction
[
tile
]
=
pointing_direction
[
tile
]
self
.
_hbat_pointing_
epoch
[
tile
]
=
timestamp
self
.
_hbat_pointing_
timestamp
[
tile
]
=
timestamp
# --------
# Commands
...
...
@@ -171,7 +171,7 @@ class Beam(lofar_device):
logger
.
warning
(
"
Restarting device to activate new measures tables
"
)
restart_python
()
@command
(
dtype_in
=
DevVarStringArray
,
dtype_out
=
DevVarDoubleArray
)
@command
(
dtype_in
=
DevVarStringArray
,
dformat_in
=
AttrDataFormat
.
IMAGE
,
dtype_out
=
DevVarDoubleArray
)
@DebugIt
()
@log_exceptions
()
@only_in_states
([
DevState
.
ON
])
...
...
This diff is collapsed.
Click to expand it.
tangostationcontrol/tangostationcontrol/test/devices/test_beam_device.py
+
5
−
5
View file @
4b266211
...
...
@@ -39,12 +39,12 @@ class TestBeamDevice(base.TestCase):
self
.
assertEqual
(
96
,
len
(
proxy
.
read_attribute
(
"
HBAT_pointing_direction_R
"
).
value
))
def
test_get_pointing_
epoch
s
(
self
):
"""
Verify can read
epoch
s attribute and length matches without err
"""
def
test_get_pointing_
timestamp
s
(
self
):
"""
Verify can read
timestamp
s attribute and length matches without err
"""
with
DeviceTestContext
(
beam
.
Beam
,
process
=
True
)
as
proxy
:
self
.
assertEqual
(
96
,
len
(
proxy
.
read_attribute
(
"
HBAT_pointing_
epoch
_R
"
).
value
))
"
HBAT_pointing_
timestamp
_R
"
).
value
))
def
test_HBAT_delays_dims
(
self
):
"""
Verify HBAT delays are retrieved with correct dimensions
"""
...
...
@@ -57,7 +57,7 @@ class TestBeamDevice(base.TestCase):
self
.
assertEqual
(
DevState
.
ON
,
proxy
.
state
())
# verify HBAT_delays method returns the correct dimensions
HBAT_delays
=
proxy
.
HBAT_delays
([
"
J2000
"
,
"
0deg
"
,
"
0deg
"
]
*
96
)
HBAT_delays
=
proxy
.
HBAT_delays
([
[
"
J2000
"
,
"
0deg
"
,
"
0deg
"
]
]
*
96
)
self
.
assertEqual
((
96
*
16
,),
HBAT_delays
.
shape
)
def
test_HBAT_delays_calculations
(
self
):
...
...
@@ -71,6 +71,6 @@ class TestBeamDevice(base.TestCase):
self
.
assertEqual
(
DevState
.
ON
,
proxy
.
state
())
# verify if values are actually transformed
HBAT_delays
=
proxy
.
HBAT_delays
([
"
J2000
"
,
"
0deg
"
,
"
0deg
"
]
*
96
)
HBAT_delays
=
proxy
.
HBAT_delays
([
[
"
J2000
"
,
"
0deg
"
,
"
0deg
"
]
]
*
96
)
HBAT_bf_delays
=
proxy
.
calculate_HBAT_bf_delays
(
HBAT_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