Ignore:
Timestamp:
08/07/09 15:49:27 (15 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-729, CAS-1147

Ready to Release: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...

Use LogIO instead of std::cout and std::cerr.


File:
1 edited

Legend:

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

    r1610 r1616  
    3131#include <casa/Containers/RecordField.h>
    3232#include <casa/Utilities/GenSort.h>
     33#include <casa/Logging/LogIO.h>
    3334
    3435#include <tables/Tables/TableParse.h>
     
    10671068void Scantable::addFit( const STFitEntry& fit, int row )
    10681069{
    1069   cout << mfitidCol_(uInt(row)) << endl;
     1070  //cout << mfitidCol_(uInt(row)) << endl;
     1071  LogIO os( LogOrigin( "Scantable", "addFit()", WHERE ) ) ;
     1072  os << mfitidCol_(uInt(row)) << LogIO::POST ;
    10701073  uInt id = fitTable_.addEntry(fit, mfitidCol_(uInt(row)));
    10711074  mfitidCol_.put(uInt(row), id);
     
    11011104      Table subt = t( t.col("SCAN") == scanlist[i]+1 );
    11021105      if (subt.nrow()==0) {
    1103         cerr <<"Scan "<<scanlist[i]<<" cannot be found in the scantable."<<endl;
     1106        //cerr <<"Scan "<<scanlist[i]<<" cannot be found in the scantable."<<endl;
     1107        LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ;
     1108        os <<LogIO::WARN<<"Scan "<<scanlist[i]<<" cannot be found in the scantable."<<LogIO::POST;
    11041109        ret = 1;
    11051110        break;
     
    11131118          Table subt2 = t( t.col("SCAN") == scanlist[i+1]+1 );
    11141119          if ( subt2.nrow() == 0) {
    1115             cerr<<"Scan "<<scanlist[i+1]<<" cannot be found in the scantable."<<endl;
     1120            LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ;
     1121
     1122            //cerr<<"Scan "<<scanlist[i+1]<<" cannot be found in the scantable."<<endl;
     1123            os<<LogIO::WARN<<"Scan "<<scanlist[i+1]<<" cannot be found in the scantable."<<LogIO::POST;
    11161124            ret = 1;
    11171125            break;
     
    11231131          if (scan1seqn == 1 && scan2seqn == 2) {
    11241132            if (laston1 == laston2) {
    1125               cerr<<"A valid scan pair ["<<scanlist[i]<<","<<scanlist[i+1]<<"]"<<endl;
     1133              LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ;
     1134              //cerr<<"A valid scan pair ["<<scanlist[i]<<","<<scanlist[i+1]<<"]"<<endl;
     1135              os<<"A valid scan pair ["<<scanlist[i]<<","<<scanlist[i+1]<<"]"<<LogIO::POST;
    11261136              i +=1;
    11271137            }
    11281138            else {
    1129               cerr<<"Incorrect scan pair ["<<scanlist[i]<<","<<scanlist[i+1]<<"]"<<endl;
     1139              LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ;
     1140              //cerr<<"Incorrect scan pair ["<<scanlist[i]<<","<<scanlist[i+1]<<"]"<<endl;
     1141              os<<LogIO::WARN<<"Incorrect scan pair ["<<scanlist[i]<<","<<scanlist[i+1]<<"]"<<LogIO::POST;
    11301142            }
    11311143          }
    11321144          else if (scan1seqn==2 && scan2seqn == 1) {
    11331145            if (laston1 == laston2) {
    1134               cerr<<"["<<scanlist[i]<<","<<scanlist[i+1]<<"] is a valid scan pair but in incorrect order."<<endl;
     1146              LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ;
     1147              //cerr<<"["<<scanlist[i]<<","<<scanlist[i+1]<<"] is a valid scan pair but in incorrect order."<<endl;
     1148              os<<LogIO::WARN<<"["<<scanlist[i]<<","<<scanlist[i+1]<<"] is a valid scan pair but in incorrect order."<<LogIO::POST;
    11351149              ret = 1;
    11361150              break;
     
    11381152          }
    11391153          else {
    1140             cerr<<"The other scan for  "<<scanlist[i]<<" appears to be missing. Check the input scan numbers."<<endl;
     1154            LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ;
     1155            //cerr<<"The other scan for  "<<scanlist[i]<<" appears to be missing. Check the input scan numbers."<<endl;
     1156            os<<LogIO::WARN<<"The other scan for  "<<scanlist[i]<<" appears to be missing. Check the input scan numbers."<<LogIO::POST;
    11411157            ret = 1;
    11421158            break;
     
    11451161      }
    11461162      else {
    1147         cerr<<"The scan does not appear to be standard obsevation."<<endl;
     1163        LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ;
     1164        //cerr<<"The scan does not appear to be standard obsevation."<<endl;
     1165        os<<LogIO::WARN<<"The scan does not appear to be standard obsevation."<<LogIO::POST;
    11481166      }
    11491167    //if ( i >= nscan ) break;
     
    11511169  }
    11521170  else {
    1153     cerr<<"No reference to GBT_GO table."<<endl;
     1171    LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ;
     1172    //cerr<<"No reference to GBT_GO table."<<endl;
     1173    os<<LogIO::WARN<<"No reference to GBT_GO table."<<LogIO::POST;
    11541174    ret = 1;
    11551175  }
     
    11851205    nmax = nmin ;
    11861206    nmin = tmp ;
    1187     cout << "Swap values. Applied range is ["
    1188          << nmin << ", " << nmax << "]" << endl ;
     1207    LogIO os( LogOrigin( "Scantable", "reshapeSpectrum()", WHERE ) ) ;
     1208    os << "Swap values. Applied range is ["
     1209       << nmin << ", " << nmax << "]" << LogIO::POST ;
    11891210  }
    11901211 
     
    11981219    if ( nmin == 0 ) {
    11991220      // nothing to do
    1200       cout << "Whole range is selected. Nothing to do." << endl ;
     1221      LogIO os( LogOrigin( "Scantable", "reshapeSpectrum()", WHERE ) ) ;
     1222      os << "Whole range is selected. Nothing to do." << LogIO::POST ;
    12011223      return ;
    12021224    }
    12031225    else {
    1204       cout << "Specified maximum exceeds nChan. Applied range is ["
    1205            << nmin << ", " << nChan-1 << "]." << endl ;
     1226      LogIO os( LogOrigin( "Scantable", "reshapeSpectrum()", WHERE ) ) ;
     1227      os << "Specified maximum exceeds nChan. Applied range is ["
     1228         << nmin << ", " << nChan-1 << "]." << LogIO::POST ;
    12061229      nmax = nChan - 1 ;
    12071230    }
     
    12561279void asap::Scantable::regridChannel( int nChan, double dnu )
    12571280{
    1258   cout << "Regrid abcissa with channel number " << nChan << " and spectral resoultion " << dnu << "Hz." << endl ;
     1281  LogIO os( LogOrigin( "Scantable", "regridChannel()", WHERE ) ) ;
     1282  os << "Regrid abcissa with channel number " << nChan << " and spectral resoultion " << dnu << "Hz." << LogIO::POST ;
    12591283  // assumed that all rows have same nChan
    12601284  Vector<Float> arr = specCol_( 0 ) ;
     
    12631287  // if oldsize == nChan, nothing to do
    12641288  if ( oldsize == nChan ) {
    1265     cout << "Specified channel number is same as current one. Nothing to do." << endl ;
     1289    os << "Specified channel number is same as current one. Nothing to do." << LogIO::POST ;
    12661290    return ;
    12671291  }
     
    12691293  // if oldChan < nChan, unphysical operation
    12701294  if ( oldsize < nChan ) {
    1271     cout << "Unphysical operation. Nothing to do." << endl ;
     1295    os << "Unphysical operation. Nothing to do." << LogIO::POST ;
    12721296    return ;
    12731297  }
Note: See TracChangeset for help on using the changeset viewer.