Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review 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
RadioObservatory
LOFAR
Commits
dda1aced
Commit
dda1aced
authored
13 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
bug 1362: minor code cleanup
parent
21cf1641
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
RTCP/CNProc/src/BeamFormer.cc
+17
-29
17 additions, 29 deletions
RTCP/CNProc/src/BeamFormer.cc
with
17 additions
and
29 deletions
RTCP/CNProc/src/BeamFormer.cc
+
17
−
29
View file @
dda1aced
...
...
@@ -92,28 +92,25 @@ void BeamFormer::mergeStationFlags( const SampleData<> *in, SampleData<> *out )
validSourceStations
.
push_back
(
sourceStations
[
0
]
);
}
else
{
// copy valid stations from sourceStations -> validSourceStations
for
(
unsigned
s
=
0
;
s
<
sourceStations
.
size
();
s
++
)
{
if
(
in
->
flags
[
sourceStations
[
s
]].
count
()
<=
upperBound
)
{
for
(
unsigned
s
=
0
;
s
<
sourceStations
.
size
();
s
++
)
if
(
in
->
flags
[
sourceStations
[
s
]].
count
()
<=
upperBound
)
validSourceStations
.
push_back
(
sourceStations
[
s
]
);
}
}
}
// conservative flagging: flag output if any input was flagged
if
(
validSourceStations
.
empty
()
)
{
if
(
validSourceStations
.
empty
())
{
// no valid stations: flag everything
out
->
flags
[
destStation
].
include
(
0
,
itsNrSamplesPerIntegration
);
}
else
{
// some valid stations: merge flags
if
(
validSourceStations
[
0
]
!=
destStation
||
in
!=
out
)
{
if
(
validSourceStations
[
0
]
!=
destStation
||
in
!=
out
)
{
// dest station, which should be first in the list, was not valid
out
->
flags
[
destStation
]
=
in
->
flags
[
validSourceStations
[
0
]];
}
for
(
unsigned
stat
=
1
;
stat
<
validSourceStations
.
size
();
stat
++
)
{
for
(
unsigned
stat
=
1
;
stat
<
validSourceStations
.
size
();
stat
++
)
out
->
flags
[
destStation
]
|=
in
->
flags
[
validSourceStations
[
stat
]];
}
}
}
}
...
...
@@ -131,22 +128,19 @@ void BeamFormer::computeFlags( const SampleData<> *in, SampleData<> *out, unsign
itsValidStations
[
i
]
=
false
;
}
for
(
unsigned
i
=
0
;
i
<
itsMergeDestStations
.
size
();
i
++
)
{
for
(
unsigned
i
=
0
;
i
<
itsMergeDestStations
.
size
();
i
++
)
if
(
in
->
flags
[
i
].
count
()
<=
upperBound
)
{
itsValidStations
[
i
]
=
true
;
itsNrValidStations
++
;
}
}
// conservative flagging: flag output if any input was flagged
for
(
unsigned
beam
=
0
;
beam
<
nrBeams
;
beam
++
)
{
for
(
unsigned
beam
=
0
;
beam
<
nrBeams
;
beam
++
)
{
out
->
flags
[
beam
].
reset
();
for
(
unsigned
stat
=
0
;
stat
<
itsNrStations
;
stat
++
)
{
if
(
itsValidStations
[
stat
]
)
{
for
(
unsigned
stat
=
0
;
stat
<
itsNrStations
;
stat
++
)
if
(
itsValidStations
[
stat
]
)
out
->
flags
[
beam
]
|=
in
->
flags
[
stat
];
}
}
}
}
...
...
@@ -157,38 +151,32 @@ void BeamFormer::mergeStations( const SampleData<> *in, SampleData<> *out )
const
unsigned
destStation
=
itsMergeDestStations
[
i
];
const
std
::
vector
<
unsigned
>
&
validSourceStations
=
itsValidMergeSourceStations
[
i
];
if
(
validSourceStations
.
empty
()
)
{
if
(
validSourceStations
.
empty
()
)
continue
;
}
if
(
validSourceStations
.
size
()
==
1
&&
validSourceStations
[
0
]
==
destStation
)
{
if
(
validSourceStations
.
size
()
==
1
&&
validSourceStations
[
0
]
==
destStation
)
continue
;
}
const
float
factor
=
1.0
/
validSourceStations
.
size
();
for
(
unsigned
ch
=
0
;
ch
<
itsNrChannels
;
ch
++
)
{
for
(
unsigned
time
=
0
;
time
<
itsNrSamplesPerIntegration
;
time
++
)
{
if
(
!
out
->
flags
[
destStation
].
test
(
time
)
)
{
for
(
unsigned
ch
=
0
;
ch
<
itsNrChannels
;
ch
++
)
for
(
unsigned
time
=
0
;
time
<
itsNrSamplesPerIntegration
;
time
++
)
if
(
!
out
->
flags
[
destStation
].
test
(
time
)
)
for
(
unsigned
pol
=
0
;
pol
<
NR_POLARIZATIONS
;
pol
++
)
{
fcomplex
&
dest
=
out
->
samples
[
ch
][
destStation
][
time
][
pol
];
if
(
validSourceStations
[
0
]
!=
destStation
)
{
if
(
validSourceStations
[
0
]
!=
destStation
)
{
// first station is somewhere else; copy it
dest
=
in
->
samples
[
ch
][
0
][
time
][
pol
];
}
// combine the stations
for
(
unsigned
stat
=
1
;
stat
<
validSourceStations
.
size
();
stat
++
)
{
for
(
unsigned
stat
=
1
;
stat
<
validSourceStations
.
size
();
stat
++
)
dest
+=
in
->
samples
[
ch
][
validSourceStations
[
stat
]][
time
][
pol
];
}
dest
*=
factor
;
}
}
}
}
}
}
}
void
BeamFormer
::
computeComplexVoltages
(
const
SampleData
<>
*
in
,
SampleData
<>
*
out
,
double
baseFrequency
,
unsigned
nrBeams
)
...
...
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