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