Ignore:
Timestamp:
02/17/06 15:04:14 (18 years ago)
Author:
mar637
Message:

asap2 integration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MathUtils2.cc

    r452 r829  
    4141
    4242template <class T>
    43 void mathutil::hanning(Vector<T>& out, Vector<Bool>& outmask, 
    44                        const Vector<T>& in, const Vector<Bool>& mask, 
     43void mathutil::hanning(Vector<T>& out, Vector<Bool>& outmask,
     44                       const Vector<T>& in, const Vector<Bool>& mask,
    4545                       Bool relaxed, Bool ignoreOther) {
    4646
     
    5454  vals[0] = 0.5; vals[1] = 0.0; vals[2] = 0.5; weights[5] = vals;// TFT
    5555  vals[0] = 0.0; vals[1] = 2.0/3.0; vals[2] = 1.0/3.0; weights[6] = vals;// FTT
    56   vals[0] = 0.25; vals[1] = 0.5; vals[2] = 0.25; weights[7] = vals;// TTT 
     56  vals[0] = 0.25; vals[1] = 0.5; vals[2] = 0.25; weights[7] = vals;// TTT
    5757  // Chris' case
    58   Vector<Bool> weighted(8); 
     58  Vector<Bool> weighted(8);
    5959  if (relaxed) {
    6060    weighted = False;
     
    6565    weighted[0] = False;
    6666  }
    67  
     67
    6868  out.resize(in.nelements());
    6969  outmask.resize(mask.nelements());
     
    9191  }
    9292}
    93 
    94 template <class T>
    95 uInt mathutil::addEntry (Vector<T>& list, T val)
    96 {
    97    uInt n = list.nelements();
    98    if (n>0) {
    99       for (uInt i=0; i<n; i++) {
    100          if (near(list[i],val)) {
    101             return i;
    102          }
    103       }
    104    }
    105 //
    106    n++;
    107    list.resize(n,True);
    108    list(n-1) = val;
    109    return n-1;
    110 }
    111 
    112 template <class T>
    113 void mathutil::extendLastArrayAxis(casa::Array<T>& out,
    114                                    const casa::Array<T>& in,
    115                                    const T& initVal)
    116 {
    117  
    118   IPosition ipin = in.shape();
    119   IPosition ipout = ipin; // copy?
    120   // extend the axis by 1
    121   uInt axis = in.ndim()-1;
    122   ipout[axis] = ipin[axis]+1;
    123   out.resize(ipout);
    124   out = initVal;
    125   ArrayIterator<T> itout(out,axis);
    126   ReadOnlyArrayIterator<T> itin(in,axis);
    127   while ( !itin.pastEnd() ) {
    128     itout.array() = itin.array();  // copy vector by vector
    129     itin.next(); itout.next();
    130   }
    131 }
Note: See TracChangeset for help on using the changeset viewer.