52 return (180 -
abs(rte_los[0]) +
abs(specular_los[0])) / 2;
58 while (z_surface >= z_profile[ip+1]) {
74 iy = surface_emission;
78 for (
Index ilos = 0; ilos < nlos; ilos++) {
81 for (
Index iv = 0; iv < nf; iv++) {
83 iy(iv,
joker) += rtmp;
94 const Index& stokes_dim,
95 const Numeric& surface_skin_t) {
102 surface_rmatrix = 0.0;
103 surface_emission = 0.0;
109 const Numeric rmean = (rv + rh) / 2;
111 surface_rmatrix(0, 0) = rmean;
112 surface_emission[0] = B * (1 - rmean);
114 if (stokes_dim > 1) {
115 const Numeric rdiff = (rv - rh) / 2;
117 surface_rmatrix(1, 0) = rdiff;
118 surface_rmatrix(0, 1) = rdiff;
119 surface_rmatrix(1, 1) = rmean;
120 surface_emission[1] = -B * rdiff;
122 if (stokes_dim > 2) {
127 surface_rmatrix(2, 2) =
c;
129 if (stokes_dim > 3) {
132 surface_rmatrix(2, 3) =
d;
133 surface_rmatrix(3, 2) = -
d;
134 surface_rmatrix(3, 3) =
c;
143 const Tensor3& surface_props_data,
147 "The number of pages in *surface_props_data* and "
148 "length of *surface_props_names* differ.");
150 if (surface_props_names.
nelem() == 0) {
154 (atmosphere_dim == 1 ? 1 : lat_grid.
nelem()),
155 "Row-size of *surface_props_data* not as expected.");
157 (atmosphere_dim <= 2 ? 1 : lon_grid.
nelem()),
158 "Column-size of *surface_props_data* not as expected.");
160 for (
Index i = 0; i < surface_props_names.
nelem(); i++) {
162 "Element ", i,
" (0-based) of *surface_props_names* is empty.")
163 for (
Index j = i + 1; j < surface_props_names.
nelem(); j++) {
165 "Two surface properties with same name found!\n"
166 "This found for these two properties\n"
169 " name: ", surface_props_names[i])
176 const Index& atmosphere_dim,
180 const Tensor3& surface_props_data,
185 for (
Index i = 0; i < surface_props_names.
nelem(); i++) {
186 if (surface_props_names[i] == vname) {
198 "The following property was requested\n"
200 "but it could not be found in *surface_props_names*.")
210 "The lengths of *dsurface_names* and *dsurface_rmatrix_dx* differ.");
212 "The lengths of *dsurface_names* and *dsurface_emission_dx* differ.");
214 for (
Index i = 0; i < nq; i++) {
216 for (
Index j = 0; j < surface_props_names.
nelem() && !found; j++) {
217 if (dsurface_names[i] == surface_props_names[j]) {
222 "String ", i,
" (0-based) of *dsurface_names* is \"",
223 dsurface_names[i],
"\"\n"
224 "but this string could not be found in *surface_props_names*.\n"
225 "This is likely due to incorrect choice of quantity when\n"
226 " calling *jacobianAddSurfaceQuantity*.")
234 Index& stars_visible,
238 const Index& stokes_dim,
240 const Index& atmosphere_dim,
256 const Vector& refellipsoid,
262 const Numeric& ppath_lraytrace,
263 const Index& ppath_inside_cloudbox_do,
264 const Index& cloudbox_on,
266 const Index& gas_scattering_do,
267 const Index& jacobian_do,
271 const Agenda& propmat_clearsky_agenda,
272 const Agenda& water_p_eq_agenda,
273 const Agenda& gas_scattering_agenda,
274 const Agenda& ppath_step_agenda,
313 ppath_inside_cloudbox_do,
344 Tensor4 ppvar_trans_cumulat_dummy;
345 Tensor4 ppvar_trans_partial_dummy;
362 ppvar_trans_cumulat_dummy,
363 ppvar_trans_partial_dummy,
390 propmat_clearsky_agenda,
392 gas_scattering_agenda,
Index nelem() const ARTS_NOEXCEPT
A constant view of a Matrix.
Index nrows() const noexcept
Index ncols() const noexcept
A constant view of a Tensor3.
Index npages() const
Returns the number of pages.
Index nrows() const
Returns the number of rows.
Index ncols() const
Returns the number of columns.
A constant view of a Tensor4.
A constant view of a Vector.
Index nelem() const noexcept
Returns the number of elements.
void resize(Index r, Index c)
Resize function.
void mult(MatrixView C, ConstMatrixView A, const Block &B)
#define ARTS_ASSERT(condition,...)
#define ARTS_USER_ERROR(...)
#define ARTS_USER_ERROR_IF(condition,...)
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 iyTransmissionStandard(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, ArrayOfTensor3 &diy_dx, Vector &ppvar_p, Vector &ppvar_t, EnergyLevelMap &ppvar_nlte, Matrix &ppvar_vmr, Matrix &ppvar_wind, Matrix &ppvar_mag, Matrix &ppvar_pnd, Matrix &ppvar_f, Tensor3 &ppvar_iy, Tensor4 &ppvar_trans_cumulat, Tensor4 &ppvar_trans_partial, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Tensor3 &t_field, const EnergyLevelMap &nlte_field, const Tensor4 &vmr_field, const ArrayOfArrayOfSpeciesTag &abs_species, const Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Tensor3 &mag_u_field, const Tensor3 &mag_v_field, const Tensor3 &mag_w_field, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Index &gas_scattering_do, const Tensor4 &pnd_field, const ArrayOfTensor4 &dpnd_field_dx, const ArrayOfString &scat_species, const ArrayOfArrayOfSingleScatteringData &scat_data, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Ppath &ppath, const Matrix &iy_transmitter, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const Agenda &gas_scattering_agenda, const Index &iy_agenda_call1, const Tensor3 &iy_transmittance, const Numeric &rte_alonglos_v, const Verbosity &)
WORKSPACE METHOD: iyTransmissionStandard.
void abs(Sparse &A, const Sparse &B)
Absolute value of sparse matrix elements.
Implementation of Matrix, Vector, and such stuff.
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.
constexpr Numeric imag(Complex c) noexcept
imag
constexpr Complex conj(Complex c) noexcept
the conjugate of c
std::complex< Numeric > Complex
constexpr Numeric real(Complex c) noexcept
real
Numeric planck(const Numeric &f, const Numeric &t)
planck
This file contains declerations of functions of physical character.
void ppath_calc(Workspace &ws, Ppath &ppath, const Agenda &ppath_step_agenda, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Vector &f_grid, const Vector &refellipsoid, const Matrix &z_surface, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Vector &rte_pos, const Vector &rte_los, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const bool &ppath_inside_cloudbox_do, const Verbosity &verbosity)
This is the core for the WSM ppathStepByStep.
Numeric pow(const Rational base, Numeric exp)
Power of.
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.
The structure to describe a propagation path and releated quantities.
void get_sun_background(Matrix &iy, Index &suns_visible, const ArrayOfSun &suns, const Ppath &ppath, const Vector &f_grid, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &refellipsoid)
Gets the sun background for a given ppath.
void surface_get_incoming_direct(Workspace &ws, Matrix &iy_incoming, Index &stars_visible, Vector &specular_los, const Vector &rtp_pos, const Vector &rtp_los, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Tensor3 &t_field, const EnergyLevelMap &nlte_field, const Tensor4 &vmr_field, const ArrayOfArrayOfSpeciesTag &abs_species, const Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Tensor3 &mag_u_field, const Tensor3 &mag_v_field, const Tensor3 &mag_w_field, const Matrix &z_surface, const Vector &refellipsoid, const Tensor4 &pnd_field, const ArrayOfTensor4 &dpnd_field_dx, const ArrayOfString &scat_species, const ArrayOfArrayOfSingleScatteringData &scat_data, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Index &ppath_inside_cloudbox_do, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Index &gas_scattering_do, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfSun &suns, const Numeric &rte_alonglos_v, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const Agenda &gas_scattering_agenda, const Agenda &ppath_step_agenda, const Verbosity &verbosity)
Calculate the incoming direct radiation at the surface for a given line of sight.
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.
void surface_calc(Matrix &iy, ConstTensor3View I, ConstMatrixView surface_los, ConstTensor4View surface_rmatrix, ConstMatrixView surface_emission)
Weights together downwelling radiation and surface emission.
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 calc_incang(ConstVectorView rte_los, ConstVectorView specular_los)
Calculates the incidence angle for a flat surface, based on rte_los and specular_los.
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
Index index_of_zsurface(const Numeric &z_surface, ConstVectorView z_profile)
Lccates the surface with respect to pressure levels.
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.
This file contains the Workspace class.