Ignore:
Timestamp:
09/08/11 19:35:40 (13 years ago)
Author:
ShinnosukeKawakami
Message:

merged parallel branch to trunk

Location:
trunk/external-alma
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma

  • trunk/external-alma/atnf/PKSIO/NROReader.cc

    r2261 r2289  
    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 )
    553 {
     552                            Vector<Double> &scanrate )
     553{
     554  static const IPosition oneByOne( 1, 1 );
     555
    554556  // DEBUG
    555557  //cout << "NROReader::getScanInfo()  irow = " << irow << endl ;
     
    589591
    590592  // restfreq (for MOLECULE_ID)
    591   Vector<Double> rf( IPosition( 1, 1 ) ) ;
    592   rf( 0 ) = record->FREQ0 ;
    593   restfreq = rf ;
     593  restfreq.resize( oneByOne ) ;
     594  restfreq[0] = record->FREQ0 ;
    594595  //cout << "restfreq = " << rf << endl ;
    595596
     
    617618  // spectra
    618619  vector<double> spec = dataset_->getSpectrum( irow ) ;
    619   Array<Float> sp( IPosition( 1, 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  flagtra.resize( spectra.nelements() ) ;
     629  flagtra.set( 0 ) ;
    631630  //cout << "flag.size() = " << flag.size() << endl ;
    632631
    633632  // tsys
    634   Array<Float> tmp( IPosition( 1, 1 ), record->TSYS ) ;
    635   tsys = tmp ;
     633  tsys.resize( oneByOne ) ;
     634  tsys[0] = record->TSYS ;
    636635  //cout << "tsys[0] = " << tsys[0] << endl ;
    637636
     
    693692
    694693  // propermotion
    695   Array<Double> srcarr( IPosition( 1, 2 ) ) ;
    696   srcarr = 0.0 ;
    697   propermotion = srcarr ;
    698   //cout << "propermotion = [" << propermotion[0] << ", " << propermotion[1] << "]" << endl ;
     694  // do nothing
    699695
    700696  // srcdir
     
    703699
    704700  // scanrate
    705   Array<Double> sr( IPosition( 1, 1 ) ) ;
    706   sr = 0.0 ;
    707   scanrate = sr ;
    708   //cout << "scanrate = " << scanrate[0] << endl ;
     701  // do nothing
    709702
    710703  return 0 ;
Note: See TracChangeset for help on using the changeset viewer.