87 const Numeric theta = 1 - 300 / t;
88 const Numeric e0 = 77.66 - 103.3 * theta;
90 const Numeric f1 = 20.2 + 146 * theta + 316 * theta * theta;
94 for (
Index iv = 0; iv < nf; iv++) {
95 const Complex ifGHz(0.0, f_grid[iv] / 1e9);
98 (e0 - e1) / (
Numeric(1.0) - ifGHz / f1));
100 complex_n(iv, 0) = n.real();
101 complex_n(iv, 1) = n.imag();
140 const Numeric deltabeta = exp(-9.963 + 0.0372 * (t - 273));
142 const Numeric betam = (B1 / t) * ebdt / ((ebdt - 1.) * (ebdt - 1.));
144 const Numeric theta = 300. / t - 1;
145 const Numeric alfa = (0.00504 + 0.0062 * theta) * exp(-22.1 * theta);
146 const Numeric reps = 3.1884 + 9.1e-4 * (t - 273);
148 for (
Index iv = 0; iv < nf; iv++) {
150 Numeric beta = betam + B2 * f * f + deltabeta;
151 Numeric ieps = alfa / f + beta * f;
155 complex_n(iv, 0) = n.real();
156 complex_n(iv, 1) = n.imag();
190 const Agenda& refr_index_air_agenda,
198 Numeric rtp_pressure, rtp_temperature;
211 itw2p(dummy, p_grid, gp, itw);
212 rtp_pressure = dummy[0];
216 rtp_temperature = dummy[0];
223 for (
Index is = 0; is < ns; is++) {
224 interp(dummy, itw, vmr_field(is,
joker, 0, 0), gp);
225 rtp_vmr[is] = dummy[0];
230 refr_index_air_group,
235 refr_index_air_agenda);
270 const Agenda& refr_index_air_agenda,
280 Numeric rtp_pressure, rtp_temperature;
288 gridpos(gp_lat, lat_grid, lat);
304 itw2p(dummy, p_grid, gp_p, itw);
305 rtp_pressure = dummy[0];
311 rtp_temperature = dummy[0];
318 for (
Index is = 0; is < ns; is++) {
320 rtp_vmr[is] = dummy[0];
325 refr_index_air_group,
330 refr_index_air_agenda);
363 const Agenda& refr_index_air_agenda,
375 Numeric rtp_pressure, rtp_temperature;
383 gridpos(gp_lat, lat_grid, lat);
384 gridpos(gp_lon, lon_grid, lon);
386 z_grid, p_grid, lat_grid, lon_grid, z_field, gp_lat[0], gp_lon[0]);
401 itw2p(dummy, p_grid, gp_p, itw);
402 rtp_pressure = dummy[0];
407 interp(dummy, itw, t_field, gp_p, gp_lat, gp_lon);
408 rtp_temperature = dummy[0];
415 for (
Index is = 0; is < ns; is++) {
418 rtp_vmr[is] = dummy[0];
423 refr_index_air_group,
428 refr_index_air_agenda);
461 const Agenda& refr_index_air_agenda,
471 refr_index_air_group,
472 refr_index_air_agenda,
481 const Numeric n0 = refr_index_air;
487 refr_index_air_agenda,
496 dndr = refr_index_air - n0;
539 const Agenda& refr_index_air_agenda,
551 refr_index_air_group,
552 refr_index_air_agenda,
563 const Numeric n0 = refr_index_air;
569 refr_index_air_agenda,
580 dndr = refr_index_air - n0;
587 refr_index_air_agenda,
598 dndlat = (refr_index_air - n0) / (
DEG2RAD * dlat * r);
646 const Agenda& refr_index_air_agenda,
660 refr_index_air_group,
661 refr_index_air_agenda,
674 const Numeric n0 = refr_index_air;
680 refr_index_air_agenda,
693 dndr = refr_index_air - n0;
700 refr_index_air_agenda,
713 dndlat = (refr_index_air - n0) / (
DEG2RAD * dlat * r);
720 refr_index_air_agenda,
733 dndlon = (refr_index_air - n0) / (
DEG2RAD * dlon * r * cos(
DEG2RAD * lat));
739 const Index& only_valid_range,
749 const Numeric lambda_star = 0.589;
752 bool T_ok = (temperature > T_star - 12) && (temperature < T_star + 500);
753 bool rho_ok = (density > 0) && (density < 1060);
754 bool wvl_ok = (wavelength > 0.2) && (wavelength < 1.9);
756 if (only_valid_range) {
758 "Refractive index is calculated outside range of "
760 "Temperature must be between ",
765 "Desired temperature: ",
770 "Refractive index is calculated outside range of "
772 "Density must be between ",
785 "Refractive index is calculated outside range of "
787 "Frequency must be between ",
798 const Numeric a0 = 0.244257733;
801 const Numeric a3 = 2.68678472e-4;
802 const Numeric a4 = 1.58920570e-3;
803 const Numeric a5 = 2.45934259e-3;
804 const Numeric a6 = 0.900704920;
805 const Numeric a7 = -1.66626219e-2;
807 const Numeric lambda_uv = 0.2292020;
808 const Numeric lambda_ir = 5.432937;
811 Numeric T_bar = temperature / T_star;
812 Numeric rho_bar = density / rho_star;
813 Numeric lambda_bar = wavelength / lambda_star;
819 rhs += a3 * lambda_bar * lambda_bar * T_bar;
820 rhs += a4 / (lambda_bar * lambda_bar);
821 rhs += a5 / (lambda_bar * lambda_bar - lambda_uv * lambda_uv);
822 rhs += a6 / (lambda_bar * lambda_bar - lambda_ir * lambda_ir);
823 rhs += a7 * rho_bar * rho_bar;
830 n_cmplx /=
sqrt(
a - 1);
base max(const Array< base > &x)
Max function.
base min(const Array< base > &x)
Min function.
Constants of physical expressions as constexpr.
void refr_index_air_agendaExecute(Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, const Numeric rtp_pressure, const Numeric rtp_temperature, const Vector &rtp_vmr, const Vector &f_grid, const Agenda &input_agenda)
A constant view of a Tensor3.
A constant view of a Tensor4.
Index nbooks() const noexcept
A constant view of a Vector.
Index nelem() const noexcept
Returns the number of elements.
void resize(Index r, Index c)
Resize function.
void resize(Index n)
Resize function.
#define ARTS_USER_ERROR_IF(condition,...)
Numeric refell2d(ConstVectorView refellipsoid, ConstVectorView lat_grid, const GridPos gp)
refell2d
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
Header file for interpolation.cc.
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.
std::complex< Numeric > Complex
constexpr Numeric real(Complex c) noexcept
real
constexpr Numeric temperature_at_0c
Global constant, Temperature in Celsius of 0 Kelvin.
constexpr auto deg2rad(auto x) noexcept
Converts degrees to radians.
constexpr auto freq2wavelen(auto x) noexcept
Conversion from Hz to wavelength.
constexpr auto rad2deg(auto x) noexcept
Converts radians to degrees.
constexpr auto wavelen2freq(auto x) noexcept
Conversion from wavelength to Hz.
Numeric sqrt(const Rational r)
Square root.
void refr_gradients_3d(Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, Numeric &dndr, Numeric &dndlat, Numeric &dndlon, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r, const Numeric &lat, const Numeric &lon)
refr_gradients_3d
void get_refr_index_3d(Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r, const Numeric &lat, const Numeric &lon)
void complex_n_ice_matzler06(Matrix &complex_n, const Vector &f_grid, const Numeric &t)
complex_n_ice_matzler06
void get_refr_index_1d(Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r)
get_refr_index_1d
void refr_gradients_2d(Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, Numeric &dndr, Numeric &dndlat, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r, const Numeric &lat)
refr_gradients_2d
constexpr Numeric DEG2RAD
void get_refr_index_2d(Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r, const Numeric &lat)
get_refr_index_2d
constexpr Numeric RAD2DEG
void refr_gradients_1d(Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, Numeric &dndr, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r)
refr_gradients_1d
void complex_n_water_liebe93(Matrix &complex_n, const Vector &f_grid, const Numeric &t)
complex_n_water_liebe93
void refractive_index_water_and_steam_VisNIR(Numeric &n, const Index &only_valid_range, const Numeric &frequency, const Numeric &temperature, const Numeric &density)
Refractive index of water and steam for the optical and near infrared .
constexpr Numeric TEMP_0_C
void itw2p(VectorView p_values, ConstVectorView p_grid, const ArrayOfGridPos &gp, ConstMatrixView itw)
Converts interpolation weights to pressures.
void z_at_latlon(VectorView z, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, const GridPos &gp_lat, const GridPos &gp_lon)
Returns the geomtrical altitudes of p_grid for one latitude and one longitude.
void z_at_lat_2d(VectorView z, ConstVectorView p_grid, ConstVectorView lat_grid, ConstMatrixView z_field, const GridPos &gp_lat)
Returns the geomtrical altitudes of p_grid for one latitude.
Header file for special_interp.cc.