Line data Source code
1 : #include <msvis/MSVis/MeasurementSet2.h> 2 : #include <casacore/ms/MSSel/MSSelection.h> 3 : #include <casacore/tables/Tables.h> 4 : 5 : using namespace casacore; 6 : 7 : namespace casa { 8 : 9 : 10 0 : MeasurementSet2::MeasurementSet2 (const Table & table, MSSelection * msSelection) 11 : : MeasurementSet (table), 12 0 : msSelection_p (msSelection) // ours now 13 : { 14 0 : } 15 : 16 0 : MeasurementSet2::MeasurementSet2 (const MeasurementSet2 & other) 17 : : MeasurementSet (other), 18 0 : msSelection_p (0) 19 : { 20 0 : msSelection_p = new MSSelection (* other.msSelection_p); 21 0 : wasCreatedWithSelection_p = other.wasCreatedWithSelection(); 22 0 : } 23 : 24 0 : MeasurementSet2::~MeasurementSet2 () 25 : { 26 0 : delete msSelection_p; 27 0 : } 28 : 29 : MeasurementSet2 & 30 0 : MeasurementSet2::operator= (const MeasurementSet2 & other) 31 : { 32 0 : MeasurementSet::operator= (other); 33 : 34 0 : msSelection_p = new MSSelection (* other.msSelection_p); 35 0 : wasCreatedWithSelection_p = other.wasCreatedWithSelection(); 36 : 37 0 : return * this; 38 : } 39 : 40 : MeasurementSet2 41 0 : MeasurementSet2::create (const String & filename, const MSSelection * msSelection) 42 : { 43 0 : MeasurementSet msOriginal (filename); 44 : 45 0 : MSSelection * msSelectionCopy = new MSSelection (* msSelection); // make a private copy 46 : 47 0 : TableExprNode node = msSelectionCopy->toTableExprNode (& msOriginal); 48 : 49 0 : Table tablesel(msOriginal.tableName(), Table::Update); 50 : 51 0 : MeasurementSet2 ms2 (tablesel(node, node.nrow()), msSelectionCopy); 52 : // The MS takes ownership of the MSSelection 53 : 54 0 : return ms2; 55 0 : } 56 : 57 : 58 : const MSSelection * 59 0 : MeasurementSet2::getMSSelection () const 60 : { 61 0 : return msSelection_p; 62 : } 63 : 64 : Bool 65 0 : MeasurementSet2::wasCreatedWithSelection () const 66 : { 67 0 : return wasCreatedWithSelection_p; 68 : } 69 : 70 : } // end namespace casa 71 :