Changeset 2264 for branches/parallel


Ignore:
Timestamp:
08/08/11 13:30:12 (13 years ago)
Author:
KohjiNakamura
Message:

optimize getScanInfo method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/parallel/external-alma/atnf/PKSIO/NROReader.cc

    r2263 r2264  
    552552                            Vector<Double> &scanrate )
    553553{
     554  static const IPosition oneByOne( 1, 1 );
     555
    554556  // DEBUG
    555557  //cout << "NROReader::getScanInfo()  irow = " << irow << endl ;
     
    589591
    590592  // restfreq (for MOLECULE_ID)
    591   if ( restfreq.size() != 1 )
    592     restfreq.resize( 1 ) ;
     593  restfreq.resize( oneByOne ) ;
    593594  restfreq[0] = record->FREQ0 ;
    594595  //cout << "restfreq = " << rf << endl ;
     
    617618  // spectra
    618619  vector<double> spec = dataset_->getSpectrum( irow ) ;
    619   if ( spectra.size() != spec.size() )
    620     spectra.resize( spec.size() ) ;
     620  spectra.resize( spec.size() ) ;
    621621  int index = 0 ;
    622622  for ( Vector<Float>::iterator itr = spectra.begin() ; itr != spectra.end() ; itr++ ) {
     
    626626 
    627627  // flagtra
    628   if ( flagtra.size() != spectra.size() )
    629     flagtra.resize( spectra.nelements() ) ;
     628  flagtra.resize( spectra.nelements() ) ;
    630629  flagtra.set( 0 ) ;
    631630  //cout << "flag.size() = " << flag.size() << endl ;
    632631
    633632  // tsys
    634   if ( tsys.size() != 1 )
    635     tsys.resize( 1 ) ;
     633  tsys.resize( oneByOne ) ;
    636634  tsys[0] = record->TSYS ;
    637635  //cout << "tsys[0] = " << tsys[0] << endl ;
Note: See TracChangeset for help on using the changeset viewer.