Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STMath.cpp

    r1819 r1907  
    17961796    out.push_back(outstat);
    17971797  }
     1798  return out;
     1799}
     1800
     1801std::vector< float > STMath::statisticRow( const CountedPtr< Scantable > & in,
     1802                                        const std::vector< bool > & mask,
     1803                                        const std::string& which,
     1804                                        int row )
     1805{
     1806
     1807  Vector<Bool> m(mask);
     1808  const Table& tab = in->table();
     1809  ROArrayColumn<Float> specCol(tab, "SPECTRA");
     1810  ROArrayColumn<uChar> flagCol(tab, "FLAGTRA");
     1811  std::vector<float> out;
     1812
     1813  Vector<Float> spec; specCol.get(row, spec);
     1814  Vector<uChar> flag; flagCol.get(row, flag);
     1815  MaskedArray<Float> ma  = maskedArray(spec, flag);
     1816  float outstat = 0.0;
     1817  if ( spec.nelements() == m.nelements() ) {
     1818    outstat = mathutil::statistics(which, ma(m));
     1819  } else {
     1820    outstat = mathutil::statistics(which, ma);
     1821  }
     1822  out.push_back(outstat);
     1823
    17981824  return out;
    17991825}
Note: See TracChangeset for help on using the changeset viewer.