Ignore:
Timestamp:
08/04/11 15:42:43 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: No

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...

Tuning NROFiller.
Filler is about 6 times faster than before (~660sec->~110sec).

File:
1 edited

Legend:

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

    r2262 r2263  
    531531                            String &srcname,
    532532                            String &fieldname,
    533                             Array<Float> &spectra,
    534                             Array<uChar> &flagtra,
    535                             Array<Float> &tsys,
    536                             Array<Double> &direction,
     533                            Vector<Float> &spectra,
     534                            Vector<uChar> &flagtra,
     535                            Vector<Float> &tsys,
     536                            Vector<Double> &direction,
    537537                            Float &azimuth,
    538538                            Float &elevation,
     
    548548                            Float &winddir,     
    549549                            Double &srcvel,
    550                             Array<Double> &propermotion,
     550                            Vector<Double> &propermotion,
    551551                            Vector<Double> &srcdir,
    552                             Array<Double> &scanrate )
     552                            Vector<Double> &scanrate )
    553553{
    554554  // DEBUG
     
    589589
    590590  // restfreq (for MOLECULE_ID)
    591   Vector<Double> rf( IPosition( 1, 1 ) ) ;
    592   rf( 0 ) = record->FREQ0 ;
    593   restfreq = rf ;
     591  if ( restfreq.size() != 1 )
     592    restfreq.resize( 1 ) ;
     593  restfreq[0] = record->FREQ0 ;
    594594  //cout << "restfreq = " << rf << endl ;
    595595
     
    617617  // spectra
    618618  vector<double> spec = dataset_->getSpectrum( irow ) ;
    619   Array<Float> sp( IPosition( 1, spec.size() ) ) ;
     619  if ( spectra.size() != spec.size() )
     620    spectra.resize( spec.size() ) ;
    620621  int index = 0 ;
    621   for ( Array<Float>::iterator itr = sp.begin() ; itr != sp.end() ; itr++ ) {
     622  for ( Vector<Float>::iterator itr = spectra.begin() ; itr != spectra.end() ; itr++ ) {
    622623    *itr = spec[index++] ;
    623624  }
    624   spectra = sp ;
    625625  //cout << "spec.size() = " << spec.size() << endl ;
    626626 
    627627  // flagtra
    628   Array<uChar> flag( spectra.shape() ) ;
    629   flag.set( 0 ) ;
    630   flagtra = flag ;
     628  if ( flagtra.size() != spectra.size() )
     629    flagtra.resize( spectra.nelements() ) ;
     630  flagtra.set( 0 ) ;
    631631  //cout << "flag.size() = " << flag.size() << endl ;
    632632
    633633  // tsys
    634   Array<Float> tmp( IPosition( 1, 1 ), record->TSYS ) ;
    635   tsys = tmp ;
     634  if ( tsys.size() != 1 )
     635    tsys.resize( 1 ) ;
     636  tsys[0] = record->TSYS ;
    636637  //cout << "tsys[0] = " << tsys[0] << endl ;
    637638
     
    693694
    694695  // propermotion
    695   Array<Double> srcarr( IPosition( 1, 2 ) ) ;
    696   srcarr = 0.0 ;
    697   propermotion = srcarr ;
    698   //cout << "propermotion = [" << propermotion[0] << ", " << propermotion[1] << "]" << endl ;
     696  // do nothing
    699697
    700698  // srcdir
     
    703701
    704702  // scanrate
    705   Array<Double> sr( IPosition( 1, 1 ) ) ;
    706   sr = 0.0 ;
    707   scanrate = sr ;
    708   //cout << "scanrate = " << scanrate[0] << endl ;
     703  // do nothing
    709704
    710705  return 0 ;
Note: See TracChangeset for help on using the changeset viewer.