Changeset 2938 for trunk/src


Ignore:
Timestamp:
05/02/14 19:43:14 (11 years ago)
Author:
Kana Sugimoto
Message:

New Development: Yes

JIRA Issue: Yes (CAS-6486)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs: unit tests of sdlist

Put in Release Notes: Yes

Module(s): sdlist, scantable.summary()

Description: Modified Frequency listing of Scantable::summary. It now lists channel 0 frequency and IF center frequency, instead of refval and refpix.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.cpp

    r2908 r2938  
    11101110  Block< Vector<uInt> > ifNos(nfid), polNos(nfid);
    11111111  Vector<Int> fIdchans(nfid,-1);
     1112  Vector<Double> fIdfreq0(nfid,-1);
     1113  Vector<Double> fIdfcent(nfid,-1);
    11121114  map<uInt, Int> fidMap;  // (FREQ_ID, row # in FREQ subtable) pair
    11131115  for (Int i=0; i < nfid; i++){
     
    11891191      fIdchans(ftabRow)=(*spec).shape()(0);
    11901192    }
     1193    if (fIdfreq0(ftabRow) < 0 ) {
     1194      SpectralCoordinate spc = frequencies().getSpectralCoordinate(ftabRow);
     1195      Double fs, fe;
     1196      spc.toWorld(fs, 0);
     1197      spc.toWorld(fe, fIdchans(ftabRow)-1);
     1198      fIdfreq0(ftabRow) = fs;
     1199      fIdfcent(ftabRow) = 0.5 * ( fs + fe );
     1200    }
    11911201    // Should keep ifNos and polNos form the previous SCANNO
    11921202    if ( !anyEQ(ifNos[ftabRow],ifNoCol(0)) ) {
     
    12271237        RORecordFieldPtr< Array<Float> > spec(rec, "SPECTRA");
    12281238        fIdchans(ftabRow) = (*spec).shape()(0);
     1239      }
     1240      if (fIdfreq0(ftabRow) < 0 ) {
     1241        SpectralCoordinate spc = frequencies().getSpectralCoordinate(ftabRow);
     1242        Double fs, fe;
     1243        spc.toWorld(fs, 0);
     1244        spc.toWorld(fe, fIdchans(ftabRow)-1);
     1245        fIdfreq0(ftabRow) = fs;
     1246        fIdfcent(ftabRow) = 5.e-1 * ( fs + fe );
    12291247      }
    12301248      if ( !anyEQ(ifNos[ftabRow],ifNoCol(i)) ) {
     
    12741292  // List FRECUENCIES Table (using STFrequencies.print may be slow)
    12751293  oss << "FREQUENCIES: " << nfreq << endl;
    1276   oss << std::right << setw(5) << "ID" << setw(2) << ""
    1277       << std::left  << setw(5) << "IFNO" << setw(2) << ""
     1294//   oss << std::right << setw(5) << "ID" << setw(2) << ""
     1295//       << std::left  << setw(5) << "IFNO" << setw(2) << ""
     1296//       << setw(8) << "Frame"
     1297//       << setw(16) << "RefVal"
     1298//       << setw(7) << "RefPix"
     1299//       << setw(15) << "Increment"
     1300//       << setw(9) << "Channels"
     1301//       << setw(6) << "POLNOs" << endl;
     1302//   Int tmplen;
     1303//   for (Int i=0; i < nfid; i++){
     1304//     // List row=i of FREQUENCIES subtable
     1305//     ifNos[i].shape(tmplen);
     1306//     if (tmplen >= 1) {
     1307//       oss << std::right << setw(5) << ftabIds(i) << setw(2) << ""
     1308//        << setw(3) << ifNos[i](0) << setw(1) << ""
     1309//        << std::left << setw(46) << frequencies().print(ftabIds(i))
     1310//        << setw(2) << ""
     1311//        << std::right << setw(8) << fIdchans[i] << setw(2) << ""
     1312//        << std::left << polNos[i];
     1313//       if (tmplen > 1) {
     1314//      oss  << " (" << tmplen << " chains)";
     1315//       }
     1316//       oss << endl;
     1317//     }
     1318  oss << std::right << setw(4) << "ID" << setw(2) << ""
     1319      << std::left  << setw(9) << "IFNO(SPW)" << setw(2) << ""
     1320      << setw(8) << "#Chans"
    12781321      << setw(8) << "Frame"
    1279       << setw(16) << "RefVal"
    1280       << setw(7) << "RefPix"
    1281       << setw(15) << "Increment"
    1282       << setw(9) << "Channels"
     1322      << setw(12) << "Ch0[MHz]"
     1323      << setw(14) << "ChanWid[kHz]"
     1324      << setw(14) << "Center[MHz]"
    12831325      << setw(6) << "POLNOs" << endl;
    12841326  Int tmplen;
     
    12861328    // List row=i of FREQUENCIES subtable
    12871329    ifNos[i].shape(tmplen);
     1330    Double refpix, refval, increment ;
    12881331    if (tmplen >= 1) {
    1289       oss << std::right << setw(5) << ftabIds(i) << setw(2) << ""
    1290           << setw(3) << ifNos[i](0) << setw(1) << ""
    1291           << std::left << setw(46) << frequencies().print(ftabIds(i))
    1292           << setw(2) << ""
    1293           << std::right << setw(8) << fIdchans[i] << setw(2) << ""
     1332      freqTable_.getEntry( refpix, refval, increment, ftabIds(i) ) ;
     1333      oss << std::right << setw(4) << ftabIds(i) << setw(2) << ""
     1334          << std::left << setw(9) << ifNos[i](0) << setw(2) << ""
     1335          << std::right << setw(6) << fIdchans[i] << setw(2) << ""
     1336          << setw(6) << frequencies().getFrameString(true)
     1337          << setw(2) << ""
     1338          << setw(10) << std::setprecision(9) << (fIdfreq0[i]*1.e-6) << setw(2) << ""
     1339          << setw(12) << (increment*1.e-3) << setw(2) << ""
     1340          << setw(12) << (fIdfcent[i]*1.e-6) << setw(2) << ""
    12941341          << std::left << polNos[i];
    12951342      if (tmplen > 1) {
Note: See TracChangeset for help on using the changeset viewer.