Source
xxxxxxxxxx
407
407
}
408
408
409
409
void SimpleSimVi2::generateSubtables()
410
410
{
411
411
// Generating Antenna Subtable
412
412
TableDesc antennaTD = MSAntenna::requiredTableDesc();
413
413
SetupNewTable antennaSetup("antennaSubtable", antennaTD, Table::New);
414
414
antennaSubTable_p = Table(antennaSetup, Table::Memory, pars_.nAnt_, true);
415
415
antennaSubTablecols_p.reset(new MSAntennaColumns(antennaSubTable_p));
416
416
417
-
// Generating SPW Subtable
417
+
// Generating SPW Subtable using the info from SimpleSimVi2Parameters
418
+
// The channel effective BW and resolution are set to the channel width
418
419
TableDesc spwTD = MSSpectralWindow::requiredTableDesc();
419
420
SetupNewTable spwSetup("spwSubtable", spwTD, Table::New);
420
421
spwSubTable_p = Table(spwSetup, Table::Memory, pars_.nSpw_, true);
421
422
spwSubTablecols_p.reset(new MSSpWindowColumns(spwSubTable_p));
422
-
auto numChanCol = spwSubTablecols_p->numChan();
423
+
auto& numChanCol = spwSubTablecols_p->numChan();
423
424
numChanCol.putColumn(pars_.nChan_);
424
-
auto refFreqCol = spwSubTablecols_p->refFrequency();
425
+
auto& refFreqCol = spwSubTablecols_p->refFrequency();
425
426
refFreqCol.putColumn(pars_.refFreq_);
427
+
auto& chanFreqCol = spwSubTablecols_p->chanFreq();
428
+
for(int iSpw = 0; iSpw < pars_.nSpw_; iSpw++)
429
+
chanFreqCol.put(iSpw, pars_.freqs(iSpw));
430
+
auto& chanWidthCol = spwSubTablecols_p->chanWidth();
431
+
for(int iSpw = 0; iSpw < pars_.nSpw_; iSpw++)
432
+
chanWidthCol.put(iSpw, Vector<double>(pars_.nChan_(iSpw), pars_.df_(iSpw)));
433
+
auto& effBWCol = spwSubTablecols_p->effectiveBW();
434
+
for(int iSpw = 0; iSpw < pars_.nSpw_; iSpw++)
435
+
effBWCol.put(iSpw, Vector<double>(pars_.nChan_(iSpw), pars_.df_(iSpw)));
436
+
auto& resolutionCol = spwSubTablecols_p->resolution();
437
+
for(int iSpw = 0; iSpw < pars_.nSpw_; iSpw++)
438
+
resolutionCol.put(iSpw, Vector<double>(pars_.nChan_(iSpw), pars_.df_(iSpw)));
439
+
426
440
427
441
// Generating DD Subtable. There is only one polarizations,
428
442
// therefore number of DDs = number of SPWs.
429
443
TableDesc ddTD = MSDataDescription::requiredTableDesc();
430
444
SetupNewTable ddSetup("ddSubtable", ddTD, Table::New);
431
445
ddSubTable_p = Table(ddSetup, Table::Memory, pars_.nSpw_, true);
432
446
ddSubTablecols_p.reset(new MSDataDescColumns(ddSubTable_p));
433
447
auto spwCol = ddSubTablecols_p->spectralWindowId();
434
448
for (int i=0; i < pars_.nSpw_; i++)
435
449
spwCol.put(i, i);