Changeset 1232 for trunk/src/STMath.cpp


Ignore:
Timestamp:
09/01/06 13:14:11 (18 years ago)
Author:
mar637
Message:

Merge from Release2.1.0b tag

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STMath.cpp

    r1203 r1232  
    211211  ArrayColumn<Float> tsysColOut(tout,"TSYS");
    212212  ScalarColumn<uInt> scanColOut(tout,"SCANNO");
     213  ScalarColumn<Double> intColOut(tout, "INTERVAL");
    213214  Table tmp = in->table().sort("BEAMNO");
    214215  Block<String> cols(3);
     
    227228    ROArrayColumn<Float> specCol, tsysCol;
    228229    ROArrayColumn<uChar> flagCol;
     230    ROScalarColumn<Double> intCol(subt, "INTERVAL");
    229231    specCol.attach(subt,"SPECTRA");
    230232    flagCol.attach(subt,"FLAGTRA");
     
    255257    flagColOut.put(outrowCount, outflag);
    256258    tsysColOut.put(outrowCount, outtsys);
    257 
     259    Double intsum = sum(intCol.getColumn());
     260    intColOut.put(outrowCount, intsum);
    258261    ++outrowCount;
    259262    ++iter;
     
    11261129                                const std::string& weight )
    11271130{
    1128   if (in->getPolType() != "linear"  || in->npol() != 2 )
    1129     throw(AipsError("averagePolarisations can only be applied to two linear polarisations."));
     1131  if (in->npol() < 2 )
     1132    throw(AipsError("averagePolarisations can only be applied to two or more"
     1133                    "polarisations"));
    11301134  bool insitu = insitu_;
    11311135  setInsitu(false);
    1132   CountedPtr< Scantable > pols = getScantable(in, false);
     1136  CountedPtr< Scantable > pols = getScantable(in, true);
    11331137  setInsitu(insitu);
    11341138  Table& tout = pols->table();
    1135   // give all rows the same POLNO
     1139  std::string taql = "SELECT FROM $1 WHERE POLNO IN [0,1]";
     1140  Table tab = tableCommand(taql, in->table());
     1141  if (tab.nrow() == 0 )
     1142    throw(AipsError("Could not find  any rows with POLNO==0 and POLNO==1"));
     1143  TableCopy::copyRows(tout, tab);
    11361144  TableVector<uInt> vec(tout, "POLNO");
    11371145  vec = 0;
    11381146  pols->table_.rwKeywordSet().define("nPol", Int(1));
     1147  pols->table_.rwKeywordSet().define("POLTYPE", String("stokes"));
    11391148  std::vector<CountedPtr<Scantable> > vpols;
    11401149  vpols.push_back(pols);
    1141   CountedPtr< Scantable > out = average(vpols, mask, weight, "NONE");
     1150  CountedPtr< Scantable > out = average(vpols, mask, weight, "SCAN");
    11421151  return out;
    11431152}
     
    11591168  std::vector<CountedPtr<Scantable> > vbeams;
    11601169  vbeams.push_back(beams);
    1161   CountedPtr< Scantable > out = average(vbeams, mask, weight, "NONE");
     1170  CountedPtr< Scantable > out = average(vbeams, mask, weight, "SCAN");
    11621171  return out;
    11631172}
Note: See TracChangeset for help on using the changeset viewer.