- Timestamp:
- 10/10/12 14:29:17 (12 years ago)
- Location:
- trunk/src
- Files:
-
- 5 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STAsciiWriter.cpp
r2335 r2658 44 44 #include <casa/sstream.h> 45 45 #include <casa/iomanip.h> 46 #include <casa/Logging/LogIO.h> 46 47 47 48 #include <measures/Measures/MEpoch.h> … … 176 177 } 177 178 of.close(); 178 ostringstream oss; 179 oss << "Wrote " << fName; 180 pushLog(String(oss)); 179 LogIO os( LogOrigin( "STAsciiWriter") ) ; 180 os << "Wrote " << fName << LogIO::POST; 181 181 ++iter; 182 182 } -
trunk/src/STAsciiWriter.h
r1106 r2658 37 37 38 38 #include "Scantable.h" 39 #include "Logger.h" 39 40 40 41 41 namespace casa { … … 48 48 * A class to export a Scnatble to ASCII file(s) 49 49 */ 50 class STAsciiWriter : public Logger{50 class STAsciiWriter { 51 51 public: 52 52 // Constructor -
trunk/src/STAttr.cpp
r2163 r2658 37 37 #include <casa/Quanta/Quantum.h> 38 38 #include <casa/Quanta/MVTime.h> 39 #include <casa/Logging/LogIO.h> 39 40 40 41 #include <measures/Measures/MEpoch.h> … … 52 53 } 53 54 54 STAttr::STAttr(const STAttr& other): 55 Logger() 55 STAttr::STAttr(const STAttr& other) 56 56 { 57 57 (void) other; //suppress unused warning … … 123 123 const Vector<Float>& freqs) const 124 124 { 125 126 // Look at date where appropriate125 casa::LogIO os( casa::LogOrigin( "STAttr", "beamEfficiency()" ) ); 126 // Look at date where appropriate 127 127 MVTime t(dateObs.getValue()); 128 128 uInt year = t.year(); … … 133 133 { 134 134 if (year<2003) { 135 pushLog("There is no beam efficiency data from before 2003"136 " - using 2003 data");135 os << "There is no beam efficiency data from before 2003" 136 <<" - using 2003 data" << casa::LogIO::POST; 137 137 facs = interp(freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2003Y_); 138 138 } else if (year==2003) { 139 pushLog("Using beam efficiency data from 2003");139 os << "Using beam efficiency data from 2003" << casa::LogIO::POST; 140 140 facs = interp(freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2003Y_); 141 141 } else { 142 pushLog("Using beam efficiency data from 2004");142 os << "Using beam efficiency data from 2004" << casa::LogIO::POST; 143 143 facs = interp(freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2004Y_); 144 144 } … … 147 147 default: 148 148 { 149 pushLog("No beam efficiency data for this instrument - assuming unity"); 149 os << "No beam efficiency data for this instrument - assuming unity" 150 << casa::LogIO::POST; 150 151 } 151 152 } … … 157 158 const Vector<Float>& freqs) const 158 159 { 159 160 casa::LogIO os( casa::LogOrigin( "STAttr", "apertureEfficiency()" ) ); 160 161 // Look at date where appropriate 161 162 MVTime t(dateObs.getValue()); … … 167 168 { 168 169 if (year<2004) { 169 pushLog("There is no aperture efficiency data from before 2004"170 " - using 2004 data");170 os << "There is no aperture efficiency data from before 2004" 171 << " - using 2004 data" << casa::LogIO::POST; 171 172 facs = interp(freqs/1.0e9f, MopEtaApX_, MopEtaAp2004Y_); 172 173 } else { 173 pushLog("Using aperture efficiency data from 2004");174 os << "Using aperture efficiency data from 2004" << casa::LogIO::POST; 174 175 facs = interp(freqs/1.0e9f, MopEtaApX_, MopEtaAp2004Y_); 175 176 } … … 183 184 default: 184 185 { 185 pushLog("No aperture efficiency data for this instrument"186 " - assuming unity");186 os << "No aperture efficiency data for this instrument" 187 << " - assuming unity" << casa::LogIO::POST; 187 188 } 188 189 } -
trunk/src/STAttr.h
r1346 r2658 38 38 #include <casa/Utilities/CountedPtr.h> 39 39 40 #include "Logger.h"41 40 #include "STDefs.h" 42 41 … … 47 46 namespace asap { 48 47 49 class STAttr : public Logger{48 class STAttr { 50 49 51 50 public: -
trunk/src/STFITSImageWriter.cpp
r1823 r2658 30 30 //#--------------------------------------------------------------------------- 31 31 32 32 33 #include <fitsio.h> 33 #include <images/Images/TempImage.h> 34 #include <casa/Containers/RecordField.h> 35 #include <casa/Logging/LogIO.h> 34 36 35 37 #include <lattices/Lattices/ArrayLattice.h> … … 41 43 #include <tables/Tables/TableIter.h> 42 44 #include <tables/Tables/TableRecord.h> 43 #include <casa/Containers/RecordField.h> 45 44 46 #include <tables/Tables/TableRow.h> 45 47 #include <tables/Tables/ScalarColumn.h> … … 271 273 } 272 274 fits_close_file(fptr, &status); 273 ostringstream oss; 274 oss << "Wrote " << fileName; 275 pushLog(String(oss)); 276 //pushLog(String(oss)); 275 276 LogIO os( casa::LogOrigin("STFITSImageWriter")); 277 os << "Wrote " << fileName << LogIO::POST; 277 278 ++iter; 278 279 } -
trunk/src/STFITSImageWriter.h
r1823 r2658 33 33 34 34 #include <casa/aips.h> 35 #include <casa/BasicSL/String.h>36 #include <casa/ostream.h>37 35 38 36 #include <coordinates/Coordinates/DirectionCoordinate.h> 39 #include "Scantable.h" 40 #include "Logger.h" 37 38 //#include "Scantable.h" 39 40 namespace casa { 41 class String; 42 } 41 43 42 44 namespace asap { 45 46 class Scantable; 47 48 43 49 /** 44 50 * A class to export a Scantable to FITS file(s) 45 51 */ 46 class STFITSImageWriter : public Logger{52 class STFITSImageWriter { 47 53 public: 48 54 // Constructor -
trunk/src/STFiller.cpp
r2657 r2658 138 138 // Get basic parameters. 139 139 if ( anyEQ(haveXPol_, True) ) { 140 pushLog("Cross polarization present");141 140 for (uInt i=0; i< npols.nelements();++i) { 142 141 if (npols[i] < 3) npols[i] += 2;// Convert Complex -> 2 Floats … … 165 164 throw(AipsError("Failed to get header.")); 166 165 } 166 LogIO os( casa::LogOrigin( "STFiller") ); 167 167 168 if ((header_->obstype).matches("*SW*")) { 168 169 // need robust way here - probably read ahead of next timestamp 169 pushLog("Header indicates frequency switched observation.\n"170 "setting # of IFs = 1 ");170 os << "Header indicates frequency switched observation.\n" 171 << "setting # of IFs = 1 " << LogIO::POST; 171 172 nIF_ = 1; 172 173 header_->obstype = String("fswitch"); -
trunk/src/STFiller.h
r1819 r2658 24 24 #include "Scantable.h" 25 25 #include "STHeader.h" 26 #include "Logger.h" 26 27 27 28 28 class PKSreader; … … 39 39 @version 2.0a 40 40 */ 41 class STFiller : public Logger{41 class STFiller { 42 42 public: 43 43 -
trunk/src/STFrequencies.cpp
r2243 r2658 15 15 #include <casa/Containers/RecordField.h> 16 16 #include <casa/Arrays/IPosition.h> 17 #include <casa/Logging/LogIO.h> 17 18 18 19 #include <tables/Tables/TableDesc.h> … … 264 265 if (!MFrequency::getType(mft, rf)) { 265 266 ostringstream oss; 266 pushLog("WARNING: Frequency type unknown assuming TOPO"); 267 LogIO os( casa::LogOrigin( "STFrequencies", "getFrame") ); 268 os << LogIO::WARN << "WARNING: Frequency type unknown assuming TOPO" 269 << LogIO::POST; 267 270 mft = MFrequency::TOPO; 268 271 } -
trunk/src/STMath.cpp
r2643 r2658 388 388 cycColOut.put(i, uInt(0)); 389 389 } else { 390 ostringstream oss; 391 oss << "For output row="<<i<<", all input rows of data are flagged. no averaging" << endl; 392 pushLog(String(oss)); 390 os << "For output row="<<i<<", all input rows of data are flagged. no averaging" << LogIO::POST; 393 391 } 394 392 acc.reset(); … … 1252 1250 casa::Float tau ) 1253 1251 { 1252 LogIO os( casa::LogOrigin( "STMath", "dosigref()")); 1254 1253 if ( ! ref->conformant(*sig) ) { 1255 1254 throw(AipsError("'sig' and 'ref' scantables are not conformant.")); … … 1263 1262 smref = smooth(ref, inkernel, fsmoothref ); 1264 1263 ostringstream oss; 1265 os s<<"Applied smoothing of "<<fsmoothref<<" on the reference."<<endl;1266 pushLog(String(oss));1264 os <<"Applied smoothing of "<<fsmoothref<<" on the reference." 1265 << LogIO::POST; 1267 1266 } 1268 1267 else { … … 1309 1308 Float elev; 1310 1309 refelevCol.get(i, elev); 1311 os s<< "user specified Tsys = " << tsysv;1310 os << "user specified Tsys = " << tsysv; 1312 1311 // do recalc elevation if EL = 0 1313 1312 if ( elev == 0 ) { … … 1320 1319 } 1321 1320 } 1322 oss << ", corrected (for El) tsys= "<<tsysrefscalar; 1323 pushLog(String(oss)); 1321 os << ", corrected (for El) tsys= "<<tsysrefscalar; 1324 1322 } 1325 1323 else { … … 1357 1355 { 1358 1356 setInsitu(false); 1357 LogIO os( casa::LogOrigin( "STMath", "donod()")); 1359 1358 STSelector sel; 1360 1359 std::vector<int> scan1, scan2, beams, types; … … 1444 1443 1445 1444 msg=String("Processing dototalpower for subset of the data"); 1446 ostringstream oss1; 1447 oss1 << msg << endl; 1448 pushLog(String(oss1)); 1445 os << msg << LogIO::POST; 1449 1446 // Debug for IRC CS data 1450 1447 //float tcal1=7.0; … … 1459 1456 // dosigref calibration 1460 1457 msg=String("Processing dosigref for subset of the data"); 1461 ostringstream oss2; 1462 oss2 << msg << endl; 1463 pushLog(String(oss2)); 1458 os << msg << endl; 1464 1459 calb1=dosigref(sig1,ref2,smoothref,tsysv,tau); 1465 1460 calb2=dosigref(sig2,ref1,smoothref,tsysv,tau); … … 2161 2156 const std::string& method) 2162 2157 { 2158 LogIO os( LogOrigin( "STMath", "gainElevation", WHERE ) ) ; 2163 2159 // Get elevation data from Scantable and convert to degrees 2164 2160 CountedPtr< Scantable > out = getScantable(in, false); … … 2203 2199 throw(AipsError("There is no known gain-elevation polynomial known for this instrument")); 2204 2200 } 2205 ostringstream oss; 2206 oss << "Making polynomial correction with " << msg << " coefficients:" << endl; 2207 oss << " " << coeff; 2208 pushLog(String(oss)); 2201 os << "Making polynomial correction with " << msg << " coefficients:" << endl; 2202 os << " " << coeff << LogIO::POST; 2209 2203 const uInt nrow = tab.nrow(); 2210 2204 Vector<Float> factor(nrow); … … 2217 2211 } else { 2218 2212 // Read and correct 2219 pushLog("Making correction from ascii Table");2213 os << "Making correction from ascii Table" << LogIO::POST; 2220 2214 scaleFromAsciiTable(tab, filename, method, x, true); 2221 2215 } … … 2288 2282 float jyperk ) 2289 2283 { 2284 LogIO os( LogOrigin( "STMath", "convertFlux", WHERE ) ) ; 2285 2290 2286 CountedPtr< Scantable > out = getScantable(in, false); 2291 2287 Table& tab = in->table(); … … 2299 2295 2300 2296 if ( fluxUnit == JY ) { 2301 pushLog("Converting to K");2297 os << "Converting to K" << LogIO::POST; 2302 2298 Quantum<Double> t(1.0,fluxUnit); 2303 2299 Quantum<Double> t2 = t.get(JY); … … 2307 2303 out->setFluxUnit("K"); 2308 2304 } else if ( fluxUnit == K ) { 2309 pushLog("Converting to Jy");2305 os << "Converting to Jy" << LogIO::POST; 2310 2306 Quantum<Double> t(1.0,fluxUnit); 2311 2307 Quantum<Double> t2 = t.get(K); … … 2324 2320 factor *= jyperk; 2325 2321 if ( tokelvin ) factor = 1.0 / jyperk; 2326 ostringstream oss; 2327 oss << "Jy/K = " << jyperk; 2328 pushLog(String(oss)); 2322 os << "Jy/K = " << jyperk << LogIO::POST; 2329 2323 Vector<Float> factors(outtab.nrow(), factor); 2330 2324 scaleByVector(outtab,factors, false); … … 2338 2332 } 2339 2333 jyperk = STAttr::findJyPerK(etaap, d); 2340 ostringstream oss; 2341 oss << "Jy/K = " << jyperk; 2342 pushLog(String(oss)); 2334 os << "Jy/K = " << jyperk << LogIO::POST; 2343 2335 factor *= jyperk; 2344 2336 if ( tokelvin ) { … … 2354 2346 // change per integration. 2355 2347 2356 pushLog("Looking up conversion factors");2348 os <<"Looking up conversion factors" << LogIO::POST; 2357 2349 convertBrightnessUnits(out, tokelvin, cfac); 2358 2350 } … … 2547 2539 if ( ! (*it)->conformant(*out) ) { 2548 2540 // non conformant. 2549 //pushLog(String("Warning: Can't merge scantables as header info differs."));2550 2541 LogIO os( LogOrigin( "STMath", "merge()", WHERE ) ) ; 2551 2542 os << LogIO::SEVERE << "Can't merge scantables as header informations (any one of AntennaName, Equinox, and FluxUnit) differ." << LogIO::EXCEPTION ; … … 2746 2737 const std::string & method) 2747 2738 { 2739 LogIO os( casa::LogOrigin("STMath", "frequencyAlign()", WHERE)); 2748 2740 // clone as this is not working insitu 2749 2741 bool insitu = insitu_; … … 2784 2776 MVTime mvt(refEpoch.getValue()); 2785 2777 String epochout = mvt.string(MVTime::YMD) + String(" (") + refEpoch.getRefString() + String(")"); 2786 ostringstream oss; 2787 oss << "Aligned at reference Epoch " << epochout 2788 << " in frame " << MFrequency::showType(system); 2789 pushLog(String(oss)); 2778 os << "Aligned at reference Epoch " << epochout 2779 << " in frame " << MFrequency::showType(system) << LogIO::POST; 2790 2780 // set up the iterator 2791 2781 Block<String> cols(4); -
trunk/src/STMath.h
r2580 r2658 23 23 #include <scimath/Mathematics/InterpolateArray1D.h> 24 24 25 #include "Logger.h"26 25 #include "Scantable.h" 27 26 #include "STDefs.h" … … 34 33 * @author Malte Marquarding 35 34 */ 36 class STMath : private Logger{35 class STMath { 37 36 public: 38 37 // typedef for long method name -
trunk/src/STSubTable.h
r894 r2658 16 16 #include <tables/Tables/ScalarColumn.h> 17 17 18 #include "Logger.h" 18 19 19 20 20 namespace asap { … … 28 28 @version $Revision:$ 29 29 */ 30 class STSubTable : public Logger{30 class STSubTable { 31 31 public: 32 32 STSubTable() {;} -
trunk/src/STWriter.cpp
r2657 r2658 38 38 #include <casa/Utilities/CountedPtr.h> 39 39 #include <casa/Utilities/Assert.h> 40 #include <casa/Logging/LogIO.h> 40 41 41 42 #include <atnf/PKSIO/PKSrecord.h> … … 321 322 ++scanit; 322 323 } 323 ostringstream oss;324 os s << "STWriter: wrote " << count << " rows to " << filename;325 pushLog(String(oss));326 324 LogIO os( casa::LogOrigin("STWriter")); 325 os << "STWriter: wrote " << count << " rows to " << filename 326 << casa::LogIO::POST; 327 327 328 writer_->close(); 328 //if MS2 delete POINTING table exists and copy the one in the keyword 329 if ( format_ == "MS2" ) { 330 replacePtTab(table, filename); 331 } 329 332 330 return 0; 333 331 } … … 380 378 } 381 379 382 // For writing MS data, if there is the reference to383 // original pointing table it replace it by it.384 void STWriter::replacePtTab (const Table& tab, const std::string& fname)385 {386 String oldPtTabName = fname;387 oldPtTabName.append("/POINTING");388 if ( tab.keywordSet().isDefined("POINTING") ) {389 String PointingTab = tab.keywordSet().asString("POINTING");390 if ( Table::isReadable(PointingTab) ) {391 Table newPtTab(PointingTab, Table::Old);392 newPtTab.copy(oldPtTabName, Table::New);393 ostringstream oss;394 oss << "STWriter: copied " <<PointingTab << " to " << fname;395 pushLog(String(oss));396 }397 }398 }399 380 400 381 // get obsType string from SRCTYPE value -
trunk/src/STWriter.h
r2163 r2658 38 38 #include <casa/BasicSL/String.h> 39 39 40 #include "Logger.h"41 40 #include "Scantable.h" 42 41 … … 53 52 * @version 2.0a 54 53 */ 55 class STWriter : public Logger{54 class STWriter { 56 55 public: 57 56 explicit STWriter(const string &format = "SDFITS"); … … 82 81 const casa::Table& tab); 83 82 84 void replacePtTab(const casa::Table& tab, const std::string& fname);85 86 83 casa::String getObsTypes( casa::Int srctype ) ; 87 84 -
trunk/src/Scantable.cpp
r2645 r2658 20 20 #include <casa/OS/File.h> 21 21 #include <casa/OS/Path.h> 22 #include <casa/Logging/LogIO.h> 22 23 #include <casa/Arrays/Array.h> 23 24 #include <casa/Arrays/ArrayAccessor.h> … … 168 169 */ 169 170 170 Scantable::Scantable( const Scantable& other, bool clear ): 171 Logger() 171 Scantable::Scantable( const Scantable& other, bool clear ) 172 172 { 173 173 // with or without data … … 726 726 727 727 void Scantable::calculateAZEL() 728 { 728 { 729 LogIO os( LogOrigin( "Scantable", "calculateAZEL()", WHERE ) ) ; 729 730 MPosition mp = getAntennaPosition(); 730 731 MEpoch::ROScalarColumn timeCol(table_, "TIME"); 731 732 ostringstream oss; 732 oss << "Computed azimuth/elevation using " << endl 733 << mp << endl; 733 oss << mp; 734 os << "Computed azimuth/elevation using " << endl 735 << String(oss) << endl; 734 736 for (Int i=0; i<nrow(); ++i) { 735 737 MEpoch me = timeCol(i); 736 738 MDirection md = getDirection(i); 737 oss << " Time: " << formatTime(me,False) << " Direction: " << formatDirection(md) 739 os << " Time: " << formatTime(me,False) 740 << " Direction: " << formatDirection(md) 738 741 << endl << " => "; 739 742 MeasFrame frame(mp, me); … … 744 747 azCol_.put(i,Float(azel[0])); 745 748 elCol_.put(i,Float(azel[1])); 746 oss << "azel: " << azel[0]/C::pi*180.0 << " " 747 << azel[1]/C::pi*180.0 << " (deg)" << endl; 748 } 749 pushLog(String(oss)); 749 os << "azel: " << azel[0]/C::pi*180.0 << " " 750 << azel[1]/C::pi*180.0 << " (deg)" << LogIO::POST; 751 } 750 752 } 751 753 … … 885 887 const std::string& poltype ) const 886 888 { 889 LogIO os( LogOrigin( "Scantable", "getSpectrum()", WHERE ) ) ; 890 887 891 String ptype = poltype; 888 892 if (poltype == "" ) ptype = getPolType(); … … 907 911 } 908 912 if ( arr.nelements() == 0 ) 909 pushLog("Not enough polarisations present to do the conversion."); 913 914 os << "Not enough polarisations present to do the conversion." 915 << LogIO::POST; 910 916 arr.tovector(out); 911 917 return out; -
trunk/src/Scantable.h
r2645 r2658 39 39 #include <tables/Tables/Table.h> 40 40 41 #include "Logger.h" 41 42 42 #include "MathUtils.h" 43 43 #include "STFit.h" … … 74 74 * @version 75 75 */ 76 class Scantable : private Logger76 class Scantable 77 77 { 78 78 -
trunk/src/python_asap.cpp
r2613 r2658 81 81 asap::python::python_MSWriter(); 82 82 asap::python::python_LineCatalog(); 83 asap::python::python_Logger();84 83 asap::python::python_LogSink(); 85 84 asap::python::python_STCoordinate();
Note:
See TracChangeset
for help on using the changeset viewer.