Changeset 1616 for branches/alma/src/Scantable.cpp
- Timestamp:
- 08/07/09 15:49:27 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/src/Scantable.cpp
r1610 r1616 31 31 #include <casa/Containers/RecordField.h> 32 32 #include <casa/Utilities/GenSort.h> 33 #include <casa/Logging/LogIO.h> 33 34 34 35 #include <tables/Tables/TableParse.h> … … 1067 1068 void Scantable::addFit( const STFitEntry& fit, int row ) 1068 1069 { 1069 cout << mfitidCol_(uInt(row)) << endl; 1070 //cout << mfitidCol_(uInt(row)) << endl; 1071 LogIO os( LogOrigin( "Scantable", "addFit()", WHERE ) ) ; 1072 os << mfitidCol_(uInt(row)) << LogIO::POST ; 1070 1073 uInt id = fitTable_.addEntry(fit, mfitidCol_(uInt(row))); 1071 1074 mfitidCol_.put(uInt(row), id); … … 1101 1104 Table subt = t( t.col("SCAN") == scanlist[i]+1 ); 1102 1105 if (subt.nrow()==0) { 1103 cerr <<"Scan "<<scanlist[i]<<" cannot be found in the scantable."<<endl; 1106 //cerr <<"Scan "<<scanlist[i]<<" cannot be found in the scantable."<<endl; 1107 LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ; 1108 os <<LogIO::WARN<<"Scan "<<scanlist[i]<<" cannot be found in the scantable."<<LogIO::POST; 1104 1109 ret = 1; 1105 1110 break; … … 1113 1118 Table subt2 = t( t.col("SCAN") == scanlist[i+1]+1 ); 1114 1119 if ( subt2.nrow() == 0) { 1115 cerr<<"Scan "<<scanlist[i+1]<<" cannot be found in the scantable."<<endl; 1120 LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ; 1121 1122 //cerr<<"Scan "<<scanlist[i+1]<<" cannot be found in the scantable."<<endl; 1123 os<<LogIO::WARN<<"Scan "<<scanlist[i+1]<<" cannot be found in the scantable."<<LogIO::POST; 1116 1124 ret = 1; 1117 1125 break; … … 1123 1131 if (scan1seqn == 1 && scan2seqn == 2) { 1124 1132 if (laston1 == laston2) { 1125 cerr<<"A valid scan pair ["<<scanlist[i]<<","<<scanlist[i+1]<<"]"<<endl; 1133 LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ; 1134 //cerr<<"A valid scan pair ["<<scanlist[i]<<","<<scanlist[i+1]<<"]"<<endl; 1135 os<<"A valid scan pair ["<<scanlist[i]<<","<<scanlist[i+1]<<"]"<<LogIO::POST; 1126 1136 i +=1; 1127 1137 } 1128 1138 else { 1129 cerr<<"Incorrect scan pair ["<<scanlist[i]<<","<<scanlist[i+1]<<"]"<<endl; 1139 LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ; 1140 //cerr<<"Incorrect scan pair ["<<scanlist[i]<<","<<scanlist[i+1]<<"]"<<endl; 1141 os<<LogIO::WARN<<"Incorrect scan pair ["<<scanlist[i]<<","<<scanlist[i+1]<<"]"<<LogIO::POST; 1130 1142 } 1131 1143 } 1132 1144 else if (scan1seqn==2 && scan2seqn == 1) { 1133 1145 if (laston1 == laston2) { 1134 cerr<<"["<<scanlist[i]<<","<<scanlist[i+1]<<"] is a valid scan pair but in incorrect order."<<endl; 1146 LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ; 1147 //cerr<<"["<<scanlist[i]<<","<<scanlist[i+1]<<"] is a valid scan pair but in incorrect order."<<endl; 1148 os<<LogIO::WARN<<"["<<scanlist[i]<<","<<scanlist[i+1]<<"] is a valid scan pair but in incorrect order."<<LogIO::POST; 1135 1149 ret = 1; 1136 1150 break; … … 1138 1152 } 1139 1153 else { 1140 cerr<<"The other scan for "<<scanlist[i]<<" appears to be missing. Check the input scan numbers."<<endl; 1154 LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ; 1155 //cerr<<"The other scan for "<<scanlist[i]<<" appears to be missing. Check the input scan numbers."<<endl; 1156 os<<LogIO::WARN<<"The other scan for "<<scanlist[i]<<" appears to be missing. Check the input scan numbers."<<LogIO::POST; 1141 1157 ret = 1; 1142 1158 break; … … 1145 1161 } 1146 1162 else { 1147 cerr<<"The scan does not appear to be standard obsevation."<<endl; 1163 LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ; 1164 //cerr<<"The scan does not appear to be standard obsevation."<<endl; 1165 os<<LogIO::WARN<<"The scan does not appear to be standard obsevation."<<LogIO::POST; 1148 1166 } 1149 1167 //if ( i >= nscan ) break; … … 1151 1169 } 1152 1170 else { 1153 cerr<<"No reference to GBT_GO table."<<endl; 1171 LogIO os( LogOrigin( "Scantable", "checkScanInfo()", WHERE ) ) ; 1172 //cerr<<"No reference to GBT_GO table."<<endl; 1173 os<<LogIO::WARN<<"No reference to GBT_GO table."<<LogIO::POST; 1154 1174 ret = 1; 1155 1175 } … … 1185 1205 nmax = nmin ; 1186 1206 nmin = tmp ; 1187 cout << "Swap values. Applied range is [" 1188 << nmin << ", " << nmax << "]" << endl ; 1207 LogIO os( LogOrigin( "Scantable", "reshapeSpectrum()", WHERE ) ) ; 1208 os << "Swap values. Applied range is [" 1209 << nmin << ", " << nmax << "]" << LogIO::POST ; 1189 1210 } 1190 1211 … … 1198 1219 if ( nmin == 0 ) { 1199 1220 // nothing to do 1200 cout << "Whole range is selected. Nothing to do." << endl ; 1221 LogIO os( LogOrigin( "Scantable", "reshapeSpectrum()", WHERE ) ) ; 1222 os << "Whole range is selected. Nothing to do." << LogIO::POST ; 1201 1223 return ; 1202 1224 } 1203 1225 else { 1204 cout << "Specified maximum exceeds nChan. Applied range is [" 1205 << nmin << ", " << nChan-1 << "]." << endl ; 1226 LogIO os( LogOrigin( "Scantable", "reshapeSpectrum()", WHERE ) ) ; 1227 os << "Specified maximum exceeds nChan. Applied range is [" 1228 << nmin << ", " << nChan-1 << "]." << LogIO::POST ; 1206 1229 nmax = nChan - 1 ; 1207 1230 } … … 1256 1279 void asap::Scantable::regridChannel( int nChan, double dnu ) 1257 1280 { 1258 cout << "Regrid abcissa with channel number " << nChan << " and spectral resoultion " << dnu << "Hz." << endl ; 1281 LogIO os( LogOrigin( "Scantable", "regridChannel()", WHERE ) ) ; 1282 os << "Regrid abcissa with channel number " << nChan << " and spectral resoultion " << dnu << "Hz." << LogIO::POST ; 1259 1283 // assumed that all rows have same nChan 1260 1284 Vector<Float> arr = specCol_( 0 ) ; … … 1263 1287 // if oldsize == nChan, nothing to do 1264 1288 if ( oldsize == nChan ) { 1265 cout << "Specified channel number is same as current one. Nothing to do." << endl;1289 os << "Specified channel number is same as current one. Nothing to do." << LogIO::POST ; 1266 1290 return ; 1267 1291 } … … 1269 1293 // if oldChan < nChan, unphysical operation 1270 1294 if ( oldsize < nChan ) { 1271 cout << "Unphysical operation. Nothing to do." << endl;1295 os << "Unphysical operation. Nothing to do." << LogIO::POST ; 1272 1296 return ; 1273 1297 }
Note: See TracChangeset
for help on using the changeset viewer.