Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
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
Container registry
Model registry
Operate
Environments
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
RTSD
HDL
Commits
118850f8
Commit
118850f8
authored
6 years ago
by
Jonathan Hargreaves
Browse files
Options
Downloads
Patches
Plain Diff
Change to call beamweights as a class
parent
96a80c36
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/arts/commissioning/arts_sc4_tabs_weights.py
+25
-12
25 additions, 12 deletions
applications/arts/commissioning/arts_sc4_tabs_weights.py
with
25 additions
and
12 deletions
applications/arts/commissioning/arts_sc4_tabs_weights.py
+
25
−
12
View file @
118850f8
...
@@ -31,28 +31,41 @@
...
@@ -31,28 +31,41 @@
"""
"""
import
math
import
math
import
pi_arts_tab_beamformer_weights
import
pi_arts_tab_beamformer_weights
from
subprocess
import
Popen
,
PIPE
from
time
import
sleep
import
node_io
import
test_case
num_dish
=
10
num_dish
=
10
num_tabs
=
12
num_tabs
=
12
num_beamlets
=
88
#phases = [num_dish][num_tabs] * 0
#phases = [num_dish][num_tabs] * 0
norm_factor
=
255.0
/
math
.
sqrt
(
num_dish
)
norm_factor
=
200.0
/
math
.
sqrt
(
num_dish
)
tc
=
test_case
.
Testcase
(
'
UTIL -
'
,
''
)
tc
.
set_result
(
'
PASSED
'
)
tc
.
append_log
(
0
,
'
>>> Title : Set TAB weights on %s
'
%
tc
.
unb_nodes_string
(
''
))
io
=
node_io
.
NodeIO
(
tc
.
nodeImages
,
tc
.
base_ip
)
print
"
unb node nos
"
,
tc
.
unbNrs
,
tc
.
fnNrs
,
tc
.
bnNrs
beamweights
=
pi_arts_tab_beamformer_weights
.
BeamformerWeights
(
tc
,
io
)
beamweights
.
set_cmd
(
cmd
=
3
)
beamweights
.
append
=
True
tab_index
=
range
(
-
int
(
math
.
floor
(
num_tabs
/
2
)),
int
(
math
.
floor
((
num_tabs
)
/
2
))
)
tab_index
=
range
(
-
int
(
math
.
floor
(
num_tabs
/
2
)),
int
(
math
.
floor
((
num_tabs
)
/
2
))
)
beta
=
[
float
(
eachelement
)
/
float
(
num_tabs
)
for
eachelement
in
tab_index
]
beta
=
[
float
(
eachelement
)
/
float
(
num_tabs
)
for
eachelement
in
tab_index
]
dishes
=
range
(
num_dish
)
dishes
=
range
(
num_dish
)
phase
_n
=
[[
eachtab
*
float
(
eachdish
)
for
eachdish
in
dishes
]
for
eachtab
in
beta
]
phase
=
[[
eachtab
*
float
(
eachdish
)
*
2
*
math
.
pi
for
eachdish
in
dishes
]
for
eachtab
in
beta
]
#for tab in range(num_tabs):
for
tab
in
range
(
num_tabs
):
for
tab
in
range
(
num_tabs
):
for
dish
in
range
(
num_dish
):
for
dish
in
range
(
num_dish
):
weightre
=
norm_factor
*
math
.
cos
(
2
*
math
.
pi
*
phase_n
[
tab
][
dish
])
#for dish in range(1):
weightim
=
norm_factor
*
math
.
sin
(
2
*
math
.
pi
*
phase_n
[
tab
][
dish
])
weightre
=
int
(
round
(
norm_factor
*
math
.
cos
(
phase
[
tab
][
dish
])
))
print
"
tab
"
,
tab
,
"
dish
"
,
dish
,
"
phase
"
,
2
*
math
.
pi
*
phase_n
[
tab
][
dish
],
"
weight re, im
"
,
weightre
,
weightim
weightim
=
int
(
round
(
norm_factor
*
math
.
sin
(
phase
[
tab
][
dish
])
))
beamweights
.
select
(
tabs
=
tab
,
inputs
=
dish
)
#print tab_index, beta, dishes
beamweights
.
set_weights
(
complex
(
weightre
,
weightim
))
#print phase_n
beamweights
.
run
()
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