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
21cf1641
Commit
21cf1641
authored
14 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
bug 1362: don't discard station data if there is a lot of flagging but no stations are merged
parent
806d03e4
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
+15
-27
15 additions, 27 deletions
RTCP/CNProc/src/BeamFormer.cc
with
15 additions
and
27 deletions
RTCP/CNProc/src/BeamFormer.cc
+
15
−
27
View file @
21cf1641
...
@@ -74,27 +74,10 @@ void BeamFormer::initStationMergeMap( const std::vector<unsigned> &station2BeamF
...
@@ -74,27 +74,10 @@ void BeamFormer::initStationMergeMap( const std::vector<unsigned> &station2BeamF
}
}
}
}
// functor for determining whether a station should be included based on
// its amount of flags
class
stationValidator
{
public:
stationValidator
(
const
SampleData
<>
*
samples
,
const
unsigned
upperBound
)
:
samples
(
samples
),
upperBound
(
upperBound
)
{}
bool
operator
()(
unsigned
stationNr
)
const
{
return
samples
->
flags
[
stationNr
].
count
()
<=
upperBound
;
}
private
:
const
SampleData
<>
*
samples
;
const
unsigned
upperBound
;
};
void
BeamFormer
::
mergeStationFlags
(
const
SampleData
<>
*
in
,
SampleData
<>
*
out
)
void
BeamFormer
::
mergeStationFlags
(
const
SampleData
<>
*
in
,
SampleData
<>
*
out
)
{
{
const
unsigned
upperBound
=
static_cast
<
unsigned
>
(
itsNrSamplesPerIntegration
*
BeamFormer
::
MAX_FLAGGED_PERCENTAGE
);
const
unsigned
upperBound
=
static_cast
<
unsigned
>
(
itsNrSamplesPerIntegration
*
BeamFormer
::
MAX_FLAGGED_PERCENTAGE
);
const
stationValidator
isValid
(
in
,
upperBound
);
for
(
unsigned
d
=
0
;
d
<
itsMergeDestStations
.
size
();
d
++
)
{
for
(
unsigned
d
=
0
;
d
<
itsMergeDestStations
.
size
();
d
++
)
{
const
unsigned
destStation
=
itsMergeDestStations
[
d
];
const
unsigned
destStation
=
itsMergeDestStations
[
d
];
...
@@ -103,12 +86,18 @@ void BeamFormer::mergeStationFlags( const SampleData<> *in, SampleData<> *out )
...
@@ -103,12 +86,18 @@ void BeamFormer::mergeStationFlags( const SampleData<> *in, SampleData<> *out )
validSourceStations
.
clear
();
validSourceStations
.
clear
();
// copy valid stations from sourceStations -> validSourceStations
if
(
sourceStations
.
size
()
==
1
)
{
for
(
unsigned
s
=
0
;
s
<
sourceStations
.
size
();
s
++
)
{
// source and dest are the same (no beamforming), so checking for
if
(
isValid
(
sourceStations
[
s
]
)
)
{
// MAX_FLAGGED_PERCENTAGE is unnecessary conservative
validSourceStations
.
push_back
(
sourceStations
[
s
]
);
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
)
{
validSourceStations
.
push_back
(
sourceStations
[
s
]
);
}
}
}
}
}
// conservative flagging: flag output if any input was flagged
// conservative flagging: flag output if any input was flagged
if
(
validSourceStations
.
empty
()
)
{
if
(
validSourceStations
.
empty
()
)
{
...
@@ -133,19 +122,18 @@ void BeamFormer::mergeStationFlags( const SampleData<> *in, SampleData<> *out )
...
@@ -133,19 +122,18 @@ void BeamFormer::mergeStationFlags( const SampleData<> *in, SampleData<> *out )
void
BeamFormer
::
computeFlags
(
const
SampleData
<>
*
in
,
SampleData
<>
*
out
,
unsigned
nrBeams
)
void
BeamFormer
::
computeFlags
(
const
SampleData
<>
*
in
,
SampleData
<>
*
out
,
unsigned
nrBeams
)
{
{
const
unsigned
upperBound
=
static_cast
<
unsigned
>
(
itsNrSamplesPerIntegration
*
BeamFormer
::
MAX_FLAGGED_PERCENTAGE
);
const
unsigned
upperBound
=
static_cast
<
unsigned
>
(
itsNrSamplesPerIntegration
*
BeamFormer
::
MAX_FLAGGED_PERCENTAGE
);
const
stationValidator
isValid
(
in
,
upperBound
);
// determine which stations have too much flagged data
// determine which stations have too much flagged data
// also, source stations from a merge are set as invalid, since the ASM implementation
// also, source stations from a merge are set as invalid, since the ASM implementation
// can only combine consecutive stations, we have to consider them.
// can only combine consecutive stations, we have to consider them.
itsNrValidStations
=
0
;
itsNrValidStations
=
0
;
for
(
unsigned
i
=
0
;
i
<
itsNrStations
;
i
++
)
{
for
(
unsigned
i
=
0
;
i
<
itsNrStations
;
i
++
)
{
itsValidStations
[
i
]
=
false
;
itsValidStations
[
i
]
=
false
;
}
}
for
(
std
::
vector
<
unsigned
>::
const_iterator
stat
=
itsMergeDestStations
.
begin
();
stat
!=
itsMergeDestStations
.
end
();
stat
++
)
{
for
(
unsigned
i
=
0
;
i
<
itsMergeDestStations
.
size
();
i
++
)
{
if
(
isValid
(
*
stat
)
)
{
if
(
in
->
flags
[
i
].
count
()
<=
upperBound
)
{
itsValidStations
[
*
stat
]
=
true
;
itsValidStations
[
i
]
=
true
;
itsNrValidStations
++
;
itsNrValidStations
++
;
}
}
}
}
...
...
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