- Timestamp:
- 02/03/05 19:00:03 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMemTable.cc
r348 r365 60 60 #include "SDMemTable.h" 61 61 #include "SDContainer.h" 62 #include "MathUtils.h" 62 63 63 64 … … 1018 1019 Double xcop = x; 1019 1020 MVTime mvt(xcop/24./3600.); // make days 1020 1021 1021 1022 if (x < 59.95) 1022 1023 return String(" ") + mvt.string(MVTime::TIME_CLEAN_NO_HM, 7)+"s"; … … 1074 1075 1075 1076 std::string SDMemTable::summary() const { 1076 1077 // get number of integrations per scan1078 int cIdx = 0;1079 int idx = 0;1080 int scount = 0;1081 std::vector<int> cycles;1082 for (uInt i=0; i<scanCol_.nrow();++i) {1083 while (idx == cIdx && i<scanCol_.nrow()) {1084 scanCol_.getScalar(++i,cIdx);1085 ++scount;1086 }1087 idx = cIdx;1088 cycles.push_back(scount);1089 scount=0;1090 --i;1091 }1092 1093 1077 1094 1078 ostringstream oss; … … 1128 1112 << "IF[" << getIF() << "] " << "Pol[" << getPol() << "]" << endl; 1129 1113 oss << endl; 1130 uInt count = 0; 1131 String name; 1132 Int previous = -1;Int current=0; 1133 Int integ = 0; 1114 // 1134 1115 String dirtype ="Position ("+ 1135 1116 MDirection::showType(getDirectionReference())+ … … 1139 1120 << setw(26) << dirtype 1140 1121 << setw(10) << "Time" 1141 << setw(13) << "Integration" << endl; 1142 oss << "-------------------------------------------------------------------------------" << endl; 1122 << setw(18) << "Integration" 1123 << setw(10) << "FreqIDs" << endl; 1124 oss << "----------------------------------------------------------------------------------" << endl; 1143 1125 1144 std::vector<int>::iterator it = cycles.begin(); 1145 for (uInt i=0; i< scanCol_.nrow();i++) { 1146 scanCol_.getScalar(i,current); 1147 if (previous != current) { 1148 srcnCol_.getScalar(i,name); 1149 previous = current; 1150 String t = formatSec(Double(getInterval(i))); 1151 String posit = formatDirection(getDirection(i,True)); 1152 oss << setw(6) << count 1153 << setw(15) << name 1126 // 1127 uInt scanNo = 0; 1128 String name; 1129 Int lastScanID = 0; 1130 Int scanID; 1131 uInt firstRow = 0; 1132 Vector<uInt> freqIDs, listFQ; 1133 // 1134 uInt nRow = scanCol_.nrow(); 1135 for (uInt i=0; i<nRow; i++) { 1136 scanCol_.getScalar(i,scanID); 1137 freqidCol_.get(i, freqIDs); 1138 // 1139 if (i>0 && (i==nRow-1 || scanID!=lastScanID)) { 1140 srcnCol_.getScalar(firstRow,name); 1141 String t = formatSec(Double(getInterval(firstRow))); 1142 String posit = formatDirection(getDirection(firstRow,True)); 1143 uInt nInt = (i-firstRow); 1144 if (i==nRow-1 &&scanID==lastScanID) nInt++; // Last row but same scan 1145 // 1146 oss << setw(6) << scanNo 1147 << setw(15) << name 1154 1148 << setw(26) << posit 1155 << setw(10) << getTime(i,False) 1156 << setw(3) << std::right << *it << " x " 1157 << setw(10) 1158 << t << std::left << endl; 1159 count++; 1160 it++; 1149 << setw(10) << getTime(firstRow,False) 1150 << setw(3) << nInt << setw(3) << " x " << setw(6) << t 1151 << " " << listFQ << endl; 1152 // 1153 lastScanID = scanID; 1154 firstRow = i; 1155 scanNo++; 1156 listFQ.resize(0); 1161 1157 } else { 1162 integ++; 1158 for (uInt j=0; j<freqIDs.nelements(); j++) { 1159 mathutil::addEntry(listFQ, freqIDs(j)); 1160 } 1163 1161 } 1164 1162 } 1165 1163 oss << endl; 1166 oss << "Table contains " << table_.nrow() << " integration(s) in " << count<< " scan(s)." << endl;1164 oss << "Table contains " << table_.nrow() << " integration(s) in " << scanNo << " scan(s)." << endl; 1167 1165 1168 1166 // Frequency Table … … 1172 1170 oss << endl << endl; 1173 1171 oss << "FreqID Frame RefFreq(Hz) RefPix Increment(Hz)" << endl; 1174 oss << "------------------------------------------------------------------------------- " << endl;1172 oss << "----------------------------------------------------------------------------------" << endl; 1175 1173 for (uInt i=0; i<sdft.length(); i++) { 1176 1174 oss << setw(8) << i << setw(8) … … 1180 1178 << sdft.increment(i) << endl; 1181 1179 } 1182 oss << "------------------------------------------------------------------------------- " << endl;1180 oss << "----------------------------------------------------------------------------------" << endl; 1183 1181 return String(oss); 1184 1182 }
Note:
See TracChangeset
for help on using the changeset viewer.