- Timestamp:
- 06/11/12 12:50:34 (13 years ago)
- Location:
- branches/hpc33
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/hpc33/python/asapmath.py
r2366 r2556 935 935 from asap._asap import stmath 936 936 stm = stmath() 937 ssub = scantab.get_scan( scannos ) 938 scal = scantable( stm.almacal( ssub, calmode ) ) 937 selection=selector() 938 selection.set_scans(scannos) 939 orig = scantab.get_selection() 940 scantab.set_selection(orig+selection) 941 ## ssub = scantab.get_scan( scannos ) 942 ## scal = scantable( stm.almacal( ssub, calmode ) ) 943 scal = scantable( stm.almacal( scantab, calmode ) ) 944 scantab.set_selection(orig) 939 945 return scal 940 946 -
branches/hpc33/src/STMath.cpp
r2553 r2556 3938 3938 else { 3939 3939 // double t0, t1 ; 3940 //t0 = mathutil::gettimeofday_sec() ;3940 // t0 = mathutil::gettimeofday_sec() ; 3941 3941 vector<bool> masks = s->getMask( 0 ) ; 3942 3942 3943 3943 // off scan 3944 STSelector sel = STSelector() ; 3945 vector<int> types( 1, SrcType::PSOFF ) ; 3946 //types.push_back( SrcType::PSOFF ) ; 3944 STSelector orig = s->getSelection() ; 3945 STSelector sel = orig ; 3946 vector<int> typesOrig = orig.getTypes() ; 3947 vector<int> types = typesOrig ; 3948 types.push_back( SrcType::PSOFF ) ; 3947 3949 sel.setTypes( types ) ; 3948 3950 s->setSelection( sel ) ; … … 3951 3953 // Each group must have own unique SCANNO (should be renumbered). 3952 3954 // See PIPELINE/SDCalibration.py 3953 CountedPtr<Scantable> soff = getScantable( s, false ) ; 3954 Table ttab = soff->table() ; 3955 // String tmpname = File::newUniqueName( "./", "temp" ).baseName() ; 3956 // Table ttab = s->table().copyToMemoryTable( tmpname, False ) ; 3955 bool insitu = insitu_ ; 3956 insitu_ = false ; 3957 // share off scan before average with out 3958 CountedPtr<Scantable> out = getScantable( s, false ) ; 3959 insitu_ = insitu ; 3960 Table ttab = out->table() ; 3957 3961 ROScalarColumn<Double> *timeCol = new ROScalarColumn<Double>( ttab, "TIME" ) ; 3958 3962 uInt nrow = timeCol->nrow() ; … … 3962 3966 timeSep[i] -= timeSep[i-1] ; 3963 3967 } 3964 Vector<Double> interval = soff->integrCol_.getColumn() ;3968 Vector<Double> interval = out->integrCol_.getColumn() ; 3965 3969 interval /= 86400.0 ; 3966 3970 Block<uInt> gaplist( 100 ) ; … … 3993 3997 scnslice = i ; 3994 3998 } 3995 soff->scanCol_.putColumn( newscanno ) ; 3996 // cout << "new scancol = " << soff->scanCol_.getColumn() << endl ; 3997 // double t2 = mathutil::gettimeofday_sec() ; 3998 vector< CountedPtr<Scantable> > tmp( 1, soff ) ; 3999 out->scanCol_.putColumn( newscanno ) ; 4000 // double t2 = mathutil::gettimeofday_sec() ; 4001 vector< CountedPtr<Scantable> > tmp( 1, out ) ; 3999 4002 CountedPtr<Scantable> aoff = average( tmp, masks, "TINT", "SCAN" ) ; 4000 // double t3 = mathutil::gettimeofday_sec() ; 4001 //cout << "aoff.nrow = " << aoff->nrow() << endl ; 4002 s->unsetSelection() ; 4003 sel.reset() ; 4004 // t1 = mathutil::gettimeofday_sec() ; 4005 // cout << "elapsed time for off averaging: " << t1-t0 << " sec" << endl ; 4006 // cout << " elapsed time for average(): " << t3-t2 << " sec" << endl ; 4003 // double t3 = mathutil::gettimeofday_sec() ; 4004 // cout << "aoff.nrow = " << aoff->nrow() << endl ; 4005 sel = orig ; 4006 // t1 = mathutil::gettimeofday_sec() ; 4007 // cout << "elapsed time for off averaging: " << t1-t0 << " sec" << endl ; 4008 // cout << " elapsed time for average(): " << t3-t2 << " sec" << endl ; 4007 4009 4008 4010 // on scan 4009 4011 // t0 = mathutil::gettimeofday_sec() ; 4010 bool insitu = insitu_ ; 4011 insitu_ = false ; 4012 CountedPtr<Scantable> out = getScantable( s, true ) ; 4013 insitu_ = insitu ; 4014 types[0] = SrcType::PSON ; 4012 types[types.size()-1] = SrcType::PSON ; 4015 4013 sel.setTypes( types ) ; 4016 4014 s->setSelection( sel ) ; 4017 //TableCopy::copyRows( out->table(), s->table() ) ; 4018 out->table().addRow( s->nrow() ) ; 4015 out->table().addRow( s->nrow()-out->nrow() ) ; 4019 4016 copyRows( out->table(), s->table(), 0, 0, s->nrow(), False ) ; 4020 //s->unsetSelection() ;4021 4017 sel.reset() ; 4022 4018 // t1 = mathutil::gettimeofday_sec() ; … … 4024 4020 4025 4021 // process each on scan 4026 // t0 = mathutil::gettimeofday_sec() ; 4027 // for ( int i = 0 ; i < out->nrow() ; i++ ) { 4028 // vector<float> sp = getCalibratedSpectra( out, aoff, i ) ; 4029 // out->setSpectrum( sp, i ) ; 4030 // } 4022 // t0 = mathutil::gettimeofday_sec() ; 4031 4023 4032 4024 // using STIdxIterAcc … … 4054 4046 } 4055 4047 delete iter ; 4056 s-> unsetSelection() ;4057 4058 //t1 = mathutil::gettimeofday_sec() ;4059 //cout << "elapsed time for calibration: " << t1-t0 << " sec" << endl ;4048 s->setSelection( orig ) ; 4049 4050 // t1 = mathutil::gettimeofday_sec() ; 4051 // cout << "elapsed time for calibration: " << t1-t0 << " sec" << endl ; 4060 4052 4061 4053 // flux unit
Note:
See TracChangeset
for help on using the changeset viewer.