Changeset 2524
- Timestamp:
- 05/15/12 19:00:13 (13 years ago)
- Location:
- branches/hpc33/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/hpc33/src/STIdxIter.cpp
r2519 r2524 116 116 } 117 117 118 Vector<uInt> ArrayIndexIteratorNormal::getRows( )118 Vector<uInt> ArrayIndexIteratorNormal::getRows( StorageInitPolicy policy ) 119 119 { 120 120 Vector<uInt> v = current() ; … … 130 130 pos_m[0] = len ; 131 131 p = storage_m.storage() ; 132 return Vector<uInt>( pos_m, p ) ;132 return Vector<uInt>( pos_m, p, policy ) ; 133 133 } 134 134 … … 159 159 } 160 160 161 Vector<uInt> ArrayIndexIteratorAcc::getRows( )161 Vector<uInt> ArrayIndexIteratorAcc::getRows( StorageInitPolicy policy ) 162 162 { 163 163 Vector<uInt> v = current() ; … … 177 177 } 178 178 pos_m[0] = len_m[0] ; 179 return Vector<uInt>( pos_m, storage_m.storage() ) ;179 return Vector<uInt>( pos_m, storage_m.storage(), policy ) ; 180 180 } 181 181 -
branches/hpc33/src/STIdxIter.h
r2519 r2524 39 39 Bool pastEnd() ; 40 40 virtual void next() = 0 ; 41 virtual Vector<uInt> getRows( ) = 0 ;41 virtual Vector<uInt> getRows( StorageInitPolicy policy=COPY ) = 0 ; 42 42 protected: 43 43 IndexIterator *iter_m ; … … 55 55 vector< vector<uInt> > idlist=vector< vector<uInt> >() ) ; 56 56 void next() ; 57 Vector<uInt> getRows( ) ;57 Vector<uInt> getRows( StorageInitPolicy policy=COPY ) ; 58 58 private: 59 59 Block<uInt> storage_m ; … … 67 67 vector< vector<uInt> > idlist=vector< vector<uInt> >() ) ; 68 68 void next() ; 69 Vector<uInt> getRows( ) ;69 Vector<uInt> getRows( StorageInitPolicy policy=COPY ) ; 70 70 private: 71 71 Int isChanged( Vector<uInt> &idx ) ; … … 92 92 void next() { iter_m->next() ; } ; 93 93 vector<uInt> getRowsSTL() { return tovector( iter_m->getRows() ) ; } ; 94 Vector<uInt> getRows( ) { return iter_m->getRows() ; } ;94 Vector<uInt> getRows( StorageInitPolicy policy=COPY ) { return iter_m->getRows( policy ) ; } ; 95 95 protected: 96 96 ArrayIndexIterator *iter_m ; -
branches/hpc33/src/STMath.cpp
r2519 r2524 3861 3861 } 3862 3862 else { 3863 // double t0 = mathutil::gettimeofday_sec() ; 3863 // double t0, t1 ; 3864 // t0 = mathutil::gettimeofday_sec() ; 3864 3865 vector<bool> masks = s->getMask( 0 ) ; 3865 3866 … … 3904 3905 } 3905 3906 } 3906 //cout << "gaplist = " << gaplist << endl ; 3907 gaplist[glidx] = nrow - 1 ; 3908 glidx++ ; 3909 // cout << "gaplist = " << Vector<uInt>(IPosition(1,glidx),gaplist.storage()) << endl ; 3907 3910 uInt newid = 0 ; 3908 for ( uInt i = 0 ; i < nrow ; i++ ) { 3909 soff->scanCol_.put( i, newid ) ; 3910 if ( i == gaplist[newid] ) { 3911 newid++ ; 3912 } 3913 } 3914 //cout << "new scancol = " << scanCol.getColumn() << endl ; 3911 Vector<uInt> newscanno( nrow, 0 ) ; 3912 uInt *p = newscanno.data() ; 3913 IPosition pos( 1 ) ; 3914 for ( uInt i = 1 ; i < glidx ; i++ ) { 3915 pos[0] = gaplist[i] - gaplist[i-1] ; 3916 Vector<uInt> scnslice( pos, p+gaplist[i-1]+1, SHARE ) ; 3917 scnslice = i ; 3918 } 3919 soff->scanCol_.putColumn( newscanno ) ; 3920 // cout << "new scancol = " << soff->scanCol_.getColumn() << endl ; 3921 // double t2 = mathutil::gettimeofday_sec() ; 3915 3922 vector< CountedPtr<Scantable> > tmp( 1, soff ) ; 3916 3923 CountedPtr<Scantable> aoff = average( tmp, masks, "TINT", "SCAN" ) ; 3924 // cout << "elapsed time for average(): " << mathutil::gettimeofday_sec()-t2 << " sec" << endl ; 3917 3925 //cout << "aoff.nrow = " << aoff->nrow() << endl ; 3918 3926 s->unsetSelection() ; 3919 3927 sel.reset() ; 3920 //types.clear() ; 3921 // double t1 = mathutil::gettimeofday_sec() ; 3928 // t1 = mathutil::gettimeofday_sec() ; 3922 3929 // cout << "elapsed time for off averaging: " << t1-t0 << " sec" << endl ; 3923 3930 … … 3928 3935 CountedPtr<Scantable> out = getScantable( s, true ) ; 3929 3936 insitu_ = insitu ; 3930 //types.push_back( SrcType::PSON ) ;3931 3937 types[0] = SrcType::PSON ; 3932 3938 sel.setTypes( types ) ; … … 3935 3941 s->unsetSelection() ; 3936 3942 sel.reset() ; 3937 //types.clear() ;3938 3943 // t1 = mathutil::gettimeofday_sec() ; 3939 3944 // cout << "elapsed time for preparing output table: " << t1-t0 << " sec" << endl ; … … 3961 3966 sel.setTaQL( ss.str() ) ; 3962 3967 aoff->setSelection( sel ) ; 3963 Vector<uInt> rows = iter->getRows( ) ;3968 Vector<uInt> rows = iter->getRows( SHARE ) ; 3964 3969 calibrateALMA( out, aoff, rows ) ; 3965 3970 aoff->unsetSelection() ; … … 4615 4620 // double tref = getMJD( reftime ) ; 4616 4621 double tref = reftime ; 4617 vector<float> sp0= s->getSpectrum( idx[0] ) ;4622 sp = s->getSpectrum( idx[0] ) ; 4618 4623 vector<float> sp1 = s->getSpectrum( idx[1] ) ; 4619 sp.resize( sp0.size()) ;4620 for ( unsigned int i = 0 ; i < sp 0.size() ; i++ ) {4621 sp[i] = ( sp1[i] - sp 0[i] ) / ( t1 - t0 ) * ( tref - t0 ) + sp0[i] ;4624 double tfactor = ( tref - t0 ) / ( t1 - t0 ) ; 4625 for ( unsigned int i = 0 ; i < sp.size() ; i++ ) { 4626 sp[i] = ( sp1[i] - sp[i] ) * tfactor + sp[i] ; 4622 4627 } 4623 4628 }
Note:
See TracChangeset
for help on using the changeset viewer.