Changeset 1375 for trunk


Ignore:
Timestamp:
07/12/07 11:57:05 (17 years ago)
Author:
mar637
Message:

export WCS info to ASCII file, this required returng const& of STSubTables. This partly addresses Ticket #110

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STAsciiWriter.cpp

    r1295 r1375  
    120120    addLine(of, "Beam No", rec.asuInt("BEAMNO"));
    121121    addLine(of, "IF No", rec.asuInt("IFNO"));
     122    String wcs = stable.frequencies().print(rec.asuInt("FREQ_ID"), True);
     123    addLine(of, "WCS", wcs);
     124    addLine(of, "Rest Freq.",
     125            stable.molecules().getRestFrequency(rec.asuInt("MOLECULE_ID") ));
    122126    of << setfill('#') << setw(70) << "" << setfill(' ') << endl;
    123127
  • trunk/src/STFrequencies.cpp

    r1360 r1375  
    274274}
    275275
    276 std::string STFrequencies::print( int id )
     276std::string STFrequencies::print( int id, Bool strip ) const
    277277{
    278278  Table t;
     
    284284    const TableRecord& rec = row.get(i);
    285285    oss <<  setw(8)
    286     << t.keywordSet().asString("FRAME") << setw(16) << setprecision(8)
    287     << rec.asDouble("REFVAL") << setw(7)
    288     << rec.asDouble("REFPIX") << setw(12)
    289     << rec.asDouble("INCREMENT") << endl;
    290   }
    291   return String(oss);
     286        << t.keywordSet().asString("FRAME") << setw(16) << setprecision(8)
     287        << rec.asDouble("REFVAL") << setw(7)
     288        << rec.asDouble("REFPIX")
     289        << setw(12)
     290        << rec.asDouble("INCREMENT");
     291  }
     292  String outstr(oss);
     293  if (strip) {
     294    int f = outstr.find_first_not_of(' ');
     295    int l = outstr.find_last_not_of(' ', outstr.size());
     296    if (f < 0) {
     297      f = 0;
     298    }
     299    if ( l < f  || l < f ) {
     300      l = outstr.size();
     301    }
     302    return outstr.substr(f,l);
     303  }
     304  return outstr;
    292305}
    293306
  • trunk/src/STFrequencies.h

    r1360 r1375  
    145145   * @return a string
    146146   */
    147   std::string print(int id=-1);
     147  std::string print(int id=-1, casa::Bool strip=casa::False) const;
    148148
    149149  std::vector<std::string> getInfo() const;
  • trunk/src/Scantable.cpp

    r1360 r1375  
    837837        oss << setw(10) << "";
    838838        oss << setw(3) << std::right << irec.asuInt("IFNO") << std::left
    839             << setw(2) << "" << frequencies().print(irec.asuInt("FREQ_ID"));
     839            << setw(2) << "" << frequencies().print(irec.asuInt("FREQ_ID"))
     840            << endl;
    840841
    841842        ++iiter;
  • trunk/src/Scantable.h

    r1360 r1375  
    361361
    362362  STFrequencies& frequencies() { return freqTable_; }
     363  const STFrequencies& frequencies() const { return freqTable_; }
    363364  STWeather& weather() { return weatherTable_; }
     365  const STWeather& weather() const { return weatherTable_; }
    364366  STFocus& focus() { return focusTable_; }
     367  const STFocus& focus() const { return focusTable_; }
    365368  STTcal& tcal() { return tcalTable_; }
     369  const STTcal& tcal() const { return tcalTable_; }
    366370  STMolecules& molecules() { return moleculeTable_; }
     371  const STMolecules& molecules() const { return moleculeTable_; }
    367372  STHistory& history() { return historyTable_; }
     373  const STHistory& history() const { return historyTable_; }
    368374  STFit& fit() { return fitTable_; }
     375  const STFit& fit() const { return fitTable_; }
    369376
    370377  std::vector<std::string> columnNames() const;
Note: See TracChangeset for help on using the changeset viewer.