Changeset 1199 for tags


Ignore:
Timestamp:
08/29/06 11:00:24 (18 years ago)
Author:
mar637
Message:

changed lag_flag interface to use frequency width intead of lag width

Location:
tags/Release2.1.0b
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • tags/Release2.1.0b/python/scantable.py

    r1192 r1199  
    640640        self._add_history("flag", varlist)
    641641
    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):
    643643        """
    644644        Flag the data in 'lag' space by providing a frequency to remove.
     
    648648            frequency:    the frequency to remove
    649649            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
    653651        """
    654652        if insitu is None: insitu = rcParams['insitu']
     
    659657            raise ValueError("%s is not a valid unit." % unit)
    660658        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]))
    662661        except RuntimeError, msg:
    663662            if rcParams['verbose']:
  • tags/Release2.1.0b/src/STMath.cpp

    r1192 r1199  
    13811381CountedPtr< Scantable >
    13821382  asap::STMath::lagFlag( const CountedPtr< Scantable > & in,
    1383                           double frequency, int width )
     1383                          double frequency, double width )
    13841384{
    13851385  CountedPtr< Scantable > out = getScantable(in, false);
     
    13991399      Vector<Float> spec = specCol(i);
    14001400      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);
    14021403      for (int k=0; k < flag.nelements(); ++k ) {
    14031404        if (flag[k] > 0) {
     
    14071408      Vector<Complex> lags;
    14081409      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);
    14111412      if (start == end) {
    14121413        lags[start] = Complex(0.0);
  • tags/Release2.1.0b/src/STMath.h

    r1192 r1199  
    191191  casa::CountedPtr<Scantable>
    192192    lagFlag( const casa::CountedPtr<Scantable>& in, double frequency,
    193               int width);
     193              double width);
    194194
    195195private:
  • tags/Release2.1.0b/src/STMathWrapper.h

    r1192 r1199  
    157157
    158158  ScantableWrapper lagFlag( const ScantableWrapper& in,
    159                             double frequency, int width )
     159                            double frequency, double width )
    160160  { return ScantableWrapper(STMath::lagFlag(in.getCP(), frequency, width)); }
    161161
Note: See TracChangeset for help on using the changeset viewer.