Changeset 909 in Sophya
- Timestamp:
- Apr 13, 2000, 4:10:46 PM (25 years ago)
- Location:
- trunk/SophyaLib/SkyT
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyT/blackbody.cc
r669 r909 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: blackbody.cc,v 1. 4 1999-11-29 16:59:09ansari Exp $3 // $Id: blackbody.cc,v 1.5 2000-04-13 14:10:43 ansari Exp $ 4 4 // 5 5 // Description: … … 20 20 #include "blackbody.h" 21 21 22 /*! 23 * \class SOPHYA::BlackBody <BR> 24 This class corresponds to the emission spectrum of a 25 blackbody radiation. 26 */ 22 27 //---------------- 23 28 // Constructor -- 24 29 //---------------- 30 /*! Constructor: needs a temperature. Otherwise set to ConvTools::tcmb */ 25 31 BlackBody::BlackBody(double temperature) 26 32 : RadSpectra(10., 10000.) … … 33 39 { 34 40 } 35 36 41 /*! Black Body Flux Function: 42 \f[ 43 I_\nu = {2 h_{pl} (1.10^9*\nu)^3 \over c^2 (e^{{h_{pl}(1.10^9*\nu) \over kT}} -1)} 44 \f] 45 */ 37 46 double 38 47 BlackBody::flux(double nu) const -
trunk/SophyaLib/SkyT/derivblackbody.cc
r893 r909 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: derivblackbody.cc,v 1. 2 2000-04-12 10:24:52ansari Exp $3 // $Id: derivblackbody.cc,v 1.3 2000-04-13 14:10:44 ansari Exp $ 4 4 // 5 5 // Description: … … 20 20 #include "derivblackbody.h" 21 21 22 //---------------- 23 // Constructor -- 24 //---------------- 22 23 24 /*! \class SOPHYA::DerivBlackBody <BR> 25 * This class corresponds to the emission spectrum of a 26 * dipole (since its emission spectrum is the derivation 27 * of a blackbody spectrum wrt the temperature). 28 */ 29 30 /*! Constructor: needs a temperature. Otherwise set to ConvTools::tcmb */ 25 31 DerivBlackBody::DerivBlackBody(double temperature) 26 32 : RadSpectra(10., 10000.) … … 34 40 } 35 41 36 42 /*! 43 The flux function is the derivation of the BlackBody 44 flux function wrt the temperature (used e.g. for a Dipole) 45 \f[ 46 I_\nu = {2 h_{pl} (1.10^9*\nu)^3 {h_{pl}1.10^9*\nu \over k T^2} 47 {e^{{h_{pl}(1.10^9*\nu) \over kT}}\over c^2 (e^{{h_{pl}(1.10^9*\nu) \over kT}} -1)^2}} 48 \f] 49 */ 37 50 double 38 51 DerivBlackBody::flux(double nu) const -
trunk/SophyaLib/SkyT/gaussfilt.cc
r668 r909 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: gaussfilt.cc,v 1. 4 1999-11-29 14:16:04 ansari Exp $3 // $Id: gaussfilt.cc,v 1.5 2000-04-13 14:10:44 ansari Exp $ 4 4 // 5 5 // Description: … … 19 19 #include "gaussfilt.h" 20 20 21 //---------------- 22 // Constructor -- 23 //---------------- 21 /*! 22 * \class SOPHYA::GaussianFilter 23 * Gaussian detector response 24 */ 24 25 GaussianFilter::GaussianFilter() 25 26 : SpectralResponse() … … 28 29 } 29 30 31 /*! Constructor: the parameters correspond to the function defined in the 32 <a href="#gausseq"> equation </a> below 33 */ 30 34 GaussianFilter::GaussianFilter(double nu0, double s, double a, double numin, double numax) 31 35 : SpectralResponse(numin, numax) … … 46 50 // --------------------------- 47 51 52 /*! The transmission function is the wel known gaussian: 53 <a name="gausseq"> </a> 54 \f[ 55 \hbox{transmission}= A e^{-{({\nu-\nu_0\over s})^2}}; 56 \f] 57 */ 48 58 49 59 double -
trunk/SophyaLib/SkyT/nupower.cc
r669 r909 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: nupower.cc,v 1. 5 1999-11-29 16:59:10ansari Exp $3 // $Id: nupower.cc,v 1.6 2000-04-13 14:10:44 ansari Exp $ 4 4 // 5 5 // Description: … … 21 21 #include "nupower.h" 22 22 23 //---------------- 24 // Constructor -- 25 //---------------- 23 24 /*! 25 * \class SOPHYA::PowerLawSpectra <BR> 26 * This class corresponds to a power law radiation spectrum. 27 */ 26 28 PowerLawSpectra::PowerLawSpectra() 27 29 { 28 30 } 29 30 PowerLawSpectra::PowerLawSpectra(double a, double b, double nu0, double dnu, double numin, double numax) 31 /*! Constructor: The arguments corresponds to the Power Law Spectrum 32 equation: 33 <a name="psldef"> </a> 34 \f[ 35 \hbox{flux}(\nu) = A ({\nu-\nu_0\over \delta\nu})^B 36 \f] 37 */ 38 PowerLawSpectra::PowerLawSpectra(double A, double B, double nu0, double dnu, double numin, double numax) 31 39 : RadSpectra(numin, numax) 32 40 { 33 _a = a;34 _b = b;41 _a = A; 42 _b = B; 35 43 _nu0 = nu0; 36 44 _dnu = (dnu > 1.e-19) ? dnu : 1.; … … 41 49 { 42 50 } 43 51 /*! Flux function according to the <a href="#psldef"> above </a> 52 equation */ 44 53 double 45 54 PowerLawSpectra::flux(double nu) const -
trunk/SophyaLib/SkyT/radspec.cc
r668 r909 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: radspec.cc,v 1. 3 1999-11-29 14:16:06ansari Exp $3 // $Id: radspec.cc,v 1.4 2000-04-13 14:10:44 ansari Exp $ 4 4 // 5 5 // Description: … … 23 23 #include "integ.h" 24 24 25 /*! 26 * \class SOPHYA::RadSpectra <BR> 27 * This class is an abstract base class for radiation emission spectra. The flux() function returns the value of the flux (the spectral <BR> 28 * energy distribution) as a function of the frequency. As in the SpectralResponse class, the () operator has been redefined <BR> 29 * at this level, so that the user can access the flux value, either by calling the function or directly by using this operator. <BR> 30 * For all the sub-classes, \nu is given in units of Hz and 31 * the flux is returned in units of W/m^2/sr/Hz. 32 */ 33 34 25 35 //---------------- 26 36 // Constructor -- 27 37 //---------------- 38 /*! Default constructor */ 39 /*! 40 The constructor takes as an argument the minimum 41 and the maximum frequency of the spectrum, if any. <BR> 42 In the case the user does not want to specify these 43 values, there are set respectively to 0. and 9.E49 44 by default. 45 */ 28 46 RadSpectra::RadSpectra(double numin, double numax) 29 47 { … … 64 82 65 83 66 67 // peakFreq returns the value of the frequency for the 68 // peak of the spectrum. 84 /* 85 The peakFreq() function returns the value of the 86 frequency for the maximum value of the flux 87 */ 69 88 double 70 89 RadSpectra::peakFreq() const … … 85 104 } 86 105 87 // To change min-max frequency88 106 void 89 107 RadSpectra::setMinMaxFreq(double numin, double numax) … … 100 118 return(_raypourfinteg->flux(nu)); 101 119 } 102 120 /*! 121 The integratedFlux() function performs the integration 122 of the flux function in a frequency range <BR> defined by 123 f1 and f2. 124 */ 103 125 double 104 126 RadSpectra::integratedFlux(double f1, double f2) const 105 127 { 106 // cout << endl;107 // cout << this->minFreq() << " = " << this->maxFreq() << endl;108 // cout << f1 << " = " << f2 << endl;109 128 if(f1 < this->minFreq()) f1 = this->minFreq(); 110 129 if(f2 > this->maxFreq()) f2 = this->maxFreq(); … … 115 134 return(val); 116 135 } 136 137 /*! 138 Same than integratedFlux() over the frequency range 139 of definition of the flux function 140 */ 117 141 double 118 142 RadSpectra::integratedFlux() const … … 131 155 } 132 156 157 /*! 158 The logIntegratedFlux() function performs the integration 159 of the flux function in a frequency range <BR> defined by 160 f1 and f2. The integration is here performed 161 on the logarithm of the flux function. 162 */ 133 163 double 134 164 RadSpectra::logIntegratedFlux(double f1, double f2) const … … 148 178 } 149 179 180 /*! 181 same than logIntegratedFlux over the frequency range 182 of definition of the flux function 183 */ 150 184 double 151 185 RadSpectra::logIntegratedFlux() const … … 163 197 } 164 198 165 199 /*! 200 The filteredIntegratedFlux() function performs the integration 201 of the flux function in a frequency range <BR> defined by 202 f1 and f2 convolved by a SpectralResponse filter. 203 */ 166 204 double 167 205 RadSpectra::filteredIntegratedFlux(SpectralResponse const& filter, double f1, double f2) const … … 179 217 } 180 218 219 /*! 220 Same than filteredIntegratedFlux() over the frequency range 221 defined as: <BR> 222 min_freq = MAX(minfreq_flux, minfreq_filter), <BR> 223 max_freq = MIN(maxfreq_flux, maxfreq_filter), <BR> 224 where: 225 <UL> 226 <LI> minfreq_flux is the minimum frequency of the flux definition 227 <LI> maxfreq_flux is the maximum frequency of the flux definition 228 <LI> minfreq_filter is the minimum frequency of the filter definition 229 <LI> maxfreq_filter is the maximum frequency of the filter definition 230 </UL> 231 */ 181 232 double 182 233 RadSpectra::filteredIntegratedFlux(SpectralResponse const& filter) … … 201 252 202 253 254 /*! 255 * The filteredIntegratedFlux() function performs the integration 256 * of the flux function in a frequency range <BR> defined by 257 * f1 and f2 convolved by a SpectralResponse filter (using the 258 * logarithm of the function). 259 */ 203 260 double 204 261 RadSpectra::filteredLogIntFlux(SpectralResponse const& filter, double f1, double f2) const -
trunk/SophyaLib/SkyT/radspecvector.cc
r669 r909 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: radspecvector.cc,v 1. 5 1999-11-29 16:59:11ansari Exp $3 // $Id: radspecvector.cc,v 1.6 2000-04-13 14:10:45 ansari Exp $ 4 4 // 5 5 // Description: … … 26 26 // Constructor -- 27 27 //---------------- 28 29 /*! 30 * \class SOPHYA::RadSpectraVec 31 * One may define the radiation 32 * spectrum with two vectors: <BR> one for the frequencies and the second for the 33 * value of the flux function. <BR> 34 * In that case, the class to use is RadSpectraVec ! 35 */ 36 28 37 RadSpectraVec::RadSpectraVec() 29 38 { 30 39 } 31 40 /*! Constructor: 41 \param nu is the frequency vector <BR> 42 \param fdenu is the corresponding flux values (stored in a vector as well) 43 */ 32 44 RadSpectraVec::RadSpectraVec(Vector const & nu, Vector const & fdenu, double numin, double numax) 33 45 : RadSpectra(numin, numax) … … 55 67 56 68 57 69 /*! The flux function extrapolates the flux values for the 70 frequencies that are not present in the nu vector <BR> 71 given at the instanciation of the class. 72 */ 58 73 double 59 74 RadSpectraVec::flux(double nu) const -
trunk/SophyaLib/SkyT/specresp.cc
r668 r909 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: specresp.cc,v 1. 3 1999-11-29 14:16:08ansari Exp $3 // $Id: specresp.cc,v 1.4 2000-04-13 14:10:45 ansari Exp $ 4 4 // 5 5 // Description: … … 21 21 #include "tvector.h" 22 22 23 /*! 24 * \class SOPHYA::SpectralResponse <BR> 25 SpectralResponse corresponds to a detector filter's 26 response as a function of the frequency. 27 The SpectralResponse class is an abstract class. 28 The virtual constructor takes as arguments the 29 minimum and maximum values of the frequency range on 30 which the detector response is defined 31 */ 23 32 //---------------- 24 33 // Constructor -- … … 107 116 108 117 118 /*! 119 This function performs the integration 120 of the transmission function in its frequency range 121 (defined when instanciating an object of on of the 122 subclasses) 123 */ 109 124 double 110 125 SpectralResponse::IntegratedSpect() const … … 114 129 } 115 130 131 /*! 132 The IntegratedSpect function performs the integration 133 of the transmission function in a frequency range <BR> defined by 134 numin and numax. 135 */ 116 136 double 117 137 SpectralResponse::IntegratedSpect(double numin, double numax) const … … 137 157 } 138 158 159 /*! 160 The logIntegratedSpect function performs the integration 161 of the logarithm of the transmission function in a frequency range <BR> defined by 162 numin and numax. 163 */ 139 164 double 140 165 SpectralResponse::logIntegratedSpect(double numin, double numax) const … … 154 179 } 155 180 181 /*! 182 Same than IntegratedSpect(numin,numax) over its 183 frequency range defined at the initialisation 184 */ 156 185 double 157 186 SpectralResponse::logIntegratedSpect() const -
trunk/SophyaLib/SkyT/specrespvector.cc
r806 r909 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: specrespvector.cc,v 1. 6 2000-04-03 17:42:39ansari Exp $3 // $Id: specrespvector.cc,v 1.7 2000-04-13 14:10:45 ansari Exp $ 4 4 // 5 5 // Description: … … 26 26 // Constructor -- 27 27 //---------------- 28 /*! 29 * \class SOPHYA::SpecRespVec 30 One may also want to defined the filter of a detector by two vectors: 31 one for the frequencies and one for the corresponding transmission values. 32 In this case on should use the SpecRespVec class ! 33 */ 28 34 SpecRespVec::SpecRespVec() 29 35 : SpectralResponse() … … 31 37 } 32 38 39 /*! Constructor: 40 \param nu vector of the frequencies 41 \param fdenu vector of the corresponding transmission values of the filter 42 */ 33 43 SpecRespVec::SpecRespVec(Vector const & nu, Vector const & fdenu, double numin, double numax) 34 44 : SpectralResponse(numin, numax) … … 69 79 70 80 71 81 /*! The transmission function extrapolates the transmission values for the 82 frequencies that are not present in the nu vector <BR> 83 given at the instanciation of the class. 84 */ 72 85 double 73 86 SpecRespVec::transmission(double nu) const -
trunk/SophyaLib/SkyT/squarefilt.cc
r669 r909 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: squarefilt.cc,v 1. 4 1999-11-29 16:59:12ansari Exp $3 // $Id: squarefilt.cc,v 1.5 2000-04-13 14:10:45 ansari Exp $ 4 4 // 5 5 // Description: … … 17 17 18 18 #include "squarefilt.h" 19 20 /*! 21 * \class SOPHYA::SquareFilter 22 * Square detector response 23 */ 19 24 20 25 //---------------- … … 46 51 47 52 53 /*! The transmission returns 1. for frequencies in the [numin,numax] range 54 and 0. outside */ 48 55 double 49 56 SquareFilter::transmission(double nu) const -
trunk/SophyaLib/SkyT/trianglefilt.cc
r669 r909 1 1 //-------------------------------------------------------------------------- 2 2 // File and Version Information: 3 // $Id: trianglefilt.cc,v 1. 4 1999-11-29 16:59:13ansari Exp $3 // $Id: trianglefilt.cc,v 1.5 2000-04-13 14:10:46 ansari Exp $ 4 4 // 5 5 // Description: … … 21 21 // Constructor -- 22 22 //---------------- 23 23 /*! 24 * \class SOPHYA::TriangleFilter 25 * triangle detector response 26 */ 24 27 TriangleFilter::TriangleFilter() 25 28 : SpectralResponse() 26 29 { 27 30 } 31 /*! Constructor: nupeak is the frequency value at the hat of the triangle and 32 valueatpeak is the corresponding transmission value. */ 28 33 TriangleFilter::TriangleFilter(double numin, double numax,double nupeak, double valueatpeak) 29 34 : SpectralResponse(numin, numax) … … 44 49 // --------------------------- 45 50 51 /*! The transmission function is a triangle defined in the constructor 52 by numin and numax (for which the transmission goes to 0.) and 53 the hat of the triangle (defined by a peak frequency and the corresponding 54 transmission value. */ 46 55 double 47 56 TriangleFilter::transmission(double nu) const … … 64 73 TriangleFilter::peakTransmission() const 65 74 { 66 return _peakTransmission;75 return _peakTransmission; 67 76 } 68 77
Note:
See TracChangeset
for help on using the changeset viewer.