Changeset 669 in Sophya for trunk/SophyaLib/SkyT
- Timestamp:
- Nov 29, 1999, 5:59:13 PM (26 years ago)
- Location:
- trunk/SophyaLib/SkyT
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyT/blackbody.cc
r668 r669 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: blackbody.cc,v 1. 3 1999-11-29 14:16:03ansari Exp $3 // $Id: blackbody.cc,v 1.4 1999-11-29 16:59:09 ansari Exp $ 4 4 // 5 5 // Description: … … 57 57 } 58 58 59 60 void 61 BlackBody::Print(ostream& os) const 62 { 63 os << "BlackBody::Print Temp= " << getTemperature() 64 << " - Fmin,Fmax= " << minFreq() << "," << maxFreq() << endl; 65 os << "MeanFreq= " << meanFreq() << " Emission= " << flux(meanFreq()) << endl; 66 os << "PeakFreq= " << peakFreq() << " Emission= " << flux(peakFreq()) << endl; 67 68 } 69 70 /* 59 71 void 60 72 BlackBody::WriteSelf(POutPersist& s) … … 75 87 } 76 88 77 78 void 79 BlackBody::Print(ostream& os) const 80 { 81 os << "BlackBody::Print Temp= " << getTemperature() 82 << " - Fmin,Fmax= " << minFreq() << "," << maxFreq() << endl; 83 os << "MeanFreq= " << meanFreq() << " Emission= " << flux(meanFreq()) << endl; 84 os << "PeakFreq= " << peakFreq() << " Emission= " << flux(peakFreq()) << endl; 85 86 } 89 */ -
trunk/SophyaLib/SkyT/blackbody.h
r668 r669 2 2 //-------------------------------------------------------------------------- 3 3 // File and Version Information: 4 // $Id: blackbody.h,v 1. 3 1999-11-29 14:16:03ansari Exp $4 // $Id: blackbody.h,v 1.4 1999-11-29 16:59:10 ansari Exp $ 5 5 // 6 6 // Description: … … 33 33 inline void setTemperature(double newtemp) { _temperature = newtemp; } 34 34 35 virtual void ReadSelf(PInPersist& s);36 virtual void WriteSelf(POutPersist& s);37 35 // Redefintion of the Print function 38 36 virtual void Print(ostream& os) const; -
trunk/SophyaLib/SkyT/easyTest.cc
r668 r669 5 5 #include "tvector.h" 6 6 #include "squarefilt.h" 7 #include "gaussfilt.h" 7 8 #include "trianglefilt.h" 8 9 9 #include "iobjspecresp.cc"10 10 11 11 int … … 15 15 // SR_ReadSelf(in); 16 16 // cout << " " << endl; 17 18 PInPersist in2("outTF");19 SR_ReadSelf(in2);20 cout << " " << endl;21 17 22 18 cout << "BlackBody!" << endl; … … 92 88 freqmax = vecOfNuRSV(SRVmaxVal-1); 93 89 SpecRespVec mySRV(vecOfNuRSV, vecOfFDeNuRSV); 90 91 // Test ecriture en PPF 92 { 93 cout << " Writing mySRV (RadSpecVec to PPF " << endl; 94 POutPersist s("srvec.ppf"); 95 s << mySRV; 96 } 97 { 98 cout << " Reading mySRV from PPF " << endl; 99 PInPersist s("srvec.ppf"); 100 SpecRespVec srv; 101 s >> srv; 102 cout << srv; 103 } 104 94 105 double SRV = mySRV.IntegratedSpect(freqmin,freqmax); 95 106 double logSRV = mySRV.logIntegratedSpect(freqmin,freqmax); … … 158 169 cout << "read and write things in file...ppersist!" << endl; 159 170 TriangleFilter myTF2(10,200,20,40); 160 POutPersist outTF("outTF");161 myTF2.WriteSelf(outTF);162 171 // PInPersist inTF("outTF"); 163 172 // myTF2.ReadSelf(inTF); 164 173 174 { // Test IO PPF GaussianFilter 175 cout << " Writing GaussianFilter gf(276., 39.6, 0.794, 27., 690.) to PPF " << endl; 176 GaussianFilter gf(276., 39.6, 0.794, 27., 690.); 177 POutPersist s("fgauss.ppf"); 178 s << gf ; 179 } 180 { 181 cout << " Reading GaussianFilter from PPF " << endl; 182 PInPersist s("fgauss.ppf"); 183 GaussianFilter gf2; 184 s >> gf2; 185 cout << gf2 << endl; 186 } 165 187 166 188 } -
trunk/SophyaLib/SkyT/nupower.cc
r668 r669 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: nupower.cc,v 1. 4 1999-11-29 14:16:05ansari Exp $3 // $Id: nupower.cc,v 1.5 1999-11-29 16:59:10 ansari Exp $ 4 4 // 5 5 // Description: … … 52 52 53 53 54 55 void 56 PowerLawSpectra::Print(ostream& os) const 57 { 58 os << "PowerLawSpectra::Print f = a ((nu-nu0)/dnu)^b " << _a << "((nu-" << _nu0 59 << ") / " << _dnu << ") ^ " << _b << endl; 60 os << " - Fmin,Fmax= " << minFreq() << "," << maxFreq() << endl; 61 os << "MeanFreq= " << meanFreq() << " Emission= " << flux(meanFreq()) << endl; 62 os << "PeakFreq= " << peakFreq() << " Emission= " << flux(peakFreq()) << endl; 63 64 } 65 66 67 /* 54 68 void 55 69 PowerLawSpectra::WriteSelf(POutPersist& s) … … 76 90 } 77 91 78 79 void 80 PowerLawSpectra::Print(ostream& os) const 81 { 82 os << "PowerLawSpectra::Print f = a ((nu-nu0)/dnu)^b " << _a << "((nu-" << _nu0 83 << ") / " << _dnu << ") ^ " << _b << endl; 84 os << " - Fmin,Fmax= " << minFreq() << "," << maxFreq() << endl; 85 os << "MeanFreq= " << meanFreq() << " Emission= " << flux(meanFreq()) << endl; 86 os << "PeakFreq= " << peakFreq() << " Emission= " << flux(peakFreq()) << endl; 87 88 } 92 */ -
trunk/SophyaLib/SkyT/nupower.h
r668 r669 2 2 //-------------------------------------------------------------------------- 3 3 // File and Version Information: 4 // $Id: nupower.h,v 1. 4 1999-11-29 14:16:05ansari Exp $4 // $Id: nupower.h,v 1.5 1999-11-29 16:59:10 ansari Exp $ 5 5 // 6 6 // Description: … … 37 37 virtual inline double giveExp() const {return _b;}; 38 38 39 virtual void WriteSelf(POutPersist& s) ;40 virtual void ReadSelf(PInPersist& s) ;41 42 39 43 40 protected: -
trunk/SophyaLib/SkyT/radspec.h
r668 r669 2 2 //-------------------------------------------------------------------------- 3 3 // File and Version Information: 4 // $Id: radspec.h,v 1. 3 1999-11-29 14:16:06ansari Exp $4 // $Id: radspec.h,v 1.4 1999-11-29 16:59:11 ansari Exp $ 5 5 // 6 6 // Description: … … 76 76 77 77 virtual void Print(ostream& os) const; 78 virtual void ReadSelf(PInPersist& s) = 0;79 virtual void WriteSelf(POutPersist& s) = 0;80 78 81 79 protected: -
trunk/SophyaLib/SkyT/radspecvector.cc
r668 r669 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: radspecvector.cc,v 1. 4 1999-11-29 14:16:06ansari Exp $3 // $Id: radspecvector.cc,v 1.5 1999-11-29 16:59:11 ansari Exp $ 4 4 // 5 5 // Description: … … 39 39 _numin = nu(0); 40 40 _numax = nu(nu.NElts()-1); 41 _size = nu.NElts();42 if(_vecOfNu.NElts() != _vecOfFDeNu.NElts()) cout << "vectors are not compatible" << exit;43 41 } 44 42 … … 83 81 } 84 82 83 84 85 void 86 RadSpectraVec::Print(ostream& os) const 87 { 88 // os << "RadSpectraVec::Print (" << typeid(*this).name() 89 // << ") - Fmin,Fmax= " << minFreq() << "," << maxFreq() << endl; 90 os << "RadSpectraVec::Print - Fmin,Fmax= " << minFreq() << "," << maxFreq() << endl; 91 os << "MeanFreq= " << meanFreq() << " Emission= " << flux(meanFreq()) << endl; 92 os << "PeakFreq= " << peakFreq() << " Emission= " << flux(peakFreq()) << endl; 93 94 } 95 96 /* 85 97 void 86 98 RadSpectraVec::WriteSelf(POutPersist& s) … … 114 126 cout << _numin<< "-" << _numax << endl; 115 127 } 128 */ 116 129 117 130 118 119 void120 RadSpectraVec::Print(ostream& os) const121 {122 // os << "RadSpectraVec::Print (" << typeid(*this).name()123 // << ") - Fmin,Fmax= " << minFreq() << "," << maxFreq() << endl;124 os << "RadSpectraVec::Print - Fmin,Fmax= " << minFreq() << "," << maxFreq() << endl;125 os << "MeanFreq= " << meanFreq() << " Emission= " << flux(meanFreq()) << endl;126 os << "PeakFreq= " << peakFreq() << " Emission= " << flux(peakFreq()) << endl;127 128 }129 130 -
trunk/SophyaLib/SkyT/radspecvector.h
r668 r669 50 50 inline double getNuVec(int i) const { return _vecOfNu(i); } 51 51 inline double getFNuVec(int i) const { return _vecOfFDeNu(i); } 52 inline int NbElts() const { return _size;}53 virtual void ReadSelf(PInPersist& s);54 virtual void WriteSelf(POutPersist& s);55 52 56 53 virtual void Print(ostream& os) const; … … 59 56 Vector _vecOfNu; 60 57 Vector _vecOfFDeNu; 61 int _size;62 58 }; 63 59 -
trunk/SophyaLib/SkyT/skyinit.cc
r668 r669 2 2 #include <unistd.h> 3 3 4 #include "s ambainit.h"4 #include "skyinit.h" 5 5 #include "ppersist.h" 6 6 #include "objfio.h" 7 7 #include "specrespvector.h" 8 #include "gauss ianfilter.h"8 #include "gaussfilt.h" 9 9 10 10 int SkyTInitiator::FgInit = 0; -
trunk/SophyaLib/SkyT/specrespvector.cc
r668 r669 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: specrespvector.cc,v 1. 4 1999-11-29 14:16:09ansari Exp $3 // $Id: specrespvector.cc,v 1.5 1999-11-29 16:59:12 ansari Exp $ 4 4 // 5 5 // Description: … … 32 32 SpecRespVec::SpecRespVec(Vector const & nu, Vector const & fdenu, double numin, double numax) 33 33 : SpectralResponse(numin, numax) 34 { 35 if(nu.NElts() != fdenu.NElts()) 36 throw SzMismatchError("SpecRespVec::SpecRespVec() - Non equal vector sizes"); 37 _vecOfNu = nu; 38 _vecOfFDeNu = fdenu; 39 _size = nu.NElts(); 40 if(_vecOfNu.NElts() != _vecOfFDeNu.NElts()) cout << "vectors are not compatible" << exit; 41 } 42 43 SpecRespVec::SpecRespVec(Vector const & nu, Vector const & fdenu) 44 : SpectralResponse() 34 45 { 35 46 if(nu.NElts() != fdenu.NElts()) … … 116 127 s.PutR8(dobj->maxFreq()); 117 128 118 // TVector<T> has Persistence Manager 119 s << dobj->getNuVec(); 120 s << dobj->getTNuVec(); 129 // TVector<T> has Persistence Manager 130 s << dobj->getNuVec(); 131 { 132 Vector& xv2 = dobj->getTNuVec(); 133 cout << xv2 ; 134 FIO_TVector<double> vio2(&xv2); 135 vio2.Write(s); 136 } 121 137 } 122 138 … … 132 148 if(dobj == NULL) 133 149 { 134 Vector v1(10); 135 Vector v2(10); 136 dobj= new SpecRespVec(); 137 ownobj= true; 150 dobj= new SpecRespVec(); 151 ownobj= true; 138 152 } 139 140 153 r_8 minf, maxf; 141 154 s.GetR8(minf); … … 143 156 dobj->setMinMaxFreq(minf, maxf); 144 157 // TVector<T> has Persistence Manager 145 s >> dobj->getNuVec(); 146 s >> dobj->getTNuVec(); 158 FIO_TVector<double> vio(&(dobj->getNuVec())); 159 vio.Read(s); 160 FIO_TVector<double> vio2(&(dobj->getTNuVec())); 161 vio2.Read(s); 147 162 } 148 163 -
trunk/SophyaLib/SkyT/specrespvector.h
r668 r669 2 2 //-------------------------------------------------------------------------- 3 3 // File and Version Information: 4 // $Id: specrespvector.h,v 1. 3 1999-11-29 14:16:09ansari Exp $4 // $Id: specrespvector.h,v 1.4 1999-11-29 16:59:12 ansari Exp $ 5 5 // 6 6 // Description: … … 38 38 //Constructor 39 39 SpecRespVec(); 40 SpecRespVec(Vector const & nu, Vector const & fdenu, double numin=0., double numax=1.); 40 SpecRespVec(Vector const & nu, Vector const & fdenu, double numin, double numax); 41 SpecRespVec(Vector const & nu, Vector const & fdenu); 41 42 42 43 // destructor -
trunk/SophyaLib/SkyT/squarefilt.cc
r668 r669 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: squarefilt.cc,v 1. 3 1999-11-29 14:16:09ansari Exp $3 // $Id: squarefilt.cc,v 1.4 1999-11-29 16:59:12 ansari Exp $ 4 4 // 5 5 // Description: … … 68 68 } 69 69 70 /* 70 71 void 71 72 SquareFilter::WriteSelf(POutPersist& s) … … 83 84 cout << "minFreq - maxFreq " << _numin << "-" << _numax << endl; 84 85 } 86 */ -
trunk/SophyaLib/SkyT/squarefilt.h
r668 r669 2 2 //-------------------------------------------------------------------------- 3 3 // File and Version Information: 4 // $Id: squarefilt.h,v 1. 3 1999-11-29 14:16:09ansari Exp $4 // $Id: squarefilt.h,v 1.4 1999-11-29 16:59:13 ansari Exp $ 5 5 // 6 6 // Description: … … 47 47 virtual double peakTransmission() const; 48 48 49 virtual void WriteSelf(POutPersist& s) ;50 virtual void ReadSelf(PInPersist& s) ;51 52 53 49 54 50 protected: -
trunk/SophyaLib/SkyT/tgrsr.cc
r668 r669 29 29 if ((narg < 5) || ((narg>1) && (strcmp(arg[1],"-h") == 0)) ) { 30 30 cout << " tgrsr : Generation of RadSpectraVec and SpecRespVec in FITS " << endl; 31 cout << " Usage: tgrsr 0/1 Params NPoints FitsFileName [ImageR4FITSName] " << endl;31 cout << " Usage: tgrsr 0/1 Params NPoints FitsFileName [ImageR4FITSName] [ppfname] " << endl; 32 32 cout << " 0 -> GaussianFilter T = A exp(((nu-nu0)/dnu)^2" << endl; 33 33 cout << " Params : A,Nu0,DNu,MinFreq,MaxFreq " << endl; … … 82 82 img(k,1) = tnu(k); 83 83 } 84 if ((typ == 0) && (narg > 6)) { // Writing to ppf file 85 cout << "writing SpecRespVec(" << npt << ") to PPF file: " 86 << (string)(arg[6]) << endl; 87 cout << sr ; 88 cout << srv ; 89 { 90 POutPersist pos(arg[6]); 91 pos << srv; 92 } 93 PrtTim("End of ImageR4->PPF "); 94 } 95 84 96 } 85 97 else { // Generation de RadSpectraVec from PowerLawSpectra -
trunk/SophyaLib/SkyT/trianglefilt.cc
r668 r669 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: trianglefilt.cc,v 1. 3 1999-11-29 14:16:10ansari Exp $3 // $Id: trianglefilt.cc,v 1.4 1999-11-29 16:59:13 ansari Exp $ 4 4 // 5 5 // Description: … … 67 67 } 68 68 69 /* 69 70 void 70 71 TriangleFilter::WriteSelf(POutPersist& s) … … 89 90 90 91 } 92 93 */ -
trunk/SophyaLib/SkyT/trianglefilt.h
r668 r669 2 2 //-------------------------------------------------------------------------- 3 3 // File and Version Information: 4 // $Id: trianglefilt.h,v 1. 3 1999-11-29 14:16:10ansari Exp $4 // $Id: trianglefilt.h,v 1.4 1999-11-29 16:59:13 ansari Exp $ 5 5 // 6 6 // Description: … … 43 43 virtual double peakFreq() const; 44 44 virtual double peakTransmission() const; 45 virtual void WriteSelf(POutPersist& s) ;46 virtual void ReadSelf(PInPersist& s) ;47 45 48 46 protected:
Note:
See TracChangeset
for help on using the changeset viewer.