Skip to content
Snippets Groups Projects
Commit 40d39e3a authored by Ger van Diepen's avatar Ger van Diepen
Browse files

Task #2699 Fixed performance issue when using msin.baselines (problem found by Olaf)

parent 09b0f830
Branches
Tags
No related merge requests found
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <DPPP/DPLogger.h> #include <DPPP/DPLogger.h>
#include <DPPP/ParSet.h> #include <DPPP/ParSet.h>
#include <Common/LofarLogger.h> #include <Common/LofarLogger.h>
#include <tables/Tables/TableRecord.h> #include <tables/Tables/TableRecord.h>
#include <tables/Tables/ScalarColumn.h> #include <tables/Tables/ScalarColumn.h>
#include <tables/Tables/ArrayColumn.h> #include <tables/Tables/ArrayColumn.h>
...@@ -89,6 +90,7 @@ namespace LOFAR { ...@@ -89,6 +90,7 @@ namespace LOFAR {
// See if a selection on band needs to be done. // See if a selection on band needs to be done.
// We assume that DATA_DESC_ID and SPW_ID map 1-1. // We assume that DATA_DESC_ID and SPW_ID map 1-1.
if (itsSpw >= 0) { if (itsSpw >= 0) {
DPLOG_INFO_STR (" MSReader selecting spectral window " << itsSpw << " ...");
Table subset = itsMS (itsMS.col("DATA_DESC_ID") == itsSpw); Table subset = itsMS (itsMS.col("DATA_DESC_ID") == itsSpw);
// If not all is selected, use the selection. // If not all is selected, use the selection.
if (subset.nrow() < itsMS.nrow()) { if (subset.nrow() < itsMS.nrow()) {
...@@ -101,6 +103,7 @@ namespace LOFAR { ...@@ -101,6 +103,7 @@ namespace LOFAR {
} }
// See if a selection on baseline needs to be done. // See if a selection on baseline needs to be done.
if (! itsSelBL.empty()) { if (! itsSelBL.empty()) {
DPLOG_INFO_STR (" MSReader selecting baselines ...");
MSSelection select; MSSelection select;
// Set given selection strings. // Set given selection strings.
select.setAntennaExpr (itsSelBL); select.setAntennaExpr (itsSelBL);
...@@ -210,8 +213,8 @@ namespace LOFAR { ...@@ -210,8 +213,8 @@ namespace LOFAR {
// Skip time slot and give warning if MS data is not in time order. // Skip time slot and give warning if MS data is not in time order.
if (mstime < itsLastMSTime) { if (mstime < itsLastMSTime) {
LOG_WARN_STR ("Time at rownr " LOG_WARN_STR ("Time at rownr "
<< itsIter.table().rowNumbers(itsMS)[0] << itsIter.table().rowNumbers()[0]
<< " of MS " << itsMS.tableName() << " of MS " << itsMSName
<< " is less than previous time slot"); << " is less than previous time slot");
} else { } else {
// Use the time slot if near or < nexttime, but > starttime. // Use the time slot if near or < nexttime, but > starttime.
...@@ -251,7 +254,7 @@ namespace LOFAR { ...@@ -251,7 +254,7 @@ namespace LOFAR {
calcUVW(); calcUVW();
itsNrInserted++; itsNrInserted++;
} else { } else {
itsBuffer.setRowNrs (itsIter.table().rowNumbers(itsMS)); itsBuffer.setRowNrs (itsIter.table().rowNumbers(itsMS, True));
if (itsMissingData) { if (itsMissingData) {
// Data column not present, so fill a fully flagged time slot. // Data column not present, so fill a fully flagged time slot.
itsBuffer.setExposure (itsTimeInterval); itsBuffer.setExposure (itsTimeInterval);
...@@ -467,7 +470,7 @@ namespace LOFAR { ...@@ -467,7 +470,7 @@ namespace LOFAR {
ROScalarColumn<Int> ant2col(itsIter.table(), "ANTENNA2"); ROScalarColumn<Int> ant2col(itsIter.table(), "ANTENNA2");
// Keep the row numbers of the first part to be used for the meta info // Keep the row numbers of the first part to be used for the meta info
// of possibly missing time slots. // of possibly missing time slots.
itsBaseRowNrs = itsIter.table().rowNumbers(itsMS); itsBaseRowNrs = itsIter.table().rowNumbers(itsMS, True);
// Get the antenna names and positions. // Get the antenna names and positions.
Table anttab(itsMS.keywordSet().asTable("ANTENNA")); Table anttab(itsMS.keywordSet().asTable("ANTENNA"));
ROScalarColumn<String> nameCol (anttab, "NAME"); ROScalarColumn<String> nameCol (anttab, "NAME");
...@@ -553,8 +556,8 @@ namespace LOFAR { ...@@ -553,8 +556,8 @@ namespace LOFAR {
// Skip time slot and give warning if MS data is not in time order. // Skip time slot and give warning if MS data is not in time order.
if (mstime < itsLastMSTime) { if (mstime < itsLastMSTime) {
LOG_WARN_STR ("Time at rownr " LOG_WARN_STR ("Time at rownr "
<< itsIter.table().rowNumbers(itsMS)[0] << itsIter.table().rowNumbers()[0]
<< " of MS " << itsMS.tableName() << " of MS " << itsMSName
<< " is less than previous time slot"); << " is less than previous time slot");
} else { } else {
// Stop skipping if time equal to itsFirstTime. // Stop skipping if time equal to itsFirstTime.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment