| 1 | #ifndef PLANCKSPECTRA_SEEN
 | 
|---|
| 2 | #define PLANCKSPECTRA_SEEN
 | 
|---|
| 3 | 
 | 
|---|
| 4 | #include "machdefs.h"
 | 
|---|
| 5 | #include "genericfunc.h"
 | 
|---|
| 6 | 
 | 
|---|
| 7 | namespace SOPHYA {
 | 
|---|
| 8 | 
 | 
|---|
| 9 | //-----------------------------------------------------------------------------------
 | 
|---|
| 10 | class PlanckSpectra : public GenericFunc {
 | 
|---|
| 11 | public:
 | 
|---|
| 12 | 
 | 
|---|
| 13 |   typedef enum {PLANCK=0, RAYLEIGH=1, WIEN=2} SpectraApprox;
 | 
|---|
| 14 |   typedef enum {POWER=0, PHOTON=1} SpectraPower;
 | 
|---|
| 15 |   typedef enum {VALUE=0, DERIV=1} SpectraFunc;
 | 
|---|
| 16 |   typedef enum {NU=0, LAMBDA=1} SpectraVar;
 | 
|---|
| 17 |   typedef enum {ANGSFLUX=0, SFLUX=1, DENSENERG=2, EXPON=3} SpectraUnit;
 | 
|---|
| 18 | 
 | 
|---|
| 19 |   PlanckSpectra(double T);
 | 
|---|
| 20 |   PlanckSpectra(PlanckSpectra& s);
 | 
|---|
| 21 |   virtual ~PlanckSpectra(void);
 | 
|---|
| 22 | 
 | 
|---|
| 23 |   inline void SetTemperature(double T) {T_ = T;}
 | 
|---|
| 24 |   inline double GetTemperature(void) {return T_;}
 | 
|---|
| 25 | 
 | 
|---|
| 26 |   void SetSpectraApprox(SpectraApprox spectraapprox=PLANCK);
 | 
|---|
| 27 |   void SetSpectraFunc(SpectraFunc spectrafunc=VALUE);
 | 
|---|
| 28 |   void SetSpectraVar(SpectraVar spectravar=NU);
 | 
|---|
| 29 |   void SetSpectraUnit(SpectraUnit spectraunit=ANGSFLUX);
 | 
|---|
| 30 |   void SetSpectraPower(SpectraPower spectrapower=POWER);
 | 
|---|
| 31 | 
 | 
|---|
| 32 | 
 | 
|---|
| 33 |   virtual double operator() (double x);
 | 
|---|
| 34 | 
 | 
|---|
| 35 |   double F2L(double nu_or_lambda);
 | 
|---|
| 36 |   double PlanckEnergie(void);
 | 
|---|
| 37 |   double PlanckPhoton(void);
 | 
|---|
| 38 |   double WienLaw(void);
 | 
|---|
| 39 |   double FindMaximum(double eps=0.001);
 | 
|---|
| 40 | 
 | 
|---|
| 41 | protected:
 | 
|---|
| 42 |   double T_;
 | 
|---|
| 43 |   SpectraApprox spectraapprox_;
 | 
|---|
| 44 |   SpectraFunc spectrafunc_;
 | 
|---|
| 45 |   SpectraVar spectravar_;
 | 
|---|
| 46 |   SpectraUnit spectraunit_;
 | 
|---|
| 47 |   SpectraPower spectrapower_;
 | 
|---|
| 48 | 
 | 
|---|
| 49 |   double PlanckExp(double fl);
 | 
|---|
| 50 |   double DPlanckExp_DT(double fl);
 | 
|---|
| 51 | 
 | 
|---|
| 52 | };
 | 
|---|
| 53 | 
 | 
|---|
| 54 | } // Fin du namespace SOPHYA
 | 
|---|
| 55 | 
 | 
|---|
| 56 | #endif
 | 
|---|