Ignore:
Timestamp:
07/27/07 02:00:22 (17 years ago)
Author:
TakTsutsumi
Message:

merged from NRAO version of ASAP 2.1 with ALMA specific modifications

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/alma/src/STWriter.cpp

    r1305 r1387  
    116116
    117117  // Extract the header from the table.
     118  // this is a little different from what I have done
     119  // before. Need to check with the Offline User Test data
    118120  STHeader hdr = in->getHeader();
    119121  //const Int nPol  = hdr.npol;
     
    123125  Vector<uInt> nPol(nIF),nChan(nIF);
    124126  Vector<Bool> havexpol(nIF);
     127  String fluxUnit = hdr.fluxunit;
     128
    125129  nPol = 0;nChan = 0; havexpol = False;
    126130  for (uint i=0;i<ifs.size();++i) {
     
    137141                               hdr.antennaname, hdr.antennaposition,
    138142                               hdr.obstype, hdr.equinox, hdr.freqref,
    139                                nChan, nPol, havexpol, False);
     143                               nChan, nPol, havexpol, False, fluxUnit);
    140144  if ( status ) {
    141145    throw(AipsError("Failed to create output file"));
     
    265269  pushLog(String(oss));
    266270  writer_->close();
    267 
     271  //if MS2 delete POINTING table exists and copy the one in the keyword
     272  if ( format_ == "MS2" ) {
     273    replacePtTab(table, filename);
     274  }
    268275  return 0;
    269276}
     
    315322}
    316323
    317 
    318 }
     324// For writing MS data, if there is the reference to
     325// original pointing table it replace it by it.
     326void STWriter::replacePtTab (const Table& tab, const std::string& fname)
     327{
     328  String oldPtTabName = fname;
     329  oldPtTabName.append("/POINTING");
     330  if ( tab.keywordSet().isDefined("POINTING") ) {
     331    String PointingTab = tab.keywordSet().asString("POINTING");
     332    if ( Table::isReadable(PointingTab) ) {
     333      Table newPtTab(PointingTab, Table::Old);
     334      newPtTab.copy(oldPtTabName, Table::New);
     335      ostringstream oss;
     336      oss << "STWriter: copied  " <<PointingTab  << " to " << fname;
     337      pushLog(String(oss));
     338    }
     339  }
     340}
     341
     342}
Note: See TracChangeset for help on using the changeset viewer.