Changeset 1293 for branches


Ignore:
Timestamp:
11/06/06 21:54:21 (18 years ago)
Author:
mar637
Message:

Fix for Ticket #89. subselections of IFs weren't handled correctly.
PKSwriter needs Full IF table, can't handle e.g. just IF2.

Location:
branches/Release2.1.1/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Release2.1.1/src/STAsciiWriter.cpp

    r996 r1293  
    109109    String fName = rootName + String(onstr) + String(".txt");
    110110    ofstream of(fName.chars(), ios::trunc);
    111     int row0 = t.rowNumbers()[0];
     111    int row0 = t.rowNumbers(tab)[0];
    112112    MDirection mdir = stable.getDirection(row0);
    113113    of << setfill('#') << setw(70) << "" << setfill(' ') << endl;
  • branches/Release2.1.1/src/STWriter.cpp

    r1276 r1293  
    119119  //const Int nPol  = hdr.npol;
    120120  //const Int nChan = hdr.nchan;
    121   int nIF = in->nif();
     121  std::vector<uint> ifs = in->getIFNos();
     122  int nIF = in->nif();//ifs.size();
    122123  Vector<uInt> nPol(nIF),nChan(nIF);
    123124  Vector<Bool> havexpol(nIF);
    124   for (int i=0;i<nIF;++i) {
    125     nPol(i) = in->npol();
    126     nChan(i) = in->nchan(i);
    127     havexpol(i) = nPol(i) > 2;
     125  nPol = 0;nChan = 0; havexpol = False;
     126  for (int i=0;i<ifs.size();++i) {
     127    nPol(ifs[i]) = in->npol();
     128    nChan(ifs[i]) = in->nchan(ifs[i]);
     129    havexpol(ifs[i]) = nPol(ifs[i]) > 2;
    128130  }
    129131
     
    170172      ROScalarColumn<Double> svelCol(btable, "SRCVELOCITY");
    171173      svelCol.get(0, srcVel);
     174      ROScalarColumn<uInt> bCol(btable, "BEAMNO");
     175      beamno = bCol(0)+1;
    172176      Int cycno = 1;
    173177      while (!cycit.pastEnd() ) {
     
    181185          const TableRecord& rec = row.get(0);
    182186          ROArrayColumn<Float> specCol(itable, "SPECTRA");
     187          ifno = rec.asuInt("IFNO")+1;
    183188          uInt nchan = specCol(0).nelements();
    184189          Double cdelt,crval,crpix, restfreq;
     
    244249          }
    245250          ++count;
    246           ++ifno;
     251          //++ifno;
    247252          ++ifit;
    248253        }
     
    250255        ++cycit;
    251256      }
    252       ++beamno;
     257      //++beamno;
    253258      ++beamit;
    254259    }
Note: See TracChangeset for help on using the changeset viewer.