| 1 | //  Classes to compute simple quantities for radio / 21 cm | 
|---|
| 2 | //  R. Ansari - June 2010 | 
|---|
| 3 |  | 
|---|
| 4 | #ifndef RADUTIL_SEEN | 
|---|
| 5 | #define RADUTIL_SEEN | 
|---|
| 6 |  | 
|---|
| 7 | #include "machdefs.h"      // SOPHYA .h | 
|---|
| 8 | #include "sopnamsp.h"      // SOPHYA .h | 
|---|
| 9 |  | 
|---|
| 10 | #include "vector3d.h"      // conversion d'angle | 
|---|
| 11 |  | 
|---|
| 12 | class H21Conversions { | 
|---|
| 13 | public: | 
|---|
| 14 | // redshift nul, angle solide du pixel en steradian | 
|---|
| 15 | H21Conversions(double freq=0., double opix=1.e-5); | 
|---|
| 16 |  | 
|---|
| 17 | double toJansky(double temp);  // Conversion d'une temperature (Kelvin) en jansky | 
|---|
| 18 | double toKelvin(double jy);    // Conversion de Jansky en  temperature (Kelvin) | 
|---|
| 19 |  | 
|---|
| 20 | void setFrequency(double nu);  // on definit la frequence en MHz | 
|---|
| 21 | inline void setRedshift(double z)    // on definit le redshift | 
|---|
| 22 | { setFrequency(Freq021cm_Cst/(1+z)); } | 
|---|
| 23 | inline void setLambda(double lam)    // on definit la longueur d'onde en m | 
|---|
| 24 | { setFrequency(SpeedOfLight_Cst/lam); } | 
|---|
| 25 |  | 
|---|
| 26 | inline void setOmegaPix(double opix)   // angle solide en steradian | 
|---|
| 27 | { omegapix_ = opix; } | 
|---|
| 28 | inline void setOmegaPixDeg2(double opix)  // angle solide en Deg^2 | 
|---|
| 29 | { double cf=Angle(1.,Angle::Degree).ToRadian(); omegapix_ = opix*cf*cf; } | 
|---|
| 30 | inline void setOmegaPixArcmin2(double opix)  // angle solide en Arcmin^2 | 
|---|
| 31 | { double cf=Angle(1.,Angle::ArcMin).ToRadian(); omegapix_ = opix*cf*cf; } | 
|---|
| 32 |  | 
|---|
| 33 | inline double getRedshift() { return z_; } | 
|---|
| 34 | inline double getFrequency() { return freq_; } | 
|---|
| 35 | inline double getLambda() { return lambda_; } | 
|---|
| 36 |  | 
|---|
| 37 | inline double getOmegaPix()   // angle solide en steradian | 
|---|
| 38 | { return omegapix_; } | 
|---|
| 39 | inline double getOmegaPixArcmin2()  // angle solide en Arcmin^2 | 
|---|
| 40 | { double cf=Angle(1.,Angle::ArcMin).ToRadian(); return omegapix_/cf/cf; } | 
|---|
| 41 | inline double getOmegaPixDeg2()  // angle solide en Deg^2 | 
|---|
| 42 | { double cf=Angle(1.,Angle::Degree).ToRadian(); return omegapix_/cf/cf; } | 
|---|
| 43 |  | 
|---|
| 44 | static double SpeedOfLight_Cst;       // Speed of light  m/sec | 
|---|
| 45 | static double Freq021cm_Cst;       // Speed of light  m/sec | 
|---|
| 46 | static double k_Boltzman_Cst;         // Boltzmann constant  (SI Units) | 
|---|
| 47 |  | 
|---|
| 48 | double z_; | 
|---|
| 49 | double freq_; | 
|---|
| 50 | double lambda_; | 
|---|
| 51 | double omegapix_; | 
|---|
| 52 | }; | 
|---|
| 53 |  | 
|---|
| 54 | #endif | 
|---|