Changeset 1314


Ignore:
Timestamp:
12/18/06 16:37:04 (18 years ago)
Author:
mar637
Message:

fixed defect, where scantable averaging output failed if first row in ouput was all flagged

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/RowAccumulator.cpp

    r979 r1314  
    1313
    1414#include <casa/Arrays/MaskArrMath.h>
     15#include <casa/Arrays/MaskArrLogi.h>
    1516#include <casa/Arrays/ArrayMath.h>
     17#include <casa/Arrays/ArrayLogical.h>
    1618#include "RowAccumulator.h"
    1719
     
    4042  if (!initialized_) {
    4143    Vector<Float> dummy(v.nelements(), 0.0);
    42     spectrum_.setData(dummy, Vector<Bool>(m.nelements(), True));
    43     n_.setData(Vector<Float>(v.nelements(), 0.0), m);
    44     weightSum_.setData(Vector<Float>(v.nelements(), 0.0), m);
     44    Vector<Bool> dummymsk(m.nelements(), True);
     45    spectrum_.setData(dummy, dummymsk);
     46    n_.setData(Vector<Float>(v.nelements(), 0.0), dummymsk);
     47    weightSum_.setData(Vector<Float>(v.nelements(), 0.0), dummymsk);
    4548    tsysSum_.resize(tsys.nelements()); tsysSum_=0.0;
    4649  }
     
    4851  Float totalweight = 1.0;
    4952  totalweight *= addTsys(tsys);
    50   totalweight *= addInterval(interval);
    51   addTime(time);
     53  // only add these if not everything masked
     54  if ( !allEQ(m, False) ) {
     55    totalweight *= addInterval(interval);
     56    addTime(time);
     57  }
    5258  addSpectrum(v, m, totalweight);
    5359  initialized_ = True;
     
    134140casa::Vector< casa::Float > asap::RowAccumulator::getTsys( ) const
    135141{
    136   // @fixme this assummes tsys.nelements() == 1
     142  // @fixme this assumes tsys.nelements() == 1
    137143  return tsysSum_/max(n_);
    138144}
  • trunk/src/STMath.cpp

    r1308 r1314  
    167167        Vector<Bool> bflag(flag.shape());
    168168        convertArray(bflag, flag);
     169        /*
    169170        if ( allEQ(bflag, True) ) {
    170           continue;//don't accumulate
     171        continue;//don't accumulate
    171172        }
     173        */
    172174        specCol.get(k, spec);
    173175        tsysCol.get(k, tsys);
Note: See TracChangeset for help on using the changeset viewer.