Changeset 1222


Ignore:
Timestamp:
08/31/06 12:04:30 (18 years ago)
Author:
mar637
Message:

Ticket #66 fully implemeneted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/Release2.1.0b/src/STMath.cpp

    r1204 r1222  
    11261126                                const std::string& weight )
    11271127{
    1128   if (in->getPolType() != "linear"  || in->npol() != 2 )
    1129     throw(AipsError("averagePolarisations can only be applied to two linear polarisations."));
     1128  if (in->npol() <= 2 )
     1129    throw(AipsError("averagePolarisations can only be applied to two or more"
     1130                    "polarisations"));
    11301131  bool insitu = insitu_;
    11311132  setInsitu(false);
    1132   CountedPtr< Scantable > pols = getScantable(in, false);
     1133  CountedPtr< Scantable > pols = getScantable(in, true);
    11331134  setInsitu(insitu);
    11341135  Table& tout = pols->table();
    1135   // give all rows the same POLNO
     1136  std::string taql = "SELECT FROM $1 WHERE POLNO IN [0,1]";
     1137  Table tab = tableCommand(taql, in->table());
     1138  if (tab.nrow() == 0 )
     1139    throw(AipsError("Could not find  any rows with POLNO==0 and POLNO==1"));
     1140  TableCopy::copyRows(tout, tab);
    11361141  TableVector<uInt> vec(tout, "POLNO");
    11371142  vec = 0;
Note: See TracChangeset for help on using the changeset viewer.