00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00031
00032
00033
00034
00035 #include <stdexcept>
00036 #include <cmath>
00037 #include "matpackI.h"
00038 #include "exceptions.h"
00039 #include "complex.h"
00040
00041 extern const Numeric PI;
00042 extern const Numeric DEG2RAD;
00043 extern const Numeric RAD2DEG;
00045
00057 void fastem(
00058 VectorView surface_emiss,
00059
00060 const Numeric& surface_temp,
00061 ConstVectorView surface_wind,
00062 ConstVectorView surface_fastem_constants,
00063 const Numeric& freq
00064 )
00065 {
00066
00067
00068
00069
00070
00071 Numeric temp_c = surface_temp - 273.15;
00072 Numeric temp_cc = temp_c * temp_c;
00073 Numeric temp_ccc = temp_cc * temp_c;
00074
00075 if ( (temp_c < -5.0) || (temp_c > 100.0) ||
00076 (freq < 10e+9) || (freq > 500e+9) )
00077 {
00078
00079 ostringstream os;
00080 os << "Severe warning from dclamkaouchi: "
00081 << "The accepted temperature range in centigrade is "
00082 << "[-5,100],\nbut a value of " << temp_c
00083 << "degree C was found. Also the allowed frequency range is "
00084 << "[10 GHz,500 GHz],\nbut a value of " << freq
00085 << " was found.";
00086
00087 throw runtime_error( os.str() );
00088 }
00089 else
00090 if ( (freq < 20e+9) || (freq > 200e+9) )
00091 {
00092
00093 ostringstream os;
00094 os << "Warning from dclamkaouchi: "
00095 << "The accepted temperature range in centigrade is "
00096 << "[-5,100],\nbut a value of " << temp_c
00097 << "degree C was found. Also the allowed frequency range is "
00098 << "[10 GHz,500 GHz],\nbut a value of " << freq
00099 << " was found."<< surface_wind;
00100
00101
00102
00103
00104
00105 throw runtime_error( os.str() );
00106 }
00107
00108
00109 Numeric tau1 = surface_fastem_constants[0] + surface_fastem_constants[1]* temp_c +
00110 surface_fastem_constants[2] * temp_cc;
00111
00112 Numeric tau2 = surface_fastem_constants[3] + surface_fastem_constants[4]* temp_c +
00113 surface_fastem_constants[5] * temp_cc + surface_fastem_constants[6] * temp_ccc;
00114
00115
00116 Numeric del1 = surface_fastem_constants[7] + surface_fastem_constants[8]* temp_c +
00117 surface_fastem_constants[9] * temp_cc + surface_fastem_constants[10] * temp_ccc;
00118
00119 Numeric del2 = surface_fastem_constants[11] + surface_fastem_constants[12]* temp_c +
00120 surface_fastem_constants[13] * temp_cc + surface_fastem_constants[14] * temp_ccc;
00121
00122 Numeric einf = surface_fastem_constants[17] + surface_fastem_constants[18] * temp_c;
00123
00124
00125 Numeric fen = 2.0 * surface_fastem_constants[19] * freq/1e+9 * 0.001;
00126 Numeric fen2 = pow(fen,2);
00127 Numeric den1 = 1.0 + fen2 * tau1 * tau1;
00128 Numeric den2 = 1.0 + fen2 * tau2 * tau2;
00129 Numeric perm_real1 = del1/den1;
00130 Numeric perm_real2 = del2/den2;
00131 Numeric perm_imag1 = del1 * fen * tau1/den1;
00132 Numeric perm_imag2 = del2 * fen * tau2/den2;
00133 Numeric perm_real = perm_real1 + perm_real2 + einf;
00134 Numeric perm_imag = perm_imag1 + perm_imag2;
00135
00136 Complex xperm (perm_real, perm_imag);
00137
00138
00139
00140
00141
00142 Numeric theta = 55.0;
00143
00144 Numeric cos_theta = cos(theta * DEG2RAD);
00145 Numeric sin_theta = sin(theta * DEG2RAD);
00146
00147
00148 Numeric sin_2 = pow(sin_theta, 2);
00149
00150 Complex perm1 = sqrt(xperm - sin_2);
00151 Complex perm2 = xperm * cos_theta;
00152
00153 Complex rhth = (cos_theta - perm1)/(cos_theta + perm1);
00154 Complex rvth = (perm2 - perm1)/(perm2 + perm1);
00155
00156
00157
00158 Numeric rvertsr = real(rvth);
00159 Numeric rvertsi = imag(rvth);
00160
00161 Numeric rverts = pow(rvertsr, 2) + pow(rvertsi, 2);
00162
00163
00164
00165 Numeric rhorzsr = real(rhth);
00166 Numeric rhorzsi = imag(rhth);
00167 Numeric rhorzs = pow(rhorzsr, 2) + pow(rhorzsi, 2);
00168
00169 surface_emiss[0] = rverts;
00170 surface_emiss[1] = rhorzs;
00171 surface_emiss[2] = 0;
00172 surface_emiss[3] = 0;
00173
00174
00175 }
00176
00177