72 const Index& demand_vmr_value,
84 for(
Index sp = 0; sp < abs_species.
nelem() && ife < 0; sp++ )
92 if( demand_vmr_value )
94 throw runtime_error(
"Free electrons not found in *abs_species* and " 95 "contribution to refractive index can not be calculated." );
100 edensity = rtp_vmr[ife];
108 if( f_grid[0] < 100e6 )
110 throw runtime_error(
"All frequencies must be >= 100 MHz, but " 111 "this is not the case." );
113 if( edensity*k/(f_grid[0]*f_grid[0]) > 0.25 )
116 os <<
"All frequencies must at least be twice the plasma frequency.\n" 117 <<
"For this particular point, the plasma frequency is: " 118 << sqrt(edensity*k)/1e6 <<
" MHz.";
119 throw runtime_error( os.str() );
122 const Numeric f = ( f_grid[0] +
last(f_grid) ) / 2.0;
123 const Numeric a = edensity*k/(f*f);
124 const Numeric n = sqrt( 1 - a );
126 refr_index_air += n - 1;
127 refr_index_air_group += 1/n - 1;
139 const Numeric& rtp_temperature,
142 static const Numeric bn0 = 1.000272620045304;
143 static const Numeric bn02 = bn0*bn0;
144 static const Numeric bk = 288.16 * (bn02-1.0) / (1013.25*(bn02+2.0));
147 const Numeric n = sqrt( (2.0*bk*rtp_pressure/100.0+rtp_temperature) /
148 ( rtp_temperature-bk*rtp_pressure/100.0) ) - 1;
151 refr_index_air_group += n;
161 const Numeric& rtp_temperature,
170 throw runtime_error(
"The number of tag groups differ between " 171 "*rtp_vmr* and *abs_species*." );
182 e = rtp_pressure * rtp_vmr[firstH2O];
186 const Numeric n = ( a * ( rtp_pressure - e ) +
187 ( b + c / rtp_temperature ) * e ) / rtp_temperature;
190 refr_index_air_group += n;
200 const Numeric& rtp_temperature,
224 ref_spec_names[0] =
"N2";
225 ref_spec_names[1] =
"O2";
226 ref_spec_names[2] =
"CO2";
227 ref_spec_names[3] =
"H2";
228 ref_spec_names[4] =
"He";
229 ref_spec_names[5] =
"H2O";
234 ref_n[0] = 293.81e-6;
235 ref_n[1] = 266.95e-6;
236 ref_n[2] = 495.16e-6;
237 ref_n[3] = 135.77e-6;
239 ref_n[5] = 5368.37e-6;
243 throw runtime_error(
"The number of tag groups differ between " 244 "*rtp_vmr* and *abs_species*." );
269 for (
Index i=0; i<nrs; ++i) {
285 const Numeric ratioT = T0/rtp_temperature;
286 const Numeric ratiop = rtp_pressure/p0;
292 for (
Index i=0; i<nrs; ++i) {
293 if ( ref_spec_locations[i] >= 0 ) {
296 ref_spec_vmr_sum += rtp_vmr[ref_spec_locations[i]];
299 n += ref_n[i] * rtp_vmr[ref_spec_locations[i]];
315 if ( ref_spec_vmr_sum != 0 )
316 n /= ref_spec_vmr_sum;
319 n *= (ratioT*ratiop);
322 refr_index_air_group += n;
336 const Numeric& refr_index_real,
337 const Numeric& refr_index_imag,
340 complex_refr_index.
resize( 1, 1, 2 );
362 if (
min(t_grid) < 250)
365 out1 <<
"WARNING! The minimum chosen temperature is " <<
min(t_grid) <<
366 ". Temperatures below 250 K may lead to incorrect values of" 367 " *complex_refr_index*.\n";
373 complex_refr_index.
resize( nf, nt, 2 );
375 complex_refr_index.
set_grid( 0, f_grid );
377 complex_refr_index.
set_grid( 1, t_grid );
382 for (
Index t = 0; t < nt; ++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);
424 #pragma omp parallel for \ 425 if (!arts_omp_in_parallel() && nf > 1) \ 427 for (
Index f = 0; f < nf; ++f)
428 for (
Index t = 0; t < nt; ++t)
430 n =
refice_( 1e6*SPEED_OF_LIGHT/f_grid[f], t_grid[t] );
431 complex_refr_index.
data(f, t, 0) = n.real();
432 complex_refr_index.
data(f, t, 1) = n.imag();
446 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.
Explicit construction of Arrays.
Declarations having to do with the four output streams.
const Numeric ELECTRON_MASS
void refr_index_airIR(Numeric &refr_index_air, Numeric &refr_index_air_group, const Numeric &rtp_pressure, const Numeric &rtp_temperature, const Verbosity &)
WORKSPACE METHOD: refr_index_airIR.
Numeric last(ConstVectorView x)
last
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_airMWgeneral(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_airMWgeneral.
The global header file for ARTS.
void refr_index_airThayer(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 &a, const Numeric &b, const Numeric &c, const Verbosity &)
WORKSPACE METHOD: refr_index_airThayer.
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.
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 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.
const Numeric SPEED_OF_LIGHT
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.