51 return (180 -
abs(rte_los[0]) +
abs(specular_los[0])) / 2;
57 while (z_surface >= z_profile[ip+1]) {
73 iy = surface_emission;
77 for (
Index ilos = 0; ilos < nlos; ilos++) {
80 for (
Index iv = 0; iv < nf; iv++) {
82 iy(iv,
joker) += rtmp;
93 const Index& stokes_dim,
94 const Numeric& surface_skin_t) {
95 assert(surface_rmatrix.
nrows() == stokes_dim);
96 assert(surface_rmatrix.
ncols() == stokes_dim);
97 assert(surface_emission.
nelem() == stokes_dim);
101 surface_rmatrix = 0.0;
102 surface_emission = 0.0;
108 const Numeric rmean = (rv + rh) / 2;
110 surface_rmatrix(0, 0) = rmean;
111 surface_emission[0] = B * (1 - rmean);
113 if (stokes_dim > 1) {
114 const Numeric rdiff = (rv - rh) / 2;
116 surface_rmatrix(1, 0) = rdiff;
117 surface_rmatrix(0, 1) = rdiff;
118 surface_rmatrix(1, 1) = rmean;
119 surface_emission[1] = -B * rdiff;
121 if (stokes_dim > 2) {
124 const Numeric c = real(a + b) / 2.0;
126 surface_rmatrix(2, 2) = c;
128 if (stokes_dim > 3) {
129 const Numeric d = imag(a - b) / 2.0;
131 surface_rmatrix(2, 3) = d;
132 surface_rmatrix(3, 2) = -d;
133 surface_rmatrix(3, 3) = c;
142 const Tensor3& surface_props_data,
145 if (surface_props_data.
npages() != surface_props_names.
nelem())
147 "The number of pages in *surface_props_data* and " 148 "length of *surface_props_names* differ.");
150 if (surface_props_names.
nelem() == 0) {
153 if (surface_props_data.
nrows() !=
154 (atmosphere_dim == 1 ? 1 : lat_grid.
nelem()))
155 throw runtime_error(
"Row-size of *surface_props_data* not as expected.");
156 if (surface_props_data.
ncols() !=
157 (atmosphere_dim <= 2 ? 1 : lon_grid.
nelem()))
158 throw runtime_error(
"Column-size of *surface_props_data* not as expected.");
161 if (surface_props_names[
i].
nelem() == 0) {
163 os <<
"Element " <<
i <<
" (0-based) of *surface_props_names* is empty.";
164 throw runtime_error(os.
str());
166 for (
Index j =
i + 1; j < surface_props_names.
nelem(); j++) {
167 if (surface_props_names[j] == surface_props_names[
i]) {
169 os <<
"Two surface properties with same name found!\n" 170 <<
"This found for these two properties\n" 171 <<
" index: " << i << endl
172 <<
" index: " << j << endl
173 <<
" name: " << surface_props_names[i];
174 throw runtime_error(os.
str());
182 const Index& atmosphere_dim,
186 const Tensor3& surface_props_data,
188 assert(v.
nelem() == 1);
189 assert(surface_props_data.
npages() == surface_props_names.
nelem());
192 if (surface_props_names[
i] == vname) {
204 os <<
"The following property was requested\n" 205 <<
" " << vname << endl
206 <<
"but it could not be found in *surface_props_names*.";
207 throw runtime_error(os.
str());
216 if (dsurface_rmatrix_dx.
nelem() != nq) {
218 "The lengths of *dsurface_names* and *dsurface_rmatrix_dx* differ.");
220 if (dsurface_emission_dx.
nelem() != nq) {
222 "The lengths of *dsurface_names* and *dsurface_emission_dx* differ.");
227 for (
Index j = 0; j < surface_props_names.
nelem() && !found; j++) {
228 if (dsurface_names[
i] == surface_props_names[j]) {
234 os <<
"String " <<
i <<
" (0-based) of *dsurface_names* is \"" 235 << dsurface_names[
i] <<
"\"\n" 236 <<
"but this string could not be found in *surface_props_names*.\n" 237 <<
"This is likely due to incorrect choice of quantity when\n" 238 <<
" calling *jacobianAddSurfaceQuantity*.";
239 throw runtime_error(os.
str());
INDEX Index
The type to use for all integer numbers and indices.
void surface_props_interp(Vector &v, const String &vname, const Index &atmosphere_dim, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon, const Matrix &itw, const Tensor3 &surface_props_data, const ArrayOfString &surface_props_names)
Peforms an interpolation of surface_props_data
void interp_atmsurface_by_itw(VectorView x, const Index &atmosphere_dim, ConstMatrixView x_surface, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon, ConstMatrixView itw)
Interpolates a surface-type variable with pre-calculated weights by interp_atmsurface_gp2itw.
A class implementing complex numbers for ARTS.
Index nelem() const
Number of elements.
void surface_specular_R_and_b(MatrixView surface_rmatrix, VectorView surface_emission, const Complex &Rv, const Complex &Rh, const Numeric &f, const Index &stokes_dim, const Numeric &surface_skin_t)
Sets up the surface reflection matrix and emission vector for the case of specular reflection...
Numeric calc_incang(ConstVectorView rte_los, ConstVectorView specular_los)
Calculates the incidence angle for a flat surface, based on rte_los and specular_los.
constexpr Complex conj(Complex c)
the conjugate of c
Index nrows() const
Returns the number of rows.
Index nelem() const
Returns the number of elements.
A constant view of a Tensor4.
This file contains the Workspace class.
Index ncols() const
Returns the number of columns.
_CS_string_type str() const
std::complex< Numeric > Complex
Index ncols() const
Returns the number of columns.
void surface_props_check(const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &surface_props_data, const ArrayOfString &surface_props_names)
Peforms basic checks of surface_props_data and surface_props_names
NUMERIC Numeric
The type to use for all floating point numbers.
Implementation of Matrix, Vector, and such stuff.
Numeric pow(const Rational base, Numeric exp)
Power of.
void mult(ComplexVectorView y, const ConstComplexMatrixView &M, const ConstComplexVectorView &x)
Matrix-Vector Multiplication.
Index npages() const
Returns the number of pages.
This can be used to make arrays out of anything.
Index index_of_zsurface(const Numeric &z_surface, ConstVectorView z_profile)
Lccates the surface with respect to pressure levels.
void surface_calc(Matrix &iy, ConstTensor3View I, ConstMatrixView surface_los, ConstTensor4View surface_rmatrix, ConstMatrixView surface_emission)
Weights together downwelling radiation and surface emission.
void dsurface_check(const ArrayOfString &surface_props_names, const ArrayOfString &dsurface_names, const ArrayOfTensor4 dsurface_rmatrix_dx, const ArrayOfMatrix &dsurface_emission_dx)
Peforms basic checks of the dsurface variables.
A constant view of a Tensor3.
A constant view of a Vector.
Index nelem(const Lines &l)
Number of lines.
A constant view of a Matrix.
Numeric planck(const Numeric &f, const Numeric &t)
planck
This file contains declerations of functions of physical character.
Index nrows() const
Returns the number of rows.