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
e527eee5
Commit
e527eee5
authored
3 years ago
by
Stefano Di Frischia
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-643
: add calculate_bf_weights function
parent
fe4900f7
No related branches found
No related tags found
1 merge request
!294
Resolve L2SS-643 "Calculate beamlet bfweights"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py
+12
-10
12 additions, 10 deletions
...stationcontrol/tangostationcontrol/devices/sdp/beamlet.py
with
12 additions
and
10 deletions
tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py
+
12
−
10
View file @
e527eee5
...
@@ -92,14 +92,6 @@ class Beamlet(opcua_device):
...
@@ -92,14 +92,6 @@ class Beamlet(opcua_device):
FPGA_beamlet_output_scale_R
=
attribute_wrapper
(
comms_annotation
=
[
"
FPGA_beamlet_output_scale_R
"
],
datatype
=
numpy
.
double
,
dims
=
(
16
,))
FPGA_beamlet_output_scale_R
=
attribute_wrapper
(
comms_annotation
=
[
"
FPGA_beamlet_output_scale_R
"
],
datatype
=
numpy
.
double
,
dims
=
(
16
,))
FPGA_beamlet_output_scale_RW
=
attribute_wrapper
(
comms_annotation
=
[
"
FPGA_beamlet_output_scale_RW
"
],
datatype
=
numpy
.
double
,
dims
=
(
16
,),
access
=
AttrWriteType
.
READ_WRITE
)
FPGA_beamlet_output_scale_RW
=
attribute_wrapper
(
comms_annotation
=
[
"
FPGA_beamlet_output_scale_RW
"
],
datatype
=
numpy
.
double
,
dims
=
(
16
,),
access
=
AttrWriteType
.
READ_WRITE
)
# List of OPC-UA CP for BF beamlets
S_pn
=
SDP
.
S_pn
N_pn
=
SDP
.
N_pn
A_pn
=
6
N_pol
=
2
N_beamlets_ctrl
=
488
N_pol_bf
=
2
FPGA_beamlet_output_nof_packets_R
=
attribute_wrapper
(
comms_annotation
=
[
"
FPGA_beamlet_output_nof_packets_R
"
],
datatype
=
numpy
.
int32
,
dims
=
(
N_beamlets_ctrl
,
N_pn
))
FPGA_beamlet_output_nof_packets_R
=
attribute_wrapper
(
comms_annotation
=
[
"
FPGA_beamlet_output_nof_packets_R
"
],
datatype
=
numpy
.
int32
,
dims
=
(
N_beamlets_ctrl
,
N_pn
))
FPGA_beamlet_output_nof_valid_R
=
attribute_wrapper
(
comms_annotation
=
[
"
FPGA_beamlet_output_nof_valid_R
"
],
datatype
=
numpy
.
int32
,
dims
=
(
N_beamlets_ctrl
,
N_pn
))
FPGA_beamlet_output_nof_valid_R
=
attribute_wrapper
(
comms_annotation
=
[
"
FPGA_beamlet_output_nof_valid_R
"
],
datatype
=
numpy
.
int32
,
dims
=
(
N_beamlets_ctrl
,
N_pn
))
...
@@ -152,7 +144,17 @@ class Beamlet(opcua_device):
...
@@ -152,7 +144,17 @@ class Beamlet(opcua_device):
# internal functions
# internal functions
# --------
# --------
def
_calculate_bf_weights
(
self
,
phases
:
numpy
.
ndarray
):
def
_calculate_bf_weights
(
self
,
phases
:
numpy
.
ndarray
):
pass
"""
Helper function that converts a difference in phase (in radiants)
to a FPGA weight (in complex number)
"""
# Convert array values in complex numbers
unit
=
numpy
.
power
(
2
,
14
)
real
=
numpy
.
array
(
unit
*
numpy
.
sin
(
phases
),
dtype
=
numpy
.
short
)
imag
=
numpy
.
array
(
unit
*
numpy
.
cos
(
phases
),
dtype
=
numpy
.
short
)
# join 16 bits of imaginary part (MSB) with 16 bits of real part (LSB)
bf_weights
=
numpy
.
array
(
numpy
.
frombuffer
(
b
''
.
join
(
imag
,
real
),
dtype
=
numpy
.
uint32
)
)
return
bf_weights
# --------
# --------
# Commands
# Commands
...
...
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