diff --git a/CEP/DP3/DPPP/include/DPPP/MsFile.h b/CEP/DP3/DPPP/include/DPPP/MsFile.h index 1d5eff859bda731ee6a662cb25965eb193d69342..c8db55cdbd483bc4041d243c99b6e94a0ddc65be 100644 --- a/CEP/DP3/DPPP/include/DPPP/MsFile.h +++ b/CEP/DP3/DPPP/include/DPPP/MsFile.h @@ -69,6 +69,7 @@ namespace LOFAR casa::IPosition ipos, std::string name, casa::Table& table); + casa::Vector<casa::Int> DetermineDATAshape(casa::MeasurementSet& MS); casa::Block<casa::String> SELECTblock; std::string InName; std::string OutName; diff --git a/CEP/DP3/DPPP/src/MsFile.cc b/CEP/DP3/DPPP/src/MsFile.cc index 463b6afc577fd65d3d4ff137664a22129f4011d3..35c90eabd6898797499f72a60704f145d8728648 100644 --- a/CEP/DP3/DPPP/src/MsFile.cc +++ b/CEP/DP3/DPPP/src/MsFile.cc @@ -92,10 +92,24 @@ void MsFile::TableResize(TableDesc tdesc, IPosition ipos, string name, Table& ta table.addColumn(desc); } +//===============>>> MsFile::Init <<<=============== + +Vector<Int> MsFile::DetermineDATAshape(MeasurementSet& MS) +{ + ROArrayColumn<Complex> temp_column(MS, "DATA"); + Matrix<Complex> temp_cell; + temp_column.get(0, temp_cell); + IPosition ipos = temp_cell.shape(); + Vector<Int> temp_pos = ipos.asVector(); + + std::cout << "Old shape: " << temp_pos(0) << ":" << temp_pos(1) << std::endl; + return temp_pos; +} + //===============>>> MsFile::Init <<<=============== void MsFile::Init(MsInfo& Info, RunDetails& Details, int Squashing) { - cout << "Please wait, preparing output MS" << endl; + std::cout << "Please wait, preparing output MS" << std::endl; Block<String> tempblock(SELECTblock); tempblock.resize(21); tempblock[20] = "FLAG"; @@ -110,11 +124,8 @@ void MsFile::Init(MsInfo& Info, RunDetails& Details, int Squashing) InMS = new MeasurementSet(InName); OutMS = new MeasurementSet(OutName, Table::Update); //some magic to create a new DATA column - TableDesc tdesc = InMS->tableDesc(); - ColumnDesc desc = tdesc.rwColumnDesc("DATA"); - IPosition ipos = desc.shape(); - Vector<Int> temp_pos = ipos.asVector(); - std::cout << "Old shape: " << temp_pos(0) << ":" << temp_pos(1) << std::endl; + Vector<Int> temp_pos = DetermineDATAshape(*InMS); + int old_nchan = temp_pos(1); int new_nchan; if (Squashing) @@ -124,12 +135,11 @@ void MsFile::Init(MsInfo& Info, RunDetails& Details, int Squashing) else { new_nchan = old_nchan; Details.NChan = old_nchan; - Details.Step = 1; - Details.Start = 0; } std::cout << "New shape: " << temp_pos(0) << ":" << temp_pos(1) << std::endl; IPosition data_ipos(temp_pos); + TableDesc tdesc = InMS->tableDesc(); if (tdesc.isColumn("WEIGHT_SPECTRUM")) { tdesc.removeColumn("WEIGHT_SPECTRUM"); } @@ -148,7 +158,7 @@ void MsFile::Init(MsInfo& Info, RunDetails& Details, int Squashing) TableResize(tdesc, data_ipos, "CORRECTED_DATA", *OutMS); cout << "MODEL_DATA detected for processing" << endl; - desc = tdesc.rwColumnDesc("MODEL_DATA"); + ColumnDesc desc = tdesc.rwColumnDesc("MODEL_DATA"); desc.setOptions(0); desc.setShape(data_ipos); desc.setOptions(4); diff --git a/CEP/DP3/DPPP/src/PipelineProcessControl.cc b/CEP/DP3/DPPP/src/PipelineProcessControl.cc index 4eafef0d5408a5b8a245fac3b12f9159135c2ba3..9ece1ac68df4e863369035a7bb5d6d724267e705 100644 --- a/CEP/DP3/DPPP/src/PipelineProcessControl.cc +++ b/CEP/DP3/DPPP/src/PipelineProcessControl.cc @@ -92,10 +92,23 @@ namespace LOFAR itsBandpass = ParamSet->getUint32("bandpass", 0); itsFlagger = ParamSet->getUint32("flagger", 0); itsSquasher = ParamSet->getUint32("squasher", 0); - myDetails->PrintInfo(); if (myDetails->CheckValues()) { return false; } + if (itsFlagger == 0 + && (myDetails->FreqWindow != 1 || myDetails->TimeWindow != 1)) + { myDetails->FreqWindow = 1; + myDetails->TimeWindow = 1; + std::cout << "No flagger, time and frequency windows reset to 1x1" << std::endl; + } + if (itsSquasher == 0 + && (myDetails->Step != 1 || myDetails->Start != 0 || myDetails->TimeStep != 1)) + { myDetails->Step = 1; + myDetails->Start = 0; + myDetails->TimeStep = 1; + std::cout << "No squasher, step, start and timestep sizes reset" << std::endl; + } + myDetails->PrintInfo(); return true; }