10 : bwpar_(bwpar), press_(press), temp_(temp)
12 if(press_.rows() != temp_.rows()) {
14 err <<
"Number of pressure layers " << press_.rows()
15 <<
" does not match number of temperature layers " << temp_.rows();
24 return refr_index_rs(bwpar_, press_(level_index), temp_(level_index));
32 AutoDerivative<double> fp = exp( interp_val * log(press_(layer_index)) + (1 - interp_val) * log(press_(layer_index+1)) );
44 : ref_wvl_(reference_wavelength), press_(press), temp_(temp), co2_vmr_(co2_vmr), h2o_vmr_(h2o_vmr)
46 if( press_.rows() != temp_.rows() ||
47 press_.rows() != co2_vmr_.rows() ||
48 press_.rows() != h2o_vmr_.rows() ) {
50 err <<
"Number of pressure layers " << press_.rows()
51 <<
" and number of temperature layers " << temp_.rows()
52 <<
" and number of CO2 layers " << co2_vmr_.rows()
53 <<
" and number of H2O layers " << h2o_vmr_.rows()
54 <<
" must all be the same size.";
63 return refr_index_vn(ref_wvl_, press_(level_index), temp_(level_index), co2_vmr_(level_index), h2o_vmr_(level_index));
71 AutoDerivative<double> fp = exp( interp_val * log(press_(layer_index)) + (1 - interp_val) * log(press_(layer_index+1)) );
73 AutoDerivative<double> fc = interp_val * co2_vmr_(layer_index) + (1 - interp_val) * co2_vmr_(layer_index+1);
74 AutoDerivative<double> fh = interp_val * h2o_vmr_(layer_index) + (1 - interp_val) * h2o_vmr_(layer_index+1);
81 if ( ((wavelength >= 0.755e0) && (wavelength <= 0.785e0)) ||
82 ((wavelength >= 1.58e0) && (wavelength <= 1.65e0)) ||
83 ((wavelength >= 2.03e0) && (wavelength <= 2.09e0)) )
100 const double T_STANDARD = 273.16E0;
101 const double P_STANDARD = 1013.25E0;
102 const double STP_RATIO = T_STANDARD / P_STANDARD;
106 double alpha = bwpar * STP_RATIO;
126 if ((wl >= 0.755e0) && (wl <= 0.785e0)) {
127 double wlm2 = 1.e0/
pow(wl, 2);
132 double nsm1 = (8015.514e0 + 2368616.e0 / (128.7459e0 - wlm2) +
133 19085.73e0 / (50.01974e0 - wlm2)) * 1.e-8;
152 double Lw = (
pow(nw,2) - 1.e0) / (
pow(nw,2) + 2.e0);
170 nair = sqrt((1.e0 + 2.e0 * L)/(1.e0 - L));
172 }
else if (((wl >= 1.58e0) && (wl <= 1.65e0)) ||
173 ((wl >= 2.03e0) && (wl <= 2.09e0))) {
176 if ((wl >= 1.58e0) && (wl <= 1.6e0)) {
182 double n1 = 2.6859e-4;
183 double n2 = 2.6855e-4;
184 na = 1.e0 + n1 + ((wl - 1.55e0) / 0.05e0) * (n2 - n1);
191 nw = 1.e0 + n1 + ((wl - 1.55e0) / 0.05e0) * (n2 - n1);
193 }
else if ((wl > 1.6e0) && (wl <= 1.65e0)) {
194 double n1 = 2.6855e-4;
195 double n2 = 2.6851e-4;
196 na = 1.e0 + n1 + ((wl - 1.6e0) / 0.05e0) * (n2 - n1);
200 nw = 1.e0 + n1 + ((wl - 1.6e0) / 0.05e0) * (n2 - n1);
202 }
else if ((wl >= 2.03e0) && (wl <= 2.05e0)) {
203 double n1 = 2.6833e-4;
204 double n2 = 2.6831e-4;
205 na = 1.e0 + n1 + ((wl - 2.e0) / 0.05e0) * (n2 - n1);
209 nw = 1.e0 + n1 + ((wl - 2.e0) / 0.05e0) * (n2 - n1);
211 }
else if ((wl > 2.05e0) && (wl <= 2.09e0)) {
212 double n1 = 2.6831e-4;
213 double n2 = 2.683e-4;
214 na = 1.e0 + n1 + ((wl - 2.05e0) / 0.05e0) * (n2 - n1);
218 nw = 1.e0 + n1 + ((wl - 2.05e0) / 0.05e0) * (n2 - n1);
238 double Mas = (28.9635e0 + 12.011e0 * (0.00045e0 - 0.0004e0)) * 1.e-3;
250 nair = 1.e0 + (rhoa / rhoas) * (na - 1.e0) + (rhow / rhows) * (nw - 1.e0);
253 throw Exception(
"Can not compute refractive index outside spectral range handled by this function");
266 p * (1.e0 + p * (0.621811e0 - 0.0126531e0 * tc + 0.000066e0 *
pow(tc,2)) *
267 1.e-8) / (1.e0 + 0.003661e0 * tc);
276 double w0, w1, w2, w3;
284 double nw = 1.022e0*(w0+w1*wlm2+w2*
pow(wlm2,2)+w3*
pow(wlm2,3))*1.e-8+1.e0;
293 double a0, a1, a2, b0, b1, c0, c1, d, e;
307 pow((p/T),2)*(d+e*
pow(xw,2));
315 const double R = 8.314510e0;
#define range_check(V, Min, Max)
Range check.
AutoDerivative< double > calc_Z(const AutoDerivative< double > &p, const AutoDerivative< double > &T, const AutoDerivative< double > &tc, const AutoDerivative< double > &xw)
virtual AutoDerivative< double > at_layer(int layer_index, const AutoDerivative< double > &interp_val) const
Returns refractive index at a layer index interpolated between bounding levels using a linear interpo...
virtual AutoDerivative< double > at_level(int level_index) const
Returns refractive index at a level index.
This is the base of the exception hierarchy for Full Physics code.
AutoDerivative< double > refr_index_vn(double wl, const AutoDerivative< double > &p, const AutoDerivative< double > &T, const AutoDerivative< double > &xc, const AutoDerivative< double > &xw)
AutoDerivative< double > calc_rho(const AutoDerivative< double > &p, const AutoDerivative< double > &x, const AutoDerivative< double > &M, const AutoDerivative< double > &Z, const AutoDerivative< double > &T)
virtual int number_level() const
Number of levels of atmospheric data represented.
AutoDerivative< double > calc_Dair(const AutoDerivative< double > &p, const AutoDerivative< double > &tc)
Apply value function to a blitz array.
AutoDerivative< double > refr_index_rs(double bwpar, const AutoDerivative< double > &press, const AutoDerivative< double > &temp)
virtual int number_level() const
Number of levels of atmospheric data represented.
Unit pow(const Unit &Dunit, const boost::rational< int > &Exponent)
virtual int number_layer() const
Number of layers of atmospheric data represented.
virtual AutoDerivative< double > at_layer(int layer_index, const AutoDerivative< double > &interp_val) const
Returns refractive index at a layer index interpolated between bounding levels using a linear interpo...
Contains classes to abstract away details in various Spurr Radiative Transfer software.
SimpleRefractiveIndex(double bwpar, const blitz::Array< AutoDerivative< double >, 1 > &press, const blitz::Array< AutoDerivative< double >, 1 > &temp)
virtual AutoDerivative< double > at_level(int level_index) const
Returns refractive index at a level index.
static bool wavelength_in_bounds(double wavelength)
Determines if the passed wavelength value in microns is within the bounds of those accepted by the cl...
double value(const FullPhysics::AutoDerivative< double > &Ad)
double calc_nw(double wlm2)
OcoRefractiveIndex(double reference_wavelength, const blitz::Array< AutoDerivative< double >, 1 > &press, const blitz::Array< AutoDerivative< double >, 1 > &temp, const blitz::Array< AutoDerivative< double >, 1 > &co2_vmr, const blitz::Array< AutoDerivative< double >, 1 > &h2o_vmr)
Creates a refractive index class that can better calculate refractive index for data with in the OCO ...