Skip to content
GitLab
Explore
Sign in
Register
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
2245f40b
Commit
2245f40b
authored
17 years ago
by
Adriaan Renting
Browse files
Options
Downloads
Patches
Plain Diff
BugId: 1049
Fixed a bug in writing the CHAN_FREQ
parent
6e41a0d2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Appl/CEP/CS1/CS1_DataSquasher/src/DataSquasher.cc
+7
-2
7 additions, 2 deletions
Appl/CEP/CS1/CS1_DataSquasher/src/DataSquasher.cc
Appl/CEP/CS1/CS1_DataSquasher/src/SquasherProcessControl.cc
+9
-2
9 additions, 2 deletions
Appl/CEP/CS1/CS1_DataSquasher/src/SquasherProcessControl.cc
with
16 additions
and
4 deletions
Appl/CEP/CS1/CS1_DataSquasher/src/DataSquasher.cc
+
7
−
2
View file @
2245f40b
...
...
@@ -96,7 +96,7 @@ namespace LOFAR
int
outcounter
=
0
;
bool
flagrow
=
true
;
Vector
<
Complex
>
values
(
itsNumPolarizations
,
0
);
//
Vector<
Float> temp
(itsNumPolarizations, );
// a bit bigger to get rounding errors right
Vector
<
Complex
>
weights
(
itsNumPolarizations
,
0
);
while
(
incounter
<
NChan
)
{
for
(
int
i
=
0
;
i
<
itsNumPolarizations
;
i
++
)
...
...
@@ -104,17 +104,22 @@ namespace LOFAR
if
(
!
oldFlags
(
i
,
Start
+
incounter
))
{
//weight is not handled here, maybe sometime in the future?
values
(
i
)
+=
oldData
(
i
,
Start
+
incounter
);
weights
(
i
)
+=
1
;
flagrow
=
false
;
}
}
incounter
++
;
if
((
incounter
)
%
Step
==
0
)
{
for
(
int
i
=
0
;
i
<
itsNumPolarizations
;
i
++
)
{
values
(
i
)
=
values
(
i
)
/
weights
(
i
);
}
newData
.
column
(
outcounter
)
=
values
;
for
(
int
i
=
0
;
i
<
itsNumPolarizations
;
i
++
)
// I can't get anyGT or something like that to work
flagrow
=
flagrow
||
(
threshold
*
1.001
>=
abs
(
values
[
i
]));
newFlags
.
column
(
outcounter
)
=
flagrow
;
values
=
0
;
weights
=
0
;
outcounter
++
;
flagrow
=
true
;
}
...
...
@@ -133,7 +138,7 @@ namespace LOFAR
int
step
=
outMS
.
nrow
()
/
10
+
1
;
//not exact but it'll do
int
row
=
0
;
bool
rwFlags
=
newFlags
.
nrow
()
>
0
;
if
(
!
rwFlags
)
if
(
!
rwFlags
)
//we are able to re-use the same flags
{
newFlags
.
resize
(
itsNumPolarizations
,
NChan
/
Step
,
itsNumSamples
);
}
...
...
This diff is collapsed.
Click to expand it.
Appl/CEP/CS1/CS1_DataSquasher/src/SquasherProcessControl.cc
+
9
−
2
View file @
2245f40b
...
...
@@ -28,12 +28,13 @@
#include
<CS1_DataSquasher/SquasherProcessControl.h>
#include
"DataSquasher.h"
#define SQUASHER_VERSION "0.4
1
"
#define SQUASHER_VERSION "0.4
2
"
//0.20 Added handling MODEL and CORRECTED DATA
//0.30 Added handling threshold and weights
//0.31 Added handing MODEL_DATA and CORRECTED_DATA keywords for imager
//0.40 Changed creation mechnism of the destination MS
//0.41 Cleaned up the code for readability
//0.42 Fixed the incorect weighting of partially flagged bands
namespace
LOFAR
{
...
...
@@ -192,7 +193,13 @@ namespace LOFAR
{
for
(
int
j
=
0
;
j
<
new_nchan
;
j
++
)
{
inFREQ
.
get
(
i
,
old_temp
);
new_temp
(
j
)
=
old_temp
(
itsStart
+
j
*
itsStep
+
itsNChan
/
2
);
if
(
itsStep
%
2
)
//odd number of channels in step
{
new_temp
(
j
)
=
old_temp
(
itsStart
+
j
*
itsStep
+
(
itsStep
+
1
)
/
2
);
}
else
//even number of channels in step
{
new_temp
(
j
)
=
0.5
*
(
old_temp
(
itsStart
+
j
*
itsStep
+
itsStep
/
2
-
1
)
+
old_temp
(
itsStart
+
j
*
itsStep
+
itsStep
/
2
));
}
outFREQ
.
put
(
i
,
new_temp
);
}
for
(
int
j
=
0
;
j
<
new_nchan
;
j
++
)
...
...
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