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
125eee4d
Commit
125eee4d
authored
2 years ago
by
Taya Snijder
Browse files
Options
Downloads
Patches
Plain Diff
fixed constant use
parent
a652628d
Branches
Branches containing commit
No related tags found
1 merge request
!465
added constants.py and replaced most magic numbers
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py
+4
-4
4 additions, 4 deletions
tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py
with
4 additions
and
4 deletions
tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py
+
4
−
4
View file @
125eee4d
...
@@ -195,8 +195,8 @@ class SDP(opcua_device):
...
@@ -195,8 +195,8 @@ class SDP(opcua_device):
value
=
numpy
.
array
(
value
)
value
=
numpy
.
array
(
value
)
# validate shape
# validate shape
if
value
.
shape
!=
(
self
.
N_pn
,
self
.
S_pn
):
if
value
.
shape
!=
(
N_pn
,
S_pn
):
raise
ValueError
(
f
"
Dimension mismatch. Expected (
{
self
.
N_pn
}
,
{
self
.
S_pn
}
), got
{
value
.
shape
}
.
"
)
raise
ValueError
(
f
"
Dimension mismatch. Expected (
{
N_pn
}
,
{
S_pn
}
), got
{
value
.
shape
}
.
"
)
# validate content
# validate content
for
val
in
value
.
flatten
():
for
val
in
value
.
flatten
():
...
@@ -249,7 +249,7 @@ class SDP(opcua_device):
...
@@ -249,7 +249,7 @@ class SDP(opcua_device):
raise
ValueError
(
f
"
Unsupported clock frequency:
{
clock
}
"
)
raise
ValueError
(
f
"
Unsupported clock frequency:
{
clock
}
"
)
# Tell all FPGAs to use this clock
# Tell all FPGAs to use this clock
self
.
proxy
.
FPGA_pps_expected_cnt_RW
=
[
clock
]
*
self
.
N_pn
self
.
proxy
.
FPGA_pps_expected_cnt_RW
=
[
clock
]
*
N_pn
# Also update the packet headers. We assume the first Nyquist zone of each FPGA is representative
# Also update the packet headers. We assume the first Nyquist zone of each FPGA is representative
self
.
proxy
.
FPGA_sdp_info_nyquist_sampling_zone_index_RW
=
self
.
_nyquist_zone
(
clock
)[:,
0
]
self
.
proxy
.
FPGA_sdp_info_nyquist_sampling_zone_index_RW
=
self
.
_nyquist_zone
(
clock
)[:,
0
]
...
@@ -291,7 +291,7 @@ class SDP(opcua_device):
...
@@ -291,7 +291,7 @@ class SDP(opcua_device):
# Store which type of antenna is connected to each input.
# Store which type of antenna is connected to each input.
#
#
# We need to be told this by AntennaField, through configure_for_antennafield.
# We need to be told this by AntennaField, through configure_for_antennafield.
self
.
_antenna_type
=
numpy
.
array
([[
"
LBA
"
]
*
self
.
S_pn
]
*
self
.
N_pn
,
dtype
=
str
)
self
.
_antenna_type
=
numpy
.
array
([[
"
LBA
"
]
*
S_pn
]
*
N_pn
,
dtype
=
str
)
def
_prepare_hardware
(
self
):
def
_prepare_hardware
(
self
):
# FPGAs that are actually reachable and we care about
# FPGAs that are actually reachable and we care about
...
...
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