Source
214
214
itsDataShapes(0),
215
215
itsNCat(3)
216
216
{
217
217
// int status;
218
218
219
219
itsCreationTime = creation_time_;
220
220
221
221
itsMS = 0;
222
222
itsMSCol = 0;
223
223
itsWinFuncCol = 0;
224
+
itsNumBinCol = 0;
224
225
itsNumAntenna = 0;
225
226
itsScanNumber = 0;
226
227
227
228
//cout << "About to call createMS" << endl;
228
229
// returned value is not used here
229
230
createMS(name_,
230
231
complexData,
231
232
withCompression,
232
233
telname_,
233
234
maxNumCorr,
234
235
maxNumChan,
235
236
withCorrectedData,
236
237
useAsdmStMan4DATA);
237
238
//cout << "Back from call createMS" << endl;
238
239
239
240
}
240
241
241
242
// The destructor
242
243
ASDM2MSFiller::~ASDM2MSFiller() {
243
-
// end flushes to the MS and deletes itsMS and itsMSCol and itsWinFuncCol
244
+
// end flushes to the MS and deletes itsMS and itsMSCol and itsWinFuncCol and itsNumBinCol
244
245
end();
245
246
}
246
247
247
248
int ASDM2MSFiller::createMS(const string& msName,
248
249
bool complexData,
249
250
bool withCompression,
250
251
const string& telescopeName,
251
252
int maxNumCorr,
252
253
int maxNumChan,
253
254
bool withCorrectedData,
406
407
// Spectral Window
407
408
// need to update to add extra columns (TT)
408
409
{
409
410
//TableDesc td = MSSpectralWindow::requiredTableDesc();
410
411
TableDesc td;
411
412
StandardStMan spwStMan("SpW optional column Standard Manager");
412
413
MSSpectralWindow::addColumnToDesc (td, MSSpectralWindow::BBC_NO);
413
414
MSSpectralWindow::addColumnToDesc (td, MSSpectralWindow::ASSOC_SPW_ID);
414
415
MSSpectralWindow::addColumnToDesc (td, MSSpectralWindow::ASSOC_NATURE);
415
416
416
-
// add the non-standard SDM_WINDOW_FUNCTION columns
417
+
// add the non-standard SDM_WINDOW_FUNCTION and SDM_NUM_BIN columns
417
418
ScalarColumnDesc<String> sdmWinFuncDesc("SDM_WINDOW_FUNCTION","windowFunction value found in SDM");
418
419
sdmWinFuncDesc.setDefault("UNKNOWN");
419
420
td.addColumn(sdmWinFuncDesc);
420
421
422
+
ScalarColumnDesc<Int> sdmNumBinDesc("SDM_NUM_BIN","numBin value found in or inferred from SDM");
423
+
sdmNumBinDesc.setDefault(1);
424
+
td.addColumn(sdmNumBinDesc);
425
+
421
426
itsMS->spectralWindow().addColumn(td,spwStMan);
422
427
//SetupNewTable tabSetup(itsMS->spectralWindowTableName(),
423
428
// td, Table::New);
424
429
//itsMS->rwKeywordSet().defineTable(MS::keywordName(MS::SPECTRAL_WINDOW),
425
430
// Table(tabSetup));
426
431
427
432
}
428
433
429
434
430
435
// Syscal
563
568
mspointingCol.encoder().rwKeywordSet().asrwRecord("MEASINFO").define("Ref", dirref);
564
569
565
570
itsMS->initRefs();
566
571
567
572
itsMS->flush();
568
573
569
574
// get the SPECTRAL_WINDOW::SDM_WINDOW_FUNCTION column here so it doesn't need to be
570
575
// constructed each time a value is written to it
571
576
itsWinFuncCol = new ScalarColumn<String>(itsMS->spectralWindow(), "SDM_WINDOW_FUNCTION");
572
577
578
+
// get the SPECTRAL_WINDOW::SDM_NUM_BIN column here so it doesn't need to be
579
+
// constructed each time a value is written to it
580
+
itsNumBinCol = new ScalarColumn<Int>(itsMS->spectralWindow(), "SDM_NUM_BIN");
573
581
574
582
//cout << "\n";
575
583
{
576
584
Path tmpPath(aName);
577
585
Path tmpPath1(tmpPath);
578
586
579
587
String expanded = tmpPath1.expandedName();
580
588
Path tmpPath2(expanded);
581
589
const String absolute = tmpPath2.absoluteName();
582
590
itsMSPath = absolute;
1818
1826
const vector<double>& resolution_,
1819
1827
double total_bandwidth_,
1820
1828
int net_sideband_,
1821
1829
int bbc_no_,
1822
1830
int if_conv_chain_,
1823
1831
int freq_group_,
1824
1832
const string& freq_group_name_,
1825
1833
int num_assoc_,
1826
1834
const vector<int>& assoc_sp_id_,
1827
1835
const vector<string>& assoc_nature_,
1828
-
const string& windowFunction_) {
1836
+
const string& windowFunction_,
1837
+
int numBin_) {
1829
1838
1830
1839
MSSpectralWindow msspwin = itsMS -> spectralWindow();
1831
1840
MSSpWindowColumns msspwinCol(msspwin);
1832
1841
1833
1842
Vector<Double> chanFreq(IPosition(1, num_chan_), const_cast<double *>(&chan_freq_[0]), SHARE);
1834
1843
Vector<Double> chanWidth(IPosition(1, num_chan_), const_cast<double *>(&chan_width_[0]), SHARE);
1835
1844
Vector<Double> effectiveBW(IPosition(1, num_chan_), const_cast<double *>(&effective_bw_[0]), SHARE);
1836
1845
Vector<Double> resolution(IPosition(1, num_chan_), const_cast<double *>(&resolution_[0]), SHARE);
1837
1846
uInt crow;
1838
1847
1869
1878
iAssocNature++)
1870
1879
assocNature(iAssocNature) = assoc_nature_[iAssocNature];
1871
1880
msspwinCol.assocNature().put(crow, assocNature);
1872
1881
}
1873
1882
1874
1883
msspwinCol.flagRow().put(crow, false);
1875
1884
1876
1885
// non-standard SDM_WINDOW_FUNCTION column
1877
1886
itsWinFuncCol->put(crow, windowFunction_);
1878
1887
1888
+
// non-standard SDM_NUM_BIN column
1889
+
itsNumBinCol->put(crow, numBin_);
1890
+
1879
1891
//msspwin.flush();
1880
1892
// cout << "\n";
1881
1893
return crow;
1882
1894
}
1883
1895
1884
1896
1885
1897
// Adds a single state record in the table STATE.
1886
1898
void ASDM2MSFiller::addState(bool sig_,
1887
1899
bool ref_,
1888
1900
double cal_,
2235
2247
2236
2248
void ASDM2MSFiller::end() {
2237
2249
if (itsMSCol) {
2238
2250
delete itsMSCol;
2239
2251
itsMSCol = 0;
2240
2252
}
2241
2253
if (itsWinFuncCol) {
2242
2254
delete itsWinFuncCol;
2243
2255
itsWinFuncCol = 0;
2244
2256
}
2257
+
if (itsNumBinCol) {
2258
+
delete itsNumBinCol;
2259
+
itsNumBinCol = 0;
2260
+
}
2245
2261
if (itsMS) {
2246
2262
itsMS->flush();
2247
2263
delete itsMS;
2248
2264
itsMS = 0;
2249
2265
}
2250
2266
}
2251
2267