Changeset 1200
- Timestamp:
- 08/29/06 11:03:45 (18 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r1192 r1200 640 640 self._add_history("flag", varlist) 641 641 642 def lag_flag(self, frequency, unit="GHz", width=0 , insitu=None):642 def lag_flag(self, frequency, unit="GHz", width=0.0, insitu=None): 643 643 """ 644 644 Flag the data in 'lag' space by providing a frequency to remove. … … 648 648 frequency: the frequency to remove 649 649 unit: the frequency unit ()default "GHz") 650 width: the number of 'lag' channels to extent the frequency 651 by, i.e. the interval 652 [bandwidth/frequency-width, bandwidth/frequency+width] 650 width: the width of the frequency to remove 653 651 """ 654 652 if insitu is None: insitu = rcParams['insitu'] … … 659 657 raise ValueError("%s is not a valid unit." % unit) 660 658 try: 661 s = scantable(self._math._lag_flag(self, frequency*base[unit], width)) 659 s = scantable(self._math._lag_flag(self, frequency*base[unit], 660 width*base[unit])) 662 661 except RuntimeError, msg: 663 662 if rcParams['verbose']: -
trunk/src/STMath.cpp
r1192 r1200 1381 1381 CountedPtr< Scantable > 1382 1382 asap::STMath::lagFlag( const CountedPtr< Scantable > & in, 1383 double frequency, intwidth )1383 double frequency, double width ) 1384 1384 { 1385 1385 CountedPtr< Scantable > out = getScantable(in, false); … … 1399 1399 Vector<Float> spec = specCol(i); 1400 1400 Vector<uChar> flag = flagCol(i); 1401 Int lag = Int(spec.nelements()*abs(inc)/frequency); 1401 Int lag0 = Int(spec.nelements()*abs(inc)/(frequency+width)+0.5); 1402 Int lag1 = Int(spec.nelements()*abs(inc)/(frequency-width)+0.5); 1402 1403 for (int k=0; k < flag.nelements(); ++k ) { 1403 1404 if (flag[k] > 0) { … … 1407 1408 Vector<Complex> lags; 1408 1409 ffts.fft(lags, spec); 1409 Int start = max(0, lag -width);1410 Int end = min(Int(lags.nelements()-1), lag +width);1410 Int start = max(0, lag0); 1411 Int end = min(Int(lags.nelements()-1), lag1); 1411 1412 if (start == end) { 1412 1413 lags[start] = Complex(0.0); -
trunk/src/STMath.h
r1192 r1200 191 191 casa::CountedPtr<Scantable> 192 192 lagFlag( const casa::CountedPtr<Scantable>& in, double frequency, 193 intwidth);193 double width); 194 194 195 195 private: -
trunk/src/STMathWrapper.h
r1192 r1200 157 157 158 158 ScantableWrapper lagFlag( const ScantableWrapper& in, 159 double frequency, intwidth )159 double frequency, double width ) 160 160 { return ScantableWrapper(STMath::lagFlag(in.getCP(), frequency, width)); } 161 161
Note:
See TracChangeset
for help on using the changeset viewer.