Go to the documentation of this file.
73 const Vector& transmittance,
74 const Index& fastem_version,
84 if (fastem_version < 3 || fastem_version > 6)
85 throw std::runtime_error(
86 "Invalid fastem version: 3 <= fastem_version <= 6");
89 reflectivity.
resize(nf, 4);
93 for (
Index i = 0; i < nf; i++) {
95 throw std::runtime_error(
"Only frequency <= 250 GHz are allowed");
111 emissivity(i,
joker) = e;
112 reflectivity(i,
joker) = r;
117 for (
Index i = 0; i < nf; i++) {
118 for (
Index s = 0; s < 2; s++) {
119 if (emissivity(i, s) > 1) {
120 emissivity(i, s) = 1;
121 reflectivity(i, s) = 0;
123 if (emissivity(i, s) < 0) {
124 emissivity(i, s) = 0;
125 reflectivity(i, s) = 1;
127 if (reflectivity(i, s) > 1) {
128 emissivity(i, s) = 0;
129 reflectivity(i, s) = 1;
131 if (reflectivity(i, s) < 0) {
132 emissivity(i, s) = 1;
133 reflectivity(i, s) = 0;
149 Index gfield_latID = 0;
150 Index gfield_lonID = 1;
164 if (nlat < 2 || nlon < 2) {
166 os <<
"The data in *gfield2* must span a geographical region. That is,\n"
167 <<
"the latitude and longitude grids must have a length >= 2.";
193 outvalue =
interp(itw, gfield2.
data, gp_lat, gp_lon);
216 os <<
"The given position does not match *z_surface*.\nThe altitude in "
217 <<
"*rtp_pos* is " <<
rtp_pos[0] / 1e3 <<
" km.\n"
218 <<
"The altitude range covered by *z_surface* is [" << zmin / 1e3 <<
","
219 << zmax / 1e3 <<
"] km.\n"
220 <<
"One possible mistake is to mix up *rtp_pos* and *rte_los*.";
221 throw runtime_error(os.str());
225 outvalue = field(0, 0);
240 out3 <<
" Result = " << outvalue <<
"\n";
262 throw runtime_error(
"*surface_type* is not allowed to be negative.");
265 os <<
"*iy_surface_agenda_array* has only "
267 <<
" elements,\n while you have selected element " <<
surface_type;
268 throw runtime_error(os.str());
310 const Index& fastem_version,
357 for (
Index i = 0; i < nf; i++) {
358 transmittance[i] = exp(-
iy_aux[0](i, 0));
387 Matrix sensor_los_dummy(1, 1, 0);
397 for (
Index i = 0; i < nf; i++) {
453 throw runtime_error(
"Number of columns in *surface_los* is not correct.");
456 "Mismatch in size of *surface_los* and *surface_rmatrix*.");
459 "Mismatch in size of *surface_rmatrix* and *f_grid*.");
463 "Mismatch between size of *surface_rmatrix* and *stokes_dim*.");
467 "Mismatch between size of *surface_emission* and *stokes_dim*.");
469 throw runtime_error(
"Mismatch in size of *surface_emission* and f_grid*.");
476 for (
Index ilos = 0; ilos < nlos; ilos++) {
522 <<
" expected size = [" << nf <<
"," <<
stokes_dim <<
"]\n"
523 <<
" size of iy = [" <<
iy.nrows() <<
"," <<
iy.ncols() <<
"]\n";
524 throw runtime_error(os.str());
572 throw runtime_error(
"Number of columns in *surface_los* is not correct.");
575 "Mismatch in size of *surface_los* and *surface_rmatrix*.");
578 "Mismatch in size of *surface_rmatrix* and *f_grid*.");
582 "Mismatch between size of *surface_rmatrix* and *stokes_dim*.");
586 "Mismatch between size of *surface_emission* and *stokes_dim*.");
588 throw runtime_error(
"Mismatch in size of *surface_emission* and f_grid*.");
595 for (
Index ilos = 0; ilos < nlos; ilos++) {
640 <<
" expected size = [" << nf <<
"," <<
stokes_dim <<
"]\n"
641 <<
" size of iy = [" <<
iy.nrows() <<
"," <<
iy.ncols() <<
"]\n";
642 throw runtime_error(os.str());
660 os <<
"The derivatives for surface quantity: " <<
dsurface_names[i]
661 <<
"\nwere not calculated by *iy_surface_agenda*.\n"
662 <<
"That is, *dsurface_emission_dx* and/or *dsurface_rmatrix_dx*\n"
664 throw runtime_error(os.str());
675 Matrix diy_dpos0, diy_dpos;
712 "Invalid zenith angle. The zenith angle corresponds "
713 "to observe the surface from below.");
741 const Index& ignore_surface_slope,
776 "Invalid zenith angle. The zenith angle corresponds "
777 "to observe the surface from below.");
810 Vector tangentSN(3), tangentEW(3), normal(3);
811 zaaa2cart(tangentSN[0], tangentSN[1], tangentSN[2], zaSN, 0);
812 zaaa2cart(tangentEW[0], tangentEW[1], tangentEW[2], zaEW, 90);
813 cross3(normal, tangentSN, tangentEW);
823 "Invalid zenith angle. The zenith angle corresponds "
824 "to observe the surface from below.");
829 for (
Index i = 0; i < 3; i++) {
830 speccart[i] =
fac * normal[i] - di[i];
857 out2 <<
" Sets variables to model a blackbody surface with a temperature "
871 for (
Index iv = 0; iv < nf; iv++) {
892 const Vector& transmittance,
893 const Index& fastem_version,
920 Numeric rel_azimuth = wind_direction;
930 Matrix emissivity, reflectivity;
953 for (
Index i = 0; i < nf; i++) {
955 surface_emission(i, 0) = b[i] * 0.5 * (emissivity(i, 0) + emissivity(i, 1));
959 b[i] * 0.5 * (emissivity(i, 0) - emissivity(i, 1));
971 for (
Index iv = 0; iv < nf; iv++) {
973 0.5 * (reflectivity(iv, 0) + reflectivity(iv, 1));
976 0.5 * (reflectivity(iv, 0) - reflectivity(iv, 1));
1042 throw std::runtime_error(
1043 "Given coordinates are not contained in "
1044 " TELSEM atlas. To enable nearest neighbor"
1045 "interpolation set *d_max* to a positive "
1053 std::ostringstream out{};
1054 out <<
"Distance of nearest neighbor exceeds provided limit (";
1055 out << d <<
" > " << d_max <<
").";
1056 throw std::runtime_error(out.str());
1069 for (
Index i = 0; i < nf; ++i) {
1071 throw std::runtime_error(
"Only frequency >= 5 GHz are allowed");
1073 throw std::runtime_error(
"Only frequency <= 900 GHz are allowed");
1078 std::tie(e_v, e_h) =
1079 atlas.
emis_interp(theta, f, class1, class2, emis_v, emis_h);
1149 for (
Index i = 0; i < nf; ++i) {
1151 throw std::runtime_error(
"Only frequency >= 5 GHz are allowed");
1153 throw std::runtime_error(
"Only frequency <= 900 GHz are allowed");
1205 Matrix n_real(nf, 1), n_imag(nf, 1);
1210 "surface_complex_refr_index",
1214 out2 <<
" Sets variables to model a flat surface\n";
1225 assert(incang <= 90);
1230 for (
Index iv = 0; iv < nf; iv++) {
1232 Complex n2(n_real(iv, 0), n_imag(iv, 0));
1275 os <<
"The number of rows and columnss in *surface_reflectivity* must\n"
1276 <<
"match *stokes_dim*."
1278 <<
"\n number of rows in *surface_reflectivity* : "
1280 <<
"\n number of columns in *surface_reflectivity* : "
1282 throw runtime_error(os.str());
1288 os <<
"The number of pages in *surface_reflectivity* should\n"
1289 <<
"match length of *f_grid* or be 1."
1290 <<
"\n length of *f_grid* : " << nf
1291 <<
"\n dimension of *surface_reflectivity* : "
1293 throw runtime_error(os.str());
1296 out2 <<
" Sets variables to model a flat surface\n";
1311 for (
Index iv = 0; iv < nf; iv++) {
1317 IR(i, j) = 1 - R(i, j);
1319 IR(i, j) = -R(i, j);
1356 os <<
"The number of columns in *surface_rv_rh* must be two,\n"
1357 <<
"but the actual number of columns is " <<
surface_rv_rh.ncols()
1359 throw runtime_error(os.str());
1364 os <<
"The number of rows in *surface_rv_rh* should\n"
1365 <<
"match length of *f_grid* or be 1."
1366 <<
"\n length of *f_grid* : " << nf
1367 <<
"\n rows in *surface_rv_rh* : " <<
surface_rv_rh.nrows() <<
"\n";
1368 throw runtime_error(os.str());
1372 throw runtime_error(
"All values in *surface_rv_rh* must be inside [0,1].");
1387 Numeric rmean = 0.0, rdiff = 0.0;
1389 for (
Index iv = 0; iv < nf; iv++) {
1437 os <<
"The number of elements in *surface_scalar_reflectivity* should\n"
1438 <<
"match length of *f_grid* or be 1."
1439 <<
"\n length of *f_grid* : " << nf
1440 <<
"\n length of *surface_scalar_reflectivity* : "
1442 throw runtime_error(os.str());
1447 throw runtime_error(
1448 "All values in *surface_scalar_reflectivity* must be inside [0,1].");
1465 for (
Index iv = 0; iv < nf; iv++) {
1490 const Index& lambertian_nza,
1505 os <<
"The number of elements in *surface_scalar_reflectivity* should\n"
1506 <<
"match length of *f_grid* or be 1."
1507 <<
"\n length of *f_grid* : " << nf
1508 <<
"\n length of *surface_scalar_reflectivity* : "
1510 throw runtime_error(os.str());
1515 throw runtime_error(
1516 "All values in *surface_scalar_reflectivity* must be inside [0,1].");
1532 const Vector za_lims(0.0, lambertian_nza + 1, dza);
1535 for (
Index ip = 0; ip < lambertian_nza; ip++) {
1554 for (
Index iv = 0; iv < nf; iv++) {
1568 for (
Index ip = 0; ip < lambertian_nza; ip++) {
1571 (cos(2 *
DEG2RAD * za_lims[ip]) - cos(2 *
DEG2RAD * za_lims[ip + 1]));
1591 const Numeric& specular_factor,
1598 if (specular_factor > 1 || specular_factor < 1.0 / 3.0)
1599 throw runtime_error(
"The valid range for *specular_factor* is [1/3,1].");
1600 if (dza > 45 || dza <= 0)
1601 throw runtime_error(
"The valid range for *dza* is ]0,45].");
1617 if (los1.
nrows() != 1)
1618 throw runtime_error(
1619 "*surface_rtprop_sub_agenda* must return data "
1620 "describing a specular surface.");
1634 while (failed && dza_try > 0) {
1650 }
catch (
const runtime_error& e) {
1670 w = specular_factor;
1672 w = specular_factor + (1.0 - specular_factor) / 2.0;
1677 for (
Index r = 0; r < rmatrix1.
nrows(); r++) {
1679 for (
Index c = 0; c < rmatrix1.
ncols(); c++) {
1687 w = (1.0 - specular_factor) / 2.0;
1692 for (
Index r = 0; r < rmatrix2.
nrows(); r++) {
1694 for (
Index c = 0; c < rmatrix1.
ncols(); c++) {
1718 for (
Index r = 0; r < rmatrix2.
nrows(); r++) {
1720 for (
Index c = 0; c < rmatrix1.
ncols(); c++) {
1733 const Numeric& specular_factor,
1741 throw runtime_error(
1742 "Input surface data must be of specular type. That is, "
1743 "*surface_los* must contain a single direction.");
1745 throw runtime_error(
1746 "*surface_rmatrix* describes a different number of "
1747 "directions than *surface_los*.");
1750 if (specular_factor > 1 || specular_factor < 1.0 / 3.0)
1751 throw runtime_error(
"The valid range for *specular_factor* is [1/3,1].");
1752 if (dza > 45 || dza <= 0)
1753 throw runtime_error(
"The valid range for *dza* is ]0,45].");
1768 if (
abs(los1(0, 0)) > za_max) {
1776 for (
Index r = 0; r < nbeams; r++) {
1791 for (
Index b = 0; b < nbeams; b++) {
1793 if (b == 1 && nbeams == 3)
1795 w = specular_factor;
1798 w = specular_factor + (1.0 - specular_factor) / 2.0;
1801 w = (1.0 - specular_factor) / 2.0;
1805 for (
Index r = 0; r < rmatrix1.
nrows(); r++) {
1806 for (
Index c = 0; c < rmatrix1.
ncols(); c++) {
1819 if (los1(0, 0) < 0) {
1820 for (
Index r = 0; r < rmatrix1.
nrows(); r++) {
1847 Index gfield_fID = 0;
1848 Index gfield_tID = 1;
1849 Index gfield_compID = 2;
1850 Index gfield_latID = 3;
1851 Index gfield_lonID = 4;
1871 if (nlat < 2 || nlon < 2) {
1873 os <<
"The data in *complex_refr_index_field* must span a geographical "
1874 <<
"region. That is,\nthe latitude and longitude grids must have a "
1880 os <<
"The data in *complex_refr_index_field* must have exactly two "
1881 <<
"pages. One page each\nfor the real and imaginary part of the "
1882 <<
"complex refractive index.";
1920 for (
Index iv = 0; iv < nf; iv++) {
1921 for (
Index it = 0; it < nt; it++) {
1923 itw, complex_n_field.
data(iv, it, 0,
joker,
joker), gp_lat, gp_lon);
1925 itw, complex_n_field.
data(iv, it, 1,
joker,
joker), gp_lat, gp_lon);
1963 if (nlat < 2 || nlon < 2) {
1965 os <<
"The data in *r_field* must span a geographical region. That is,\n"
1966 <<
"the latitude and longitude grids must have a length >= 2.";
1967 throw runtime_error(os.str());
1972 os <<
"The data in *r_field* must span a range of zenith angles. That\n"
1973 <<
"is the zenith angle grid must have a length >= 2.";
1974 throw runtime_error(os.str());
1976 if (ns1 <
stokes_dim || ns2 < stokes_dim || ns1 > 4 || ns2 > 4) {
1978 os <<
"The \"Stokes dimensions\" must have a size that is >= "
1979 <<
"*stokes_dim* (but not exceeding 4).";
1980 throw runtime_error(os.str());
2003 for (
Index iv = 0; iv < nf_in; iv++) {
2004 for (
Index iz = 0; iz < nza; iz++) {
2007 r_f_za(iv, is1, is2, iz) =
2029 Matrix itw(1, order + 1);
2034 for (
Index i = 0; i < nf_in; i++) {
2038 r_f(i, is1, is2) = tmp[0];
2062 r_f(
joker, is1, is2),
2099 if (nlat < 2 || nlon < 2) {
2101 os <<
"The data in *r_field* must span a geographical region. That is,\n"
2102 <<
"the latitude and longitude grids must have a length >= 2.";
2103 throw runtime_error(os.str());
2108 os <<
"The data in *r_field* must span a range of zenith angles. That\n"
2109 <<
"is the zenith angle grid must have a length >= 2.";
2110 throw runtime_error(os.str());
2123 Matrix r_f_za(nf_in, nza);
2133 for (
Index iv = 0; iv < nf_in; iv++) {
2134 for (
Index iz = 0; iz < nza; iz++) {
2152 Matrix itw(1, order + 1);
2157 for (
Index i = 0; i < nf_in; i++) {
2193 for (
Index i = 0; i < nf; i++) {
2194 for (
Index l = 0; l < nlos; l++) {
2235 Index gfield_latID = 0;
2236 Index gfield_lonID = 1;
2250 if (nlat < 2 || nlon < 2) {
2252 os <<
"The data in *surface_type_mask* must span a geographical "
2253 <<
"region. That is,\nthe latitude and longitude grids must have a "
2280 if (gp_lat.
fd[0] < 0.5) {
2283 ilat = gp_lat.
idx + 1;
2285 if (gp_lon.
fd[0] < 0.5) {
2288 ilon = gp_lon.
idx + 1;
2309 throw runtime_error(
"*surface_type* is not allowed to be negative.");
2312 os <<
"*surface_rtprop_agenda_array* has only "
2314 <<
" elements,\n while you have selected element " <<
surface_type;
2315 throw runtime_error(os.str());
2343 throw runtime_error(
2344 "When calling this method, *surface_props_names* should be empty.");
2397 "Water skin temperature",
2549 const Vector& transmittance,
2550 const Index& fastem_version,
2569 "Water skin temperature",
2589 Vector wind_direction(1);
2706 wind_direction[0] + dd,
2761 throw runtime_error(
"No element in *iy_aux* holds optical depths.");
2767 for (
Index i = 0; i < n; i++) {
2768 transmittance[i] = exp(-
iy_aux[ihit](i, 0));
Index atmosphere_dim(Workspace &ws) noexcept
void interp_atmsurface_by_gp(VectorView x, const Index &atmosphere_dim, ConstMatrixView x_surface, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Interpolates a surface-type variable given the grid positions.
Agenda surface_rtprop_sub_agenda(Workspace &ws) noexcept
Index calc_cellnum(Numeric lat, Numeric lon) const
Index nshelves() const
Returns the number of shelves.
Vector rtp_los(Workspace &ws) noexcept
Index nbooks() const
Returns the number of books.
Numeric fac(const Index n)
fac
void iySurfaceRtpropCalc(Workspace &ws, Matrix &iy, ArrayOfTensor3 &diy_dx, const Matrix &surface_los, const Tensor4 &surface_rmatrix, const Matrix &surface_emission, const ArrayOfString &dsurface_names, const ArrayOfTensor4 &dsurface_rmatrix_dx, const ArrayOfMatrix &dsurface_emission_dx, const Tensor3 &iy_transmission, const Index &iy_id, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &stokes_dim, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Vector &rte_pos2, const String &iy_unit, const Agenda &iy_main_agenda, const Verbosity &)
WORKSPACE METHOD: iySurfaceRtpropCalc.
Numeric lat(Workspace &ws) noexcept
Numeric plevel_angletilt(const Numeric &r, const Numeric &c1)
Calculates the angular tilt of the surface or a pressure level.
Index surface_type(Workspace &ws) noexcept
Vector surface_normal(Workspace &ws) noexcept
ArrayOfRetrievalQuantity jacobian_quantities(Workspace &ws) noexcept
Complex w(Complex z) noexcept
The Faddeeva function.
void complex_n_interp(MatrixView n_real, MatrixView n_imag, const GriddedField3 &complex_n, const String &varname, ConstVectorView f_grid, ConstVectorView t_grid)
General function for interpolating data of complex n type.
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
Numeric calc_incang(ConstVectorView rte_los, ConstVectorView specular_los)
Calculates the incidence angle for a flat surface, based on rte_los and specular_los.
Numeric sign(const Numeric &x)
sign
Index ncols() const
Returns the number of columns.
Index npages() const
Returns the number of pages.
Tensor3 iy_transmission(Workspace &ws) noexcept
ArrayOfAgenda iy_surface_agenda_array(Workspace &ws) noexcept
Matrix surface_rv_rh(Workspace &ws) noexcept
Vector lat_grid(Workspace &ws) noexcept
Tensor4 surface_rmatrix(Workspace &ws) noexcept
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.
Header file for interpolation.cc.
Numeric refell2d(ConstVectorView refellipsoid, ConstVectorView lat_grid, const GridPos gp)
refell2d
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
Index iy_id(Workspace &ws) noexcept
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
void iySurfaceFastem(Workspace &ws, Matrix &iy, ArrayOfTensor3 &diy_dx, const Tensor3 &iy_transmission, const Index &iy_id, const Index &jacobian_do, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &stokes_dim, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Vector &rte_pos2, const String &iy_unit, const Agenda &iy_main_agenda, const Numeric &surface_skin_t, const Numeric &salinity, const Numeric &wind_speed, const Numeric &wind_direction, const Index &fastem_version, const Verbosity &verbosity)
WORKSPACE METHOD: iySurfaceFastem.
Verbosity verbosity(Workspace &ws) noexcept
void iySurfaceCallAgendaX(Workspace &ws, Matrix &iy, ArrayOfTensor3 &diy_dx, const String &iy_unit, const Tensor3 &iy_transmission, const Index &iy_id, const Index &cloudbox_on, const Index &jacobian_do, const Vector &f_grid, const Agenda &iy_main_agenda, const Vector &rtp_pos, const Vector &rtp_los, const Vector &rte_pos2, const ArrayOfAgenda &iy_surface_agenda_array, const Index &surface_type, const Numeric &surface_type_aux, const Verbosity &)
WORKSPACE METHOD: iySurfaceCallAgendaX.
Numeric sphdist(const Numeric &lat1, const Numeric &lon1, const Numeric &lat2, const Numeric &lon2)
sphdist
void mult(ComplexVectorView y, const ConstComplexMatrixView &M, const ConstComplexVectorView &x)
Matrix-Vector Multiplication.
void surface_calc(Matrix &iy, ConstTensor3View I, ConstMatrixView surface_los, ConstTensor4View surface_rmatrix, ConstMatrixView surface_emission)
Weights together downwelling radiation and surface emission.
Vector specular_los(Workspace &ws) noexcept
Index get_class2(Index cellnumber) const
void surfaceFlatReflectivity(Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Vector &f_grid, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &rtp_pos, const Vector &rtp_los, const Vector &specular_los, const Numeric &surface_skin_t, const Tensor3 &surface_reflectivity, const Verbosity &verbosity)
WORKSPACE METHOD: surfaceFlatReflectivity.
Index jacobian_do(Workspace &ws) noexcept
Index nrows() const
Returns the number of rows.
void resize(Index n)
Resize function.
ArrayOfTensor3 diy_dx(Workspace &ws) noexcept
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.
bool contains(Index cellnumber) const
void surfaceBlackbody(Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Index &atmosphere_dim, const Vector &f_grid, const Index &stokes_dim, const Vector &rtp_pos, const Vector &rtp_los, const Numeric &surface_skin_t, const Verbosity &verbosity)
WORKSPACE METHOD: surfaceBlackbody.
Index stokes_dim(Workspace &ws) noexcept
Index nrows() const
Returns the number of rows.
void checksize_strict() const final
Strict consistency check.
String iy_unit(Workspace &ws) noexcept
Matrix iy(Workspace &ws) noexcept
void transmittanceFromIy_aux(Vector &transmittance, const ArrayOfString &iy_aux_vars, const ArrayOfMatrix &iy_aux, const Verbosity &)
WORKSPACE METHOD: transmittanceFromIy_aux.
std::complex< Numeric > Complex
This file contains the definition of Array.
The structure to describe a propagation path and releated quantities.
Agenda surface_rtprop_agenda(Workspace &ws) noexcept
Index npages() const
Returns the number of pages.
Numeric lon(Workspace &ws) noexcept
ArrayOfString dsurface_names(Workspace &ws) noexcept
Vector lon_true(Workspace &ws) noexcept
void interp_atmsurface_gp2itw(Matrix &itw, const Index &atmosphere_dim, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Converts atmospheric grid positions to weights for interpolation of a surface-type variable.
void cross3(VectorView c, const ConstVectorView &a, const ConstVectorView &b)
cross3
const Group::String & name() const noexcept
Vector get_emis_v(Index i) const
void surfaceFastem(Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Index &atmosphere_dim, const Index &stokes_dim, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Numeric &surface_skin_t, const Numeric &salinity, const Numeric &wind_speed, const Numeric &wind_direction, const Vector &transmittance, const Index &fastem_version, const Verbosity &verbosity)
WORKSPACE METHOD: surfaceFastem.
A class implementing complex numbers for ARTS.
EnergyLevelMap nlte_field(Workspace &ws) noexcept
This can be used to make arrays out of anything.
void surfaceFlatRvRh(Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Vector &f_grid, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &rtp_pos, const Vector &rtp_los, const Vector &specular_los, const Numeric &surface_skin_t, const Matrix &surface_rv_rh, const Verbosity &)
WORKSPACE METHOD: surfaceFlatRvRh.
void InterpSurfaceFieldToPosition(Numeric &outvalue, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Vector &rtp_pos, const Matrix &z_surface, const Matrix &field, const Verbosity &verbosity)
WORKSPACE METHOD: InterpSurfaceFieldToPosition.
void surface_complex_refr_indexFromGriddedField5(GriddedField3 &surface_complex_refr_index, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lat_true, const Vector &lon_true, const Vector &rtp_pos, const GriddedField5 &complex_n_field, const Verbosity &)
WORKSPACE METHOD: surface_complex_refr_indexFromGriddedField5.
Index nvitrines() const
Returns the number of vitrines.
const Vector & get_numeric_grid(Index i) const
Get a numeric grid.
void surface_rtpropCallAgendaX(Workspace &ws, Numeric &surface_skin_t, Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const ArrayOfAgenda &surface_rtprop_agenda_array, const Index &surface_type, const Numeric &surface_type_aux, const Verbosity &)
WORKSPACE METHOD: surface_rtpropCallAgendaX.
void fastem(Vector &emissivity, Vector &reflectivity, const Numeric frequency, const Numeric za, const Numeric temperature, const Numeric salinity, const Numeric wind_speed, const Numeric transmittance, const Numeric rel_azimuth, const Index fastem_version)
Calculate the surface emissivity using FASTEM.
This file contains functions that are adapted from TESSEM code which is used to calculate surface emi...
Declarations having to do with the four output streams.
Index get_class1(Index cellnumber) const
Index ncols() const
Returns the number of columns.
void diy_from_pos_to_rgrids(Tensor3View diy_dx, const RetrievalQuantity &jacobian_quantity, ConstMatrixView diy_dpos, const Index &atmosphere_dim, ConstVectorView rtp_pos)
diy_from_pos_to_rgrids
Array< String > ArrayOfString
An array of Strings.
void surfaceTessem(Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Index &atmosphere_dim, const Index &stokes_dim, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Numeric &surface_skin_t, const TessemNN &net_h, const TessemNN &net_v, const Numeric &salinity, const Numeric &wind_speed, const Verbosity &verbosity)
WORKSPACE METHOD: surfaceTessem.
void surface_rtprop_sub_agendaExecute(Workspace &ws, Numeric &surface_skin_t, Matrix &surface_emission, Matrix &surface_los, Tensor4 &surface_rmatrix, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
void InterpGriddedField2ToPosition(Numeric &outvalue, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lat_true, const Vector &lon_true, const Vector &rtp_pos, const GriddedField2 &gfield2, const Verbosity &)
WORKSPACE METHOD: InterpGriddedField2ToPosition.
void checksize_strict() const final
Strict consistency check.
void surface_rtprop_agendaExecute(Workspace &ws, Numeric &surface_skin_t, Matrix &surface_emission, Matrix &surface_los, Tensor4 &surface_rmatrix, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
This file contains declerations of functions of physical character.
void surface_reflectivityFromGriddedField6(Tensor3 &surface_reflectivity, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lat_true, const Vector &lon_true, const Vector &rtp_pos, const Vector &rtp_los, const GriddedField6 &r_field, const Verbosity &)
WORKSPACE METHOD: surface_reflectivityFromGriddedField6.
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
Ppath ppath(Workspace &ws) noexcept
Index ncols() const
Returns the number of columns.
void SurfaceFastem(Matrix &surface_los, Tensor4 &surface_rmatrix, ArrayOfTensor4 &dsurface_rmatrix_dx, Matrix &surface_emission, ArrayOfMatrix &dsurface_emission_dx, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Tensor3 &surface_props_data, const ArrayOfString &surface_props_names, const ArrayOfString &dsurface_names, const Index &jacobian_do, const Vector &transmittance, const Index &fastem_version, const Verbosity &verbosity)
WORKSPACE METHOD: SurfaceFastem.
ArrayOfMatrix dsurface_emission_dx(Workspace &ws) noexcept
Tensor3 surface_props_data(Workspace &ws) noexcept
NUMERIC Numeric
The type to use for all floating point numbers.
This file contains functions that are adapted from FASTEM code which is used to calculate surface emi...
void surface_scalar_reflectivityFromGriddedField4(Vector &surface_scalar_reflectivity, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lat_true, const Vector &lon_true, const Vector &rtp_pos, const Vector &rtp_los, const GriddedField4 &r_field, const Verbosity &)
WORKSPACE METHOD: surface_scalar_reflectivityFromGriddedField4.
Index npages() const
Returns the number of pages.
Numeric surface_type_aux(Workspace &ws) noexcept
Vector surface_scalar_reflectivity(Workspace &ws) noexcept
Index nbooks() const
Returns the number of books.
void lon_shiftgrid(Vector &longrid_out, ConstVectorView longrid_in, const Numeric lon)
lon_shiftgrid
void iySurfaceRtpropAgenda(Workspace &ws, Matrix &iy, ArrayOfTensor3 &diy_dx, const Tensor3 &iy_transmission, const Index &iy_id, const Index &jacobian_do, const Index &atmosphere_dim, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const Index &stokes_dim, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Vector &rte_pos2, const String &iy_unit, const Agenda &iy_main_agenda, const Agenda &surface_rtprop_agenda, const Verbosity &)
WORKSPACE METHOD: iySurfaceRtpropAgenda.
Vector refellipsoid(Workspace &ws) noexcept
ArrayOfString iy_aux_vars(Workspace &ws) noexcept
void zaaa2cart(Numeric &dx, Numeric &dy, Numeric &dz, const Numeric &za, const Numeric &aa)
Converts zenith and azimuth angles to a cartesian unit vector.
std::pair< Numeric, Numeric > emis_interp(Numeric theta, Numeric freq, Index class1, Index class2, const ConstVectorView &ev, const ConstVectorView &eh) const
Vector f_grid(Workspace &ws) noexcept
Vector lat_true(Workspace &ws) noexcept
Index calc_cellnum_nearest_neighbor(Numeric lat, Numeric lon) const
void resize(Index r, Index c)
Resize function.
GriddedField2 surface_type_mask(Workspace &ws) noexcept
Matrix surface_emission(Workspace &ws) noexcept
Vector lon_grid(Workspace &ws) noexcept
void pos2true_latlon(Numeric &lat, Numeric &lon, const Index &atmosphere_dim, ConstVectorView lat_grid, ConstVectorView lat_true, ConstVectorView lon_true, ConstVectorView pos)
Determines the true alt and lon for an "ARTS position".
void surfaceFlatScalarReflectivity(Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Vector &f_grid, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &rtp_pos, const Vector &rtp_los, const Vector &specular_los, const Numeric &surface_skin_t, const Vector &surface_scalar_reflectivity, const Verbosity &)
WORKSPACE METHOD: surfaceFlatScalarReflectivity.
Index nbooks() const
Returns the number of books.
void FastemStandAlone(Matrix &emissivity, Matrix &reflectivity, const Vector &f_grid, const Numeric &surface_skin_t, const Numeric &za, const Numeric &salinity, const Numeric &wind_speed, const Numeric &rel_aa, const Vector &transmittance, const Index &fastem_version, const Verbosity &)
WORKSPACE METHOD: FastemStandAlone.
GriddedField3 surface_complex_refr_index(Workspace &ws) noexcept
Index nrows() const
Returns the number of rows.
Numeric planck(const Numeric &f, const Numeric &t)
planck
invlib::Vector< ArtsVector > Vector
invlib wrapper type for ARTS vectors.
void checksize_strict() const final
Strict consistency check.
Structure to store a grid position.
Index nrows() const
Returns the number of rows.
Propagation path structure and functions.
void plevel_slope_3d(Numeric &c1, Numeric &c2, const Numeric &lat1, const Numeric &lat3, const Numeric &lon5, const Numeric &lon6, const Numeric &r15, const Numeric &r35, const Numeric &r36, const Numeric &r16, const Numeric &lat, const Numeric &lon, const Numeric &aa)
ArrayOfMatrix iy_aux(Workspace &ws) noexcept
void tessem_prop_nn(VectorView &ny, const TessemNN &net, ConstVectorView nx)
Agenda iy_main_agenda(Workspace &ws) noexcept
Vector rte_pos2(Workspace &ws) noexcept
void SurfaceDummy(ArrayOfTensor4 &dsurface_rmatrix_dx, ArrayOfMatrix &dsurface_emission_dx, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &surface_props_data, const ArrayOfString &surface_props_names, const ArrayOfString &dsurface_names, const Index &jacobian_do, const Verbosity &)
WORKSPACE METHOD: SurfaceDummy.
void surfaceSemiSpecularBy3beams(Workspace &ws, Numeric &surface_skin_t, Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Index &atmosphere_dim, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &surface_rtprop_sub_agenda, const Numeric &specular_factor, const Numeric &dza, const Verbosity &)
WORKSPACE METHOD: surfaceSemiSpecularBy3beams.
Index nshelves() const
Returns the number of shelves.
void iy_transmission_mult(Tensor3 &iy_trans_total, ConstTensor3View iy_trans_old, ConstTensor3View iy_trans_new)
Multiplicates iy_transmission with transmissions.
void specular_losCalc(Vector &specular_los, Vector &surface_normal, const Vector &rtp_pos, const Vector &rtp_los, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Vector &refellipsoid, const Matrix &z_surface, const Index &ignore_surface_slope, const Verbosity &verbosity)
WORKSPACE METHOD: specular_losCalc.
void surface_rtprop_agenda_arrayExecute(Workspace &ws, Numeric &surface_skin_t, Matrix &surface_emission, Matrix &surface_los, Tensor4 &surface_rmatrix, const Index agenda_array_index, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Numeric surface_type_aux, const ArrayOfAgenda &input_agenda_array)
my_basic_string< char > String
The String type for ARTS.
void SurfaceTessem(Matrix &surface_los, Tensor4 &surface_rmatrix, ArrayOfTensor4 &dsurface_rmatrix_dx, Matrix &surface_emission, ArrayOfMatrix &dsurface_emission_dx, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const TessemNN &net_h, const TessemNN &net_v, const Tensor3 &surface_props_data, const ArrayOfString &surface_props_names, const ArrayOfString &dsurface_names, const Index &jacobian_do, const Verbosity &verbosity)
WORKSPACE METHOD: SurfaceTessem.
Declaration of functions in rte.cc.
void surfaceFlatRefractiveIndex(Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Vector &f_grid, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &rtp_pos, const Vector &rtp_los, const Vector &specular_los, const Numeric &surface_skin_t, const GriddedField3 &surface_complex_refr_index, const Verbosity &verbosity)
WORKSPACE METHOD: surfaceFlatRefractiveIndex.
void cart2zaaa(Numeric &za, Numeric &aa, const Numeric &dx, const Numeric &dy, const Numeric &dz)
Converts a cartesian directional vector to zenith and azimuth.
void resolve_lon(Numeric &lon, const Numeric &lon5, const Numeric &lon6)
Resolves which longitude angle that shall be used.
Header file for special_interp.cc.
void fresnel(Complex &Rv, Complex &Rh, const Complex &n1, const Complex &n2, const Numeric &theta)
fresnel
void iy_surface_agenda_arrayExecute(Workspace &ws, Matrix &iy, ArrayOfTensor3 &diy_dx, const Index agenda_array_index, const String &iy_unit, const Tensor3 &iy_transmission, const Index iy_id, const Index cloudbox_on, const Index jacobian_do, const Agenda &iy_main_agenda, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Vector &rte_pos2, const Numeric surface_type_aux, const ArrayOfAgenda &input_agenda_array)
void rte_pos2gridpos(GridPos &gp_p, GridPos &gp_lat, GridPos &gp_lon, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView rte_pos)
Converts a geographical position (rte_pos) to grid positions for p, lat and lon.
void iy_main_agendaExecute(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, Ppath &ppath, ArrayOfTensor3 &diy_dx, const Index iy_agenda_call1, const Tensor3 &iy_transmission, const ArrayOfString &iy_aux_vars, const Index iy_id, const String &iy_unit, const Index cloudbox_on, const Index jacobian_do, const Vector &f_grid, const EnergyLevelMap &nlte_field, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Agenda &input_agenda)
Vector x(Workspace &ws) noexcept
INDEX Index
The type to use for all integer numbers and indices.
void specular_losCalcNoTopography(Vector &specular_los, Vector &surface_normal, const Vector &rtp_pos, const Vector &rtp_los, const Index &atmosphere_dim, const Verbosity &)
WORKSPACE METHOD: specular_losCalcNoTopography.
std::pair< Numeric, Numeric > get_coordinates(Index cellnum) const
Numeric surface_skin_t(Workspace &ws) noexcept
Index find_first(const Array< base > &x, const base &w)
Find first occurance.
void gridpos_poly(ArrayOfGridPosPoly &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Index order, const Numeric &extpolfac)
The maximum difference from 1 that we allow for a sum check.
void adjust_los(VectorView los, const Index &atmosphere_dim)
Ensures that the zenith and azimuth angles of a line-of-sight vector are inside defined ranges.
Matrix surface_los(Workspace &ws) noexcept
Vector get_emis_h(Index cellnum) const
void plevel_slope_2d(Numeric &c1, ConstVectorView lat_grid, ConstVectorView refellipsoid, ConstVectorView z_surf, const GridPos &gp, const Numeric &za)
Calculates the radial slope of the surface or a pressure level for 2D.
void surfaceSplitSpecularTo3beams(Matrix &surface_los, Tensor4 &surface_rmatrix, const Index &atmosphere_dim, const Vector &rtp_pos, const Vector &rtp_los, const Numeric &specular_factor, const Numeric &dza, const Verbosity &)
WORKSPACE METHOD: surfaceSplitSpecularTo3beams.
Index ncols() const
Returns the number of columns.
void surface_typeInterpTypeMask(Index &surface_type, Numeric &surface_type_aux, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lat_true, const Vector &lon_true, const Vector &rtp_pos, const GriddedField2 &surface_type_mask, const Verbosity &)
WORKSPACE METHOD: surface_typeInterpTypeMask.
ArrayOfTensor4 dsurface_rmatrix_dx(Workspace &ws) noexcept
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
void surfaceLambertianSimple(Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Vector &f_grid, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &rtp_pos, const Vector &rtp_los, const Vector &surface_normal, const Numeric &surface_skin_t, const Vector &surface_scalar_reflectivity, const Index &lambertian_nza, const Numeric &za_pos, const Verbosity &)
WORKSPACE METHOD: surfaceLambertianSimple.
Matrix z_surface(Workspace &ws) noexcept
void surface_scalar_reflectivityFromSurface_rmatrix(Vector &surface_scalar_reflectivity, const Tensor4 &surface_rmatrix, const Verbosity &)
WORKSPACE METHOD: surface_scalar_reflectivityFromSurface_rmatrix.
ArrayOfAgenda surface_rtprop_agenda_array(Workspace &ws) noexcept
Tensor3 surface_reflectivity(Workspace &ws) noexcept
Vector rtp_pos(Workspace &ws) noexcept
void checksize_strict() const final
Strict consistency check.
The global header file for ARTS.
Index cloudbox_on(Workspace &ws) noexcept
void surfaceTelsem(Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Index &atmosphere_dim, const Index &stokes_dim, const Vector &f_grid, const Vector &lat_grid, const Vector &lat_true, const Vector &lon_true, const Vector &rtp_pos, const Vector &rtp_los, const Numeric &surface_skin_t, const TelsemAtlas &atlas, const Numeric &r_min, const Numeric &r_max, const Numeric &d_max, const Verbosity &verbosity)
WORKSPACE METHOD: surfaceTelsem.
ArrayOfString surface_props_names(Workspace &ws) noexcept