65 const Index& demand_vmr_value,
76 for (
Index sp = 0; sp < abs_species.
nelem() && ife < 0; sp++) {
83 if (demand_vmr_value) {
85 "Free electrons not found in *abs_species* and " 86 "contribution to refractive index can not be calculated.");
89 edensity = rtp_vmr[ife];
96 if (f_grid[0] < 100e6) {
98 "All frequencies must be >= 100 MHz, but " 99 "this is not the case.");
101 if (edensity * k / (f_grid[0] * f_grid[0]) > 0.25) {
103 os <<
"All frequencies must at least be twice the plasma frequency.\n" 104 <<
"For this particular point, the plasma frequency is: " 105 <<
sqrt(edensity * k) / 1e6 <<
" MHz.";
106 throw runtime_error(os.
str());
109 const Numeric f = (f_grid[0] +
last(f_grid)) / 2.0;
110 const Numeric a = edensity * k / (f * f);
113 refr_index_air += n - 1;
114 refr_index_air_group += 1 / n - 1;
123 const Numeric& rtp_temperature,
125 static const Numeric bn0 = 1.000272620045304;
126 static const Numeric bn02 = bn0 * bn0;
127 static const Numeric bk = 288.16 * (bn02 - 1.0) / (1013.25 * (bn02 + 2.0));
130 const Numeric n =
sqrt((2.0 * bk * rtp_pressure / 100.0 + rtp_temperature) /
131 (rtp_temperature - bk * rtp_pressure / 100.0)) -
135 refr_index_air_group +=
n;
142 const Numeric& rtp_temperature,
151 "The number of tag groups differ between " 152 "*rtp_vmr* and *abs_species*.");
163 e = rtp_pressure * rtp_vmr[firstH2O];
166 (k1 * (rtp_pressure - e) + (k2 + k3 / rtp_temperature) * e) /
170 refr_index_air_group +=
n;
178 const Numeric& rtp_temperature,
201 ref_spec_names[0] =
"N2";
202 ref_spec_names[1] =
"O2";
203 ref_spec_names[2] =
"CO2";
204 ref_spec_names[3] =
"H2";
205 ref_spec_names[4] =
"He";
206 ref_spec_names[5] =
"H2O";
211 ref_n[0] = 293.81e-6;
212 ref_n[1] = 266.95e-6;
213 ref_n[2] = 495.16e-6;
214 ref_n[3] = 135.77e-6;
219 ref_n[5] = 5338.89e-6;
224 "The number of tag groups differ between " 225 "*rtp_vmr* and *abs_species*.");
265 const Numeric ratioT = T0 / rtp_temperature;
266 const Numeric ratiop = rtp_pressure / p0;
273 if (ref_spec_locations[
i] >= 0) {
275 ref_spec_vmr_sum += rtp_vmr[ref_spec_locations[
i]];
278 n += ref_n[
i] * rtp_vmr[ref_spec_locations[
i]];
294 if (ref_spec_vmr_sum != 0) n /= ref_spec_vmr_sum;
297 n *= (ratioT * ratiop);
300 refr_index_air_group +=
n;
309 const Numeric& refr_index_real,
310 const Numeric& refr_index_imag,
312 complex_refr_index.
resize(1, 1, 2);
318 complex_refr_index.
set_grid(2, {
"real",
"imaginary"});
329 if (
min(t_grid) < 250) {
331 out1 <<
"WARNING! The minimum chosen temperature is " <<
min(t_grid)
332 <<
". Temperatures below 250 K may lead to incorrect values of" 333 " *complex_refr_index*.\n";
339 complex_refr_index.
resize(nf, nt, 2);
341 complex_refr_index.
set_grid(0, f_grid);
343 complex_refr_index.
set_grid(1, t_grid);
345 complex_refr_index.
set_grid(2, {
"real",
"imaginary"});
348 for (
Index t = 0; t < nt; ++t) {
366 "min of complex_refr_index f_grid",
min(f_grid), f_min, f_max);
368 "max of complex_refr_index f_grid",
max(f_grid), f_min, f_max);
374 "min of complex_refr_index t_grid",
min(t_grid), t_min, t_max);
376 "max of complex_refr_index t_grid",
max(t_grid), t_min, t_max);
378 complex_refr_index.
resize(nf, nt, 2);
380 complex_refr_index.
set_grid(0, f_grid);
382 complex_refr_index.
set_grid(1, t_grid);
384 complex_refr_index.
set_grid(2, {
"real",
"imaginary"});
387 for (
Index i_t = 0; i_t < nt; ++i_t) {
404 const Numeric f_max = 1e6 * SPEED_OF_LIGHT / 0.0443;
405 const Numeric f_min = 1e6 * SPEED_OF_LIGHT / 8.6e6;
415 complex_refr_index.
resize(nf, nt, 2);
417 complex_refr_index.
set_grid(0, f_grid);
419 complex_refr_index.
set_grid(1, t_grid);
421 complex_refr_index.
set_grid(2, {
"real",
"imaginary"});
427 for (
Index f = 0; f < nf; ++f)
428 for (
Index t = 0; t < nt; ++t) {
429 n =
refice_(1e6 * SPEED_OF_LIGHT / f_grid[f], t_grid[t]);
430 complex_refr_index.
data(f, t, 0) = n.real();
431 complex_refr_index.
data(f, t, 1) = n.imag();
444 throw std::runtime_error(
"ARTS was not compiled with Fortran support.");
INDEX Index
The type to use for all integer numbers and indices.
void complex_refr_indexWaterLiebe93(GriddedField3 &complex_refr_index, const Vector &f_grid, const Vector &t_grid, const Verbosity &verbosity)
WORKSPACE METHOD: complex_refr_indexWaterLiebe93.
Complex refice_(const Numeric &wavlen, const Numeric &temp)
Calculates complex refractive index of Ice 1H.
Index nelem() const
Number of elements.
Declarations having to do with the four output streams.
const Numeric ELECTRON_MASS
Numeric last(ConstVectorView x)
last
invlib::Vector< ArtsVector > Vector
invlib wrapper type for ARTS vectors.
void refr_index_airMicrowavesEarth(Numeric &refr_index_air, Numeric &refr_index_air_group, const Numeric &rtp_pressure, const Numeric &rtp_temperature, const Vector &rtp_vmr, const ArrayOfArrayOfSpeciesTag &abs_species, const Numeric &k1, const Numeric &k2, const Numeric &k3, const Verbosity &)
WORKSPACE METHOD: refr_index_airMicrowavesEarth.
Index nelem() const
Returns the number of elements.
void complex_n_water_liebe93(Matrix &complex_n, const Vector &f_grid, const Numeric &t)
complex_n_water_liebe93
void refr_index_airMicrowavesGeneral(Numeric &refr_index_air, Numeric &refr_index_air_group, const Numeric &rtp_pressure, const Numeric &rtp_temperature, const Vector &rtp_vmr, const ArrayOfArrayOfSpeciesTag &abs_species, const Verbosity &)
WORKSPACE METHOD: refr_index_airMicrowavesGeneral.
The global header file for ARTS.
_CS_string_type str() const
std::complex< Numeric > Complex
void set_grid(Index i, const Vector &g)
Set a numeric grid.
const Numeric VACUUM_PERMITTIVITY
NUMERIC Numeric
The type to use for all floating point numbers.
Declarations required for the calculation of absorption coefficients.
Implementation of Matrix, Vector, and such stuff.
Header file for special_interp.cc.
Index species_index_from_species_name(String name)
Return species index for given species name.
void complex_refr_indexConstant(GriddedField3 &complex_refr_index, const Numeric &refr_index_real, const Numeric &refr_index_imag, const Verbosity &)
WORKSPACE METHOD: complex_refr_indexConstant.
void complex_refr_indexIceWarren84(GriddedField3 &, const Vector &, const Vector &, const Verbosity &)
WORKSPACE METHOD: complex_refr_indexIceWarren84.
void refr_index_airInfraredEarth(Numeric &refr_index_air, Numeric &refr_index_air_group, const Numeric &rtp_pressure, const Numeric &rtp_temperature, const Verbosity &)
WORKSPACE METHOD: refr_index_airInfraredEarth.
void complex_n_ice_matzler06(Matrix &complex_n, const Vector &f_grid, const Numeric &t)
complex_n_ice_matzler06
void set_grid_name(Index i, const String &s)
Set grid name.
const Numeric ELECTRON_CHARGE
void resize(const GriddedField3 &gf)
Make this GriddedField3 the same size as the given one.
void complex_refr_indexIceMatzler06(GriddedField3 &complex_refr_index, const Vector &f_grid, const Vector &t_grid, const Verbosity &)
WORKSPACE METHOD: complex_refr_indexIceMatzler06.
const Numeric SPEED_OF_LIGHT
This file contains declerations of functions of physical character.
void refr_index_airFreeElectrons(Numeric &refr_index_air, Numeric &refr_index_air_group, const Vector &f_grid, const ArrayOfArrayOfSpeciesTag &abs_species, const Vector &rtp_vmr, const Index &demand_vmr_value, const Verbosity &)
WORKSPACE METHOD: refr_index_airFreeElectrons.
Numeric sqrt(const Rational r)
Square root.