Changeset 14 for trunk


Ignore:
Timestamp:
06/24/04 16:05:19 (20 years ago)
Author:
mmarquar
Message:

I am now using ArrayIterators everywhere. This gives an ENORMOUS performance boost.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDContainer.cc

    r7 r14  
    7171  aa1.reset(aa1.begin(whichIF));
    7272 
    73   uInt nChan = spec.nrow();
    74   uInt nPol  = spec.ncolumn();
    75   Vector<Float> pols(nPol);
    76   uInt chani = 0;
    77   uInt poli = 0;
     73  //Vector<Float> pols(nPol);
     74  ArrayAccessor<Float, Axis<0> > j(spec);
     75  IPosition shp0 = spectrum_.shape();
     76  IPosition shp1 = spec.shape();
     77  if ( (shp0(2) != shp1(0)) || (shp0(3) != shp1(1)) ) {
     78    cerr << "Arrays not conformant" << endl;     
     79    return False;
     80  }
     81  //uInt chani = 0;
     82  //uInt poli = 0;
    7883  // assert dimensions are the same....
    7984  for (ArrayAccessor<Float, Axis<2> > i(aa1);i != i.end(); ++i) {
    80     pols = spec.row(chani);
     85    //pols = spec.row(chani);   
     86    ArrayAccessor<Float, Axis<1> > jj(j);
    8187    for (ArrayAccessor<Float, Axis<3> > ii(i);ii != ii.end(); ++ii) {
    82       (*ii) = pols[poli];
    83       poli++;
     88      //(*ii) = pols[poli];     
     89      (*ii) = (*jj);
     90      //poli++;
     91      jj++;
    8492    }
    85     poli = 0;
    86     chani++;
     93    //poli = 0;
     94    //chani++;
     95    j++;
    8796  }
    8897  // unset flags for this spectrum, they might be set again by the
    8998  // setFlags method
     99
    90100  IPosition shp = flags_.shape();
    91101  IPosition start(4,whichBeam,whichIF,0,0);
     
    103113  aa1.reset(aa1.begin(whichIF));
    104114 
    105   uInt nChan = flag.nrow();
    106   uInt nPol  = flag.ncolumn();
    107   Vector<uChar> pols(nPol);
    108   uInt chani = 0;
    109   uInt poli = 0;
     115  ArrayAccessor<uChar, Axis<0> > j(flag);
     116  IPosition shp0 = flags_.shape();
     117  IPosition shp1 = flag.shape();
     118  if ( (shp0(2) != shp1(0)) || (shp0(3) != shp1(1)) ) {
     119    cerr << "Arrays not conformant" << endl;     
     120    return False;
     121  }
     122
    110123  // assert dimensions are the same....
    111124  for (ArrayAccessor<uChar, Axis<2> > i(aa1);i != i.end(); ++i) {
    112     pols = flag.row(chani);
     125    ArrayAccessor<uChar, Axis<1> > jj(j);
    113126    for (ArrayAccessor<uChar, Axis<3> > ii(i);ii != ii.end(); ++ii) {
    114       (*ii) = uChar(pols[poli]);
    115       poli++;
     127      (*ii) = (*jj);
     128      jj++;
    116129    }
    117     poli = 0;
    118     chani++;
     130    j++;
    119131  }
    120132}
     
    128140  // assert dimensions are the same....
    129141  uInt idx = 0;
    130  
     142
     143
    131144  for (ArrayAccessor<Float, Axis<2> > i(aa1);i != i.end(); ++i) {   
    132145    idx = 0;
     146    ArrayAccessor<Float, Axis<0> > j(tsys);
    133147    for (ArrayAccessor<Float, Axis<3> > ii(i);ii != ii.end(); ++ii) {
    134       (*ii) = tsys[idx];
    135       idx++;
     148      (*ii) = (*j);
     149      j++;
    136150    }
    137151  }
  • trunk/src/SDReader.cc

    r2 r14  
    200200        // IFno beamNo are 1-relative
    201201        // refPix = nChan/2+1 in  Integer arith.!
     202       
    202203        uInt refPix = header_.nchan/2+1;
    203204        //uInt frqslot = sdft.addFrequency(refPix, refFreq, freqInc);
     
    219220
    220221        // cerr << "SDReader::read -  after SDContainer" << endl;
    221 
     222       
    222223      }
    223224    }
     
    225226      // insert container into table/list
    226227      table_->putSDContainer(sc);
    227       cout << "Reading integration " << seqi << endl;
     228      //cout << "Reading integration " << seqi << endl;
    228229      seqi++;// next in list
    229230    }
Note: See TracChangeset for help on using the changeset viewer.