Changeset 1232 for trunk/src/STMath.cpp
- Timestamp:
- 09/01/06 13:14:11 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STMath.cpp
r1203 r1232 211 211 ArrayColumn<Float> tsysColOut(tout,"TSYS"); 212 212 ScalarColumn<uInt> scanColOut(tout,"SCANNO"); 213 ScalarColumn<Double> intColOut(tout, "INTERVAL"); 213 214 Table tmp = in->table().sort("BEAMNO"); 214 215 Block<String> cols(3); … … 227 228 ROArrayColumn<Float> specCol, tsysCol; 228 229 ROArrayColumn<uChar> flagCol; 230 ROScalarColumn<Double> intCol(subt, "INTERVAL"); 229 231 specCol.attach(subt,"SPECTRA"); 230 232 flagCol.attach(subt,"FLAGTRA"); … … 255 257 flagColOut.put(outrowCount, outflag); 256 258 tsysColOut.put(outrowCount, outtsys); 257 259 Double intsum = sum(intCol.getColumn()); 260 intColOut.put(outrowCount, intsum); 258 261 ++outrowCount; 259 262 ++iter; … … 1126 1129 const std::string& weight ) 1127 1130 { 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")); 1130 1134 bool insitu = insitu_; 1131 1135 setInsitu(false); 1132 CountedPtr< Scantable > pols = getScantable(in, false);1136 CountedPtr< Scantable > pols = getScantable(in, true); 1133 1137 setInsitu(insitu); 1134 1138 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); 1136 1144 TableVector<uInt> vec(tout, "POLNO"); 1137 1145 vec = 0; 1138 1146 pols->table_.rwKeywordSet().define("nPol", Int(1)); 1147 pols->table_.rwKeywordSet().define("POLTYPE", String("stokes")); 1139 1148 std::vector<CountedPtr<Scantable> > vpols; 1140 1149 vpols.push_back(pols); 1141 CountedPtr< Scantable > out = average(vpols, mask, weight, " NONE");1150 CountedPtr< Scantable > out = average(vpols, mask, weight, "SCAN"); 1142 1151 return out; 1143 1152 } … … 1159 1168 std::vector<CountedPtr<Scantable> > vbeams; 1160 1169 vbeams.push_back(beams); 1161 CountedPtr< Scantable > out = average(vbeams, mask, weight, " NONE");1170 CountedPtr< Scantable > out = average(vbeams, mask, weight, "SCAN"); 1162 1171 return out; 1163 1172 }
Note: See TracChangeset
for help on using the changeset viewer.