Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DP3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ResearchAndDevelopment
DP3
Commits
a3f7f182
Commit
a3f7f182
authored
2 years ago
by
Maik Nijhuis
Browse files
Options
Downloads
Patches
Plain Diff
AST-1257
MSUpdater: Use XTensor interface of DPBuffer
parent
84405da4
No related branches found
No related tags found
1 merge request
!1034
AST-1257 MSUpdater: Use XTensor interface of DPBuffer
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
steps/MSUpdater.cc
+48
-39
48 additions, 39 deletions
steps/MSUpdater.cc
with
48 additions
and
39 deletions
steps/MSUpdater.cc
+
48
−
39
View file @
a3f7f182
...
@@ -34,7 +34,6 @@ using casacore::Cube;
...
@@ -34,7 +34,6 @@ using casacore::Cube;
using
casacore
::
DataManager
;
using
casacore
::
DataManager
;
using
casacore
::
DataManagerCtor
;
using
casacore
::
DataManagerCtor
;
using
casacore
::
IPosition
;
using
casacore
::
IPosition
;
using
casacore
::
MeasurementSet
;
using
casacore
::
Record
;
using
casacore
::
Record
;
using
casacore
::
RefRows
;
using
casacore
::
RefRows
;
using
casacore
::
ScalarColumn
;
using
casacore
::
ScalarColumn
;
...
@@ -153,44 +152,53 @@ bool MSUpdater::addColumn(const string& colName,
...
@@ -153,44 +152,53 @@ bool MSUpdater::addColumn(const string& colName,
}
}
bool
MSUpdater
::
process
(
std
::
unique_ptr
<
DPBuffer
>
buffer
)
{
bool
MSUpdater
::
process
(
std
::
unique_ptr
<
DPBuffer
>
buffer
)
{
{
common
::
NSTimer
::
StartStop
sstime
(
itsTimer
);
common
::
NSTimer
::
StartStop
sstime
(
itsTimer
);
const
casacore
::
IPosition
casacore_shape
(
3
,
getInfo
().
ncorr
(),
getInfo
().
nchan
(),
getInfo
().
nbaselines
());
if
(
GetFieldsToWrite
().
Flags
())
{
if
(
GetFieldsToWrite
().
Flags
())
{
putFlags
(
buffer
->
getRowNrs
(),
buffer
->
GetCasacoreFlags
());
const
Cube
<
bool
>
flags
(
casacore_shape
,
buffer
->
GetFlags
().
data
(),
casacore
::
SHARE
);
putFlags
(
buffer
->
getRowNrs
(),
flags
);
}
}
if
(
GetFieldsToWrite
().
Data
())
{
if
(
GetFieldsToWrite
().
Data
())
{
const
Cube
<
casacore
::
Complex
>
data
(
casacore_shape
,
buffer
->
GetData
().
data
(),
casacore
::
SHARE
);
// If compressing, flagged values need to be set to NaN to decrease the
// If compressing, flagged values need to be set to NaN to decrease the
// dynamic range
// dynamic range
if
(
itsStManKeys
.
stManName
==
"dysco"
)
{
if
(
itsStManKeys
.
stManName
==
"dysco"
)
{
Cube
<
casacore
::
Complex
>
data
C
opy
=
buffer
->
GetCasacoreD
ata
()
.
copy
();
Cube
<
casacore
::
Complex
>
data
_c
opy
=
d
ata
.
copy
();
Cube
<
casacore
::
Complex
>::
iterator
data
I
ter
=
data
C
opy
.
begin
();
Cube
<
casacore
::
Complex
>::
iterator
data
_i
ter
ator
=
data
_c
opy
.
begin
();
for
(
const
bool
flag
:
buffer
->
GetFlags
())
{
for
(
const
bool
flag
:
buffer
->
GetFlags
())
{
if
(
flag
)
{
if
(
flag
)
{
*
data
Ite
r
=
*
data
_iterato
r
=
casacore
::
Complex
(
std
::
numeric_limits
<
float
>::
quiet_NaN
(),
casacore
::
Complex
(
std
::
numeric_limits
<
float
>::
quiet_NaN
(),
std
::
numeric_limits
<
float
>::
quiet_NaN
());
std
::
numeric_limits
<
float
>::
quiet_NaN
());
}
}
++
data
Ite
r
;
++
data
_iterato
r
;
}
}
putData
(
buffer
->
getRowNrs
(),
data
C
opy
);
putData
(
buffer
->
getRowNrs
(),
data
_c
opy
);
}
else
{
}
else
{
putData
(
buffer
->
getRowNrs
(),
buffer
->
GetCasacoreD
ata
()
);
putData
(
buffer
->
getRowNrs
(),
d
ata
);
}
}
}
}
if
(
GetFieldsToWrite
().
Weights
())
{
if
(
GetFieldsToWrite
().
Weights
())
{
const
Cube
<
float
>&
weights
=
buffer
->
GetCasacoreWeights
();
const
Cube
<
float
>
weights
(
casacore_shape
,
buffer
->
GetWeights
().
data
(),
casacore
::
SHARE
);
// If compressing, set weights of flagged points to zero to decrease the
// If compressing, set weights of flagged points to zero to decrease the
// dynamic range
// dynamic range
if
(
itsStManKeys
.
stManName
==
"dysco"
)
{
if
(
itsStManKeys
.
stManName
==
"dysco"
)
{
Cube
<
float
>
weights
C
opy
=
weights
.
copy
();
Cube
<
float
>
weights
_c
opy
=
weights
.
copy
();
Cube
<
float
>::
iterator
weights
Ite
r
=
weights
C
opy
.
begin
();
Cube
<
float
>::
iterator
weights
_iterato
r
=
weights
_c
opy
.
begin
();
for
(
const
bool
flag
:
buffer
->
GetFlags
())
{
for
(
const
bool
flag
:
buffer
->
GetFlags
())
{
if
(
flag
)
{
if
(
flag
)
{
*
weights
I
ter
=
0.
;
*
weights
_i
ter
ator
=
0.
0f
;
}
}
++
weights
Ite
r
;
++
weights
_iterato
r
;
}
}
putWeights
(
buffer
->
getRowNrs
(),
weights
C
opy
);
putWeights
(
buffer
->
getRowNrs
(),
weights
_c
opy
);
}
else
{
}
else
{
putWeights
(
buffer
->
getRowNrs
(),
weights
);
putWeights
(
buffer
->
getRowNrs
(),
weights
);
}
}
...
@@ -199,6 +207,7 @@ bool MSUpdater::process(std::unique_ptr<DPBuffer> buffer) {
...
@@ -199,6 +207,7 @@ bool MSUpdater::process(std::unique_ptr<DPBuffer> buffer) {
if
(
itsNrTimesFlush
>
0
&&
itsNrDone
%
itsNrTimesFlush
==
0
)
{
if
(
itsNrTimesFlush
>
0
&&
itsNrDone
%
itsNrTimesFlush
==
0
)
{
itsMS
.
flush
();
itsMS
.
flush
();
}
}
}
getNextStep
()
->
process
(
std
::
move
(
buffer
));
getNextStep
()
->
process
(
std
::
move
(
buffer
));
return
true
;
return
true
;
}
}
...
...
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