Changeset 1010
- Timestamp:
- 04/11/06 13:15:46 (19 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/scantable.py
r1006 r1010 979 979 if mask is None: 980 980 mask = () 981 s = scantable(self._math._averagepol(self, mask, weight ))981 s = scantable(self._math._averagepol(self, mask, weight.upper())) 982 982 s._add_history("average_pol",varlist) 983 983 print_log() -
trunk/src/STMath.cpp
r1008 r1010 153 153 Vector<uChar> flag; 154 154 Double inter,time; 155 cout << rec.asuInt("POLNO") << endl; 155 156 for (uInt k = 0; k < subt.nrow(); ++k ) { 156 157 flagCol.get(k, flag); … … 979 980 if (in->getPolType() != "linear" || in->npol() != 2 ) 980 981 throw(AipsError("averagePolarisations can only be applied to two linear polarisations.")); 981 CountedPtr<Scantable> pol0( new Scantable(*in), false); 982 CountedPtr<Scantable> pol1( new Scantable(*in), false); 983 Table& tpol0 = pol0->table(); 984 Table& tpol1 = pol1->table(); 985 Vector<uInt> pol0rows = tpol0(tpol0.col("POLNO") == 0).rowNumbers(); 986 Vector<uInt> pol1rows = tpol1(tpol1.col("POLNO") == 1).rowNumbers(); 987 tpol0.removeRow(pol1rows); 988 tpol1.removeRow(pol0rows); 989 // give both tables the same POLNO 990 TableVector<uInt> vec(tpol1,"POLNO"); 982 bool insitu = insitu_; 983 setInsitu(false); 984 CountedPtr< Scantable > pols = getScantable(in, false); 985 setInsitu(insitu); 986 Table& tout = pols->table(); 987 // give all rows the same POLNO 988 TableVector<uInt> vec(tout,"POLNO"); 991 989 vec = 0; 992 std::vector<CountedPtr<Scantable> > pols; 993 pols.push_back(pol0); 994 pols.push_back(pol1); 995 CountedPtr< Scantable > out = average(pols, mask, weight, "NONE"); 996 out->table_.rwKeywordSet().define("nPol",Int(1)); 990 pols->table_.rwKeywordSet().define("nPol",Int(1)); 991 std::vector<CountedPtr<Scantable> > vpols; 992 vpols.push_back(pols); 993 CountedPtr< Scantable > out = average(vpols, mask, weight, "NONE"); 997 994 return out; 998 995 }
Note:
See TracChangeset
for help on using the changeset viewer.