ARTS
2.4.0(git:4fb77825)
|
Functions releated to calculation of propagation paths. More...
#include "ppath.h"
#include <cmath>
#include <stdexcept>
#include "agenda_class.h"
#include "array.h"
#include "arts_omp.h"
#include "auto_md.h"
#include "check_input.h"
#include "geodetic.h"
#include "logic.h"
#include "math_funcs.h"
#include "messages.h"
#include "mystring.h"
#include "poly_roots.h"
#include "refraction.h"
#include "rte.h"
#include "special_interp.h"
Go to the source code of this file.
Functions | |
Numeric | geometrical_ppc (const Numeric &r, const Numeric &za) |
Calculates the propagation path constant for pure geometrical calculations. More... | |
Numeric | geompath_za_at_r (const Numeric &ppc, const Numeric &a_za, const Numeric &r) |
Calculates the zenith angle for a given radius along a geometrical propagation path. More... | |
Numeric | geompath_r_at_za (const Numeric &ppc, const Numeric &za) |
Calculates the zenith angle for a given radius along a geometrical propagation path. More... | |
Numeric | geompath_lat_at_za (const Numeric &za0, const Numeric &lat0, const Numeric &za) |
Calculates the latitude for a given zenith angle along a geometrical propagation path. More... | |
Numeric | geompath_l_at_r (const Numeric &ppc, const Numeric &r) |
Calculates the length from the tangent point for the given radius. More... | |
Numeric | geompath_r_at_l (const Numeric &ppc, const Numeric &l) |
Calculates the radius for a distance from the tangent point. More... | |
Numeric | geompath_r_at_lat (const Numeric &ppc, const Numeric &lat0, const Numeric &za0, const Numeric &lat) |
Calculates the radius for a given latitude. More... | |
void | geompath_from_r1_to_r2 (Vector &r, Vector &lat, Vector &za, Numeric &lstep, const Numeric &ppc, const Numeric &r1, const Numeric &lat1, const Numeric &za1, const Numeric &r2, const bool &tanpoint, const Numeric &lmax) |
Determines radii, latitudes and zenith angles between two points of a propagation path. More... | |
void | cart2zaaa (Numeric &za, Numeric &aa, const Numeric &dx, const Numeric &dy, const Numeric &dz) |
Converts a cartesian directional vector to zenith and azimuth. More... | |
void | zaaa2cart (Numeric &dx, Numeric &dy, Numeric &dz, const Numeric &za, const Numeric &aa) |
Converts zenith and azimuth angles to a cartesian unit vector. More... | |
void | rotationmat3D (Matrix &R, ConstVectorView vrot, const Numeric &a) |
Creates a 3D rotation matrix. More... | |
void | add_za_aa (Numeric &za, Numeric &aa, const Numeric &za0, const Numeric &aa0, const Numeric &dza, const Numeric &daa) |
Adds up zenith and azimuth angles. More... | |
void | diff_za_aa (Numeric &dza, Numeric &daa, const Numeric &za0, const Numeric &aa0, const Numeric &za, const Numeric &aa) |
Takes the difference of zenith and azimuth angles. More... | |
Numeric | refraction_ppc (const Numeric &r, const Numeric &za, const Numeric &refr_index_air) |
Calculates the propagation path constant for cases with refraction. More... | |
void | resolve_lon (Numeric &lon, const Numeric &lon5, const Numeric &lon6) |
Resolves which longitude angle that shall be used. More... | |
void | find_tanpoint (Index &it, const Ppath &ppath) |
Identifies the tangent point of a propagation path. More... | |
Index | first_pos_before_altitude (const Ppath &p, const Numeric &alt) |
Determines ppath position just below an altitude. More... | |
void | error_if_limb_ppath (const Ppath &ppath) |
Throws an error if ppath altitudes not are strictly increasing or decreasing. More... | |
Numeric | rsurf_at_lat (const Numeric &lat1, const Numeric &lat3, const Numeric &r1, const Numeric &r3, const Numeric &lat) |
Determines the radius of a pressure level or the surface given the radius at the corners of a 2D grid cell. More... | |
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. More... | |
void | plevel_slope_2d (Numeric &c1, const Numeric &lat1, const Numeric &lat2, const Numeric &r1, const Numeric &r2) |
Calculates the radial slope of the surface or a pressure level for 2D. More... | |
Numeric | plevel_angletilt (const Numeric &r, const Numeric &c1) |
Calculates the angular tilt of the surface or a pressure level. More... | |
bool | is_los_downwards (const Numeric &za, const Numeric &tilt) |
Determines if a line-of-sight is downwards compared to the angular tilt of the surface or a pressure level. More... | |
void | r_crossing_2d (Numeric &lat, Numeric &l, const Numeric &r_hit, const Numeric &r_start, const Numeric &lat_start, const Numeric &za_start, const Numeric &ppc) |
Calculates where a 2D LOS crosses the specified radius. More... | |
Numeric | rslope_crossing2d (const Numeric &rp, const Numeric &za, const Numeric &r0, Numeric c1) |
Calculates the angular distance to a crossing with a level having a radial slope. More... | |
void | plevel_crossing_2d (Numeric &r, Numeric &lat, Numeric &l, const Numeric &r_start0, const Numeric &lat_start, const Numeric &za_start, const Numeric &ppc, const Numeric &lat1, const Numeric &lat3, const Numeric &r1, const Numeric &r3, const bool &above) |
Handles the crossing with a geometric ppaths step and a atmospheric grid box level for 2D. More... | |
Numeric | rsurf_at_latlon (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) |
Determines the radius of a pressure level or the surface given the radius at the corners of a 3D grid cell. More... | |
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) |
void | plevel_slope_3d (Numeric &c1, Numeric &c2, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstVectorView refellipsoid, ConstMatrixView z_surf, const GridPos &gp_lat, const GridPos &gp_lon, const Numeric &aa) |
Calculates the radial slope of the surface or a pressure level for 3D. More... | |
Numeric | rslope_crossing3d (const Numeric &rp, const Numeric &za, const Numeric &r0, Numeric c1, Numeric c2) |
3D version of rslope_crossing2d. More... | |
void | r_crossing_3d (Numeric &lat, Numeric &lon, Numeric &l, const Numeric &r_hit, const Numeric &r_start, const Numeric &lat_start, const Numeric &lon_start, const Numeric &za_start, const Numeric &ppc, const Numeric &x, const Numeric &y, const Numeric &z, const Numeric &dx, const Numeric &dy, const Numeric &dz) |
Calculates where a 3D LOS crosses the specified radius. More... | |
void | ppath_init_structure (Ppath &ppath, const Index &atmosphere_dim, const Index &np) |
Initiates a Ppath structure to hold the given number of points. More... | |
void | ppath_set_background (Ppath &ppath, const Index &case_nr) |
Sets the background field of a Ppath structure. More... | |
Index | ppath_what_background (const Ppath &ppath) |
Returns the case number for the radiative background. More... | |
void | ppath_copy (Ppath &ppath1, const Ppath &ppath2, const Index &ncopy) |
Copy the content in ppath2 to ppath1. More... | |
void | ppath_append (Ppath &ppath1, const Ppath &ppath2) |
Combines two Ppath structures. More... | |
void | ppath_start_1d (Numeric &r_start, Numeric &lat_start, Numeric &za_start, Index &ip, const Ppath &ppath) |
Internal help function for 1D path calculations. More... | |
void | ppath_end_1d (Ppath &ppath, ConstVectorView r_v, ConstVectorView lat_v, ConstVectorView za_v, ConstVectorView lstep, ConstVectorView n_v, ConstVectorView ng_v, ConstVectorView z_field, ConstVectorView refellipsoid, const Index &ip, const Index &endface, const Numeric &ppc) |
Internal help function for 1D path calculations. More... | |
void | ppath_start_2d (Numeric &r_start, Numeric &lat_start, Numeric &za_start, Index &ip, Index &ilat, Numeric &lat1, Numeric &lat3, Numeric &r1a, Numeric &r3a, Numeric &r3b, Numeric &r1b, Numeric &rsurface1, Numeric &rsurface3, Ppath &ppath, ConstVectorView lat_grid, ConstMatrixView z_field, ConstVectorView refellipsoid, ConstVectorView z_surface) |
Internal help function for 2D path calculations. More... | |
void | ppath_end_2d (Ppath &ppath, ConstVectorView r_v, ConstVectorView lat_v, ConstVectorView za_v, ConstVectorView lstep, ConstVectorView n_v, ConstVectorView ng_v, ConstVectorView lat_grid, ConstMatrixView z_field, ConstVectorView refellipsoid, const Index &ip, const Index &ilat, const Index &endface, const Numeric &ppc) |
Internal help function for 2D path calculations. More... | |
void | ppath_start_3d (Numeric &r_start, Numeric &lat_start, Numeric &lon_start, Numeric &za_start, Numeric &aa_start, Index &ip, Index &ilat, Index &ilon, Numeric &lat1, Numeric &lat3, Numeric &lon5, Numeric &lon6, Numeric &r15a, Numeric &r35a, Numeric &r36a, Numeric &r16a, Numeric &r15b, Numeric &r35b, Numeric &r36b, Numeric &r16b, Numeric &rsurface15, Numeric &rsurface35, Numeric &rsurface36, Numeric &rsurface16, Ppath &ppath, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView refellipsoid, ConstMatrixView z_surface) |
Internal help function for 3D path calculations. More... | |
void | ppath_end_3d (Ppath &ppath, ConstVectorView r_v, ConstVectorView lat_v, ConstVectorView lon_v, ConstVectorView za_v, ConstVectorView aa_v, ConstVectorView lstep, ConstVectorView n_v, ConstVectorView ng_v, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView refellipsoid, const Index &ip, const Index &ilat, const Index &ilon, const Index &endface, const Numeric &ppc) |
Internal help function for 3D path calculations. More... | |
void | do_gridrange_1d (Vector &r_v, Vector &lat_v, Vector &za_v, Numeric &lstep, Index &endface, const Numeric &r_start0, const Numeric &lat_start, const Numeric &za_start, const Numeric &ppc, const Numeric &lmax, const Numeric &ra, const Numeric &rb, const Numeric &rsurface) |
Calculates the geometrical path through a 1D grid range. More... | |
void | ppath_step_geom_1d (Ppath &ppath, ConstVectorView z_field, ConstVectorView refellipsoid, const Numeric &z_surface, const Numeric &lmax) |
Calculates 1D geometrical propagation path steps. More... | |
void | do_gridcell_2d_byltest (Vector &r_v, Vector &lat_v, Vector &za_v, Numeric &lstep, Index &endface, const Numeric &r_start0, const Numeric &lat_start0, const Numeric &za_start, const Numeric &l_start, const Index &icall, const Numeric &ppc, const Numeric &lmax, const Numeric &lat1, const Numeric &lat3, const Numeric &r1a, const Numeric &r3a, const Numeric &r3b, const Numeric &r1b, const Numeric &rsurface1, const Numeric &rsurface3) |
Works as do_gridcell_3d_byltest, but downscaled to 2D. More... | |
void | ppath_step_geom_2d (Ppath &ppath, ConstVectorView lat_grid, ConstMatrixView z_field, ConstVectorView refellipsoid, ConstVectorView z_surface, const Numeric &lmax) |
Calculates 2D geometrical propagation path steps. More... | |
void | do_gridcell_3d_byltest (Vector &r_v, Vector &lat_v, Vector &lon_v, Vector &za_v, Vector &aa_v, Numeric &lstep, Index &endface, const Numeric &r_start0, const Numeric &lat_start0, const Numeric &lon_start0, const Numeric &za_start, const Numeric &aa_start, const Numeric &l_start, const Index &icall, const Numeric &ppc, const Numeric &lmax, const Numeric &lat1, const Numeric &lat3, const Numeric &lon5, const Numeric &lon6, const Numeric &r15a, const Numeric &r35a, const Numeric &r36a, const Numeric &r16a, const Numeric &r15b, const Numeric &r35b, const Numeric &r36b, const Numeric &r16b, const Numeric &rsurface15, const Numeric &rsurface35, const Numeric &rsurface36, const Numeric &rsurface16) |
See ATD for a description of the algorithm. More... | |
void | ppath_step_geom_3d (Ppath &ppath, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView refellipsoid, ConstMatrixView z_surface, const Numeric &lmax) |
Calculates 3D geometrical propagation path steps. More... | |
void | raytrace_1d_linear_basic (Workspace &ws, Array< Numeric > &r_array, Array< Numeric > &lat_array, Array< Numeric > &za_array, Array< Numeric > &l_array, Array< Numeric > &n_array, Array< Numeric > &ng_array, Index &endface, ConstVectorView p_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &lmax, const Agenda &refr_index_air_agenda, const Numeric &lraytrace, const Numeric &rsurface, const Numeric &r1, const Numeric &r3, Numeric r, Numeric lat, Numeric za) |
Performs ray tracing for 1D with linear steps. More... | |
void | ppath_step_refr_1d (Workspace &ws, Ppath &ppath, ConstVectorView p_grid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, ConstVectorView refellipsoid, const Numeric &z_surface, const Numeric &lmax, const Agenda &refr_index_air_agenda, const String &rtrace_method, const Numeric &lraytrace) |
Calculates 1D propagation path steps including effects of refraction. More... | |
void | raytrace_2d_linear_basic (Workspace &ws, Array< Numeric > &r_array, Array< Numeric > &lat_array, Array< Numeric > &za_array, Array< Numeric > &l_array, Array< Numeric > &n_array, Array< Numeric > &ng_array, Index &endface, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &lmax, const Agenda &refr_index_air_agenda, const Numeric &lraytrace, const Numeric &lat1, const Numeric &lat3, const Numeric &rsurface1, const Numeric &rsurface3, const Numeric &r1a, const Numeric &r3a, const Numeric &r3b, const Numeric &r1b, Numeric r, Numeric lat, Numeric za) |
Performs ray tracing for 2D with linear steps. More... | |
void | ppath_step_refr_2d (Workspace &ws, Ppath &ppath, ConstVectorView p_grid, ConstVectorView lat_grid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, ConstVectorView refellipsoid, ConstVectorView z_surface, const Numeric &lmax, const Agenda &refr_index_air_agenda, const String &rtrace_method, const Numeric &lraytrace) |
Calculates 2D propagation path steps, with refraction, using a simple and fast ray tracing scheme. More... | |
void | raytrace_3d_linear_basic (Workspace &ws, Array< Numeric > &r_array, Array< Numeric > &lat_array, Array< Numeric > &lon_array, Array< Numeric > &za_array, Array< Numeric > &aa_array, Array< Numeric > &l_array, Array< Numeric > &n_array, Array< Numeric > &ng_array, Index &endface, ConstVectorView refellipsoid, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &lmax, const Agenda &refr_index_air_agenda, const Numeric &lraytrace, const Numeric &lat1, const Numeric &lat3, const Numeric &lon5, const Numeric &lon6, const Numeric &rsurface15, const Numeric &rsurface35, const Numeric &rsurface36, const Numeric &rsurface16, const Numeric &r15a, const Numeric &r35a, const Numeric &r36a, const Numeric &r16a, const Numeric &r15b, const Numeric &r35b, const Numeric &r36b, const Numeric &r16b, Numeric r, Numeric lat, Numeric lon, Numeric za, Numeric aa) |
Performs ray tracing for 3D with linear steps. More... | |
void | ppath_step_refr_3d (Workspace &ws, Ppath &ppath, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, ConstVectorView refellipsoid, ConstMatrixView z_surface, const Numeric &lmax, const Agenda &refr_index_air_agenda, const String &rtrace_method, const Numeric &lraytrace) |
Calculates 3D propagation path steps, with refraction, using a simple and fast ray tracing scheme. More... | |
void | ppath_start_stepping (Ppath &ppath, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView refellipsoid, ConstMatrixView z_surface, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const bool &ppath_inside_cloudbox_do, ConstVectorView rte_pos, ConstVectorView rte_los, const Verbosity &verbosity) |
Initiates a Ppath structure for calculation of a path with ppath_step. More... | |
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. More... | |
Variables | |
const Numeric | DEG2RAD |
const Numeric | RAD2DEG |
const Numeric | RTOL = 1e-3 |
const Numeric | LACC = 1e-5 |
const Numeric | R_NOT_FOUND = -1 |
const Numeric | L_NOT_FOUND = 99e99 |
const Numeric | LAT_NOT_FOUND = 99e99 |
const Numeric | LON_NOT_FOUND = 99e99 |
Functions releated to calculation of propagation paths.
Functions to determine propagation paths for different atmospheric dimensionalities, with and without refraction.
The term propagation path is here shortened to ppath.
Definition in file ppath.cc.
void add_za_aa | ( | Numeric & | za, |
Numeric & | aa, | ||
const Numeric & | za0, | ||
const Numeric & | aa0, | ||
const Numeric & | dza, | ||
const Numeric & | daa | ||
) |
Adds up zenith and azimuth angles.
Adds (dza,daa) to (za0,aa0), assuming that a unit changes in za and aa are equal where (dza,daa)=(0,0).
[out] | za | End zenith angle |
[out] | aa | End azimuth angle |
[in] | za0 | Start zenith angle |
[in] | aa0 | Start azimuth angle |
[in] | dza | Change in zenith angle |
[in] | daa | Change in azimuth angle |
Definition at line 406 of file ppath.cc.
References zaaa2cart().
Referenced by AddZaAa(), iyb_calc_body(), and Test().
void cart2zaaa | ( | Numeric & | za, |
Numeric & | aa, | ||
const Numeric & | dx, | ||
const Numeric & | dy, | ||
const Numeric & | dz | ||
) |
Converts a cartesian directional vector to zenith and azimuth.
This function and the sister function cart2zaaa handle transformation of line-of-sights. This in contrast to the sph/poslos functions that handles positions, or combinations of positions and line-of-sight.
The cartesian coordinate system used for these two functions can be defined as z : za = 0 x : za=90, aa=0 y : za=90, aa=90
[out] | za | LOS zenith angle at observation position. |
[out] | aa | LOS azimuth angle at observation position. |
[in] | dx | x-part of LOS unit vector. |
[in] | dy | y-part of LOS unit vector. |
[in] | dz | z-part of LOS unit vector. |
Definition at line 312 of file ppath.cc.
References dx, RAD2DEG, and sqrt().
Referenced by adjust_los(), and specular_losCalc().
void diff_za_aa | ( | Numeric & | dza, |
Numeric & | daa, | ||
const Numeric & | za0, | ||
const Numeric & | aa0, | ||
const Numeric & | za, | ||
const Numeric & | aa | ||
) |
Takes the difference of zenith and azimuth angles.
Takes the difference between a set of angles (za,aa) and a reference direction (za0,aa0). That is, this function is the "inverse" of add_za_aa.
[out] | dza | Change in zenith angle |
[out] | daa | Change in azimuth angle |
[in] | za0 | Zenith angle of reference direction |
[in] | aa0 | Azimuth angle of reference direction |
[in] | za | Zenith angle of second direction |
[in] | aa | Azimuth angle of second direction |
Definition at line 444 of file ppath.cc.
References zaaa2cart().
Referenced by DiffZaAa(), and Test().
void do_gridcell_2d_byltest | ( | Vector & | r_v, |
Vector & | lat_v, | ||
Vector & | za_v, | ||
Numeric & | lstep, | ||
Index & | endface, | ||
const Numeric & | r_start0, | ||
const Numeric & | lat_start0, | ||
const Numeric & | za_start, | ||
const Numeric & | l_start, | ||
const Index & | icall, | ||
const Numeric & | ppc, | ||
const Numeric & | lmax, | ||
const Numeric & | lat1, | ||
const Numeric & | lat3, | ||
const Numeric & | r1a, | ||
const Numeric & | r3a, | ||
const Numeric & | r3b, | ||
const Numeric & | r1b, | ||
const Numeric & | rsurface1, | ||
const Numeric & | rsurface3 | ||
) |
Works as do_gridcell_3d_byltest, but downscaled to 2D.
Definition at line 2439 of file ppath.cc.
References abs, ANGTOL, cart2pol(), cart2poslos(), dx, LACC, max, poslos2cart(), Vector::resize(), rsurf_at_lat(), RTOL, and ARTS::Var::x().
Referenced by ppath_step_geom_2d(), and raytrace_2d_linear_basic().
void do_gridcell_3d_byltest | ( | Vector & | r_v, |
Vector & | lat_v, | ||
Vector & | lon_v, | ||
Vector & | za_v, | ||
Vector & | aa_v, | ||
Numeric & | lstep, | ||
Index & | endface, | ||
const Numeric & | r_start0, | ||
const Numeric & | lat_start0, | ||
const Numeric & | lon_start0, | ||
const Numeric & | za_start, | ||
const Numeric & | aa_start, | ||
const Numeric & | l_start, | ||
const Index & | icall, | ||
const Numeric & | ppc, | ||
const Numeric & | lmax, | ||
const Numeric & | lat1, | ||
const Numeric & | lat3, | ||
const Numeric & | lon5, | ||
const Numeric & | lon6, | ||
const Numeric & | r15a, | ||
const Numeric & | r35a, | ||
const Numeric & | r36a, | ||
const Numeric & | r16a, | ||
const Numeric & | r15b, | ||
const Numeric & | r35b, | ||
const Numeric & | r36b, | ||
const Numeric & | r16b, | ||
const Numeric & | rsurface15, | ||
const Numeric & | rsurface35, | ||
const Numeric & | rsurface36, | ||
const Numeric & | rsurface16 | ||
) |
See ATD for a description of the algorithm.
Definition at line 2828 of file ppath.cc.
References abs, ANGTOL, cart2poslos(), cart2sph(), DEG2RAD, dx, LACC, max, POLELAT, poslos2cart(), Vector::resize(), resolve_lon(), rsurf_at_latlon(), RTOL, ARTS::Var::x(), and ARTS::Var::y().
Referenced by ppath_step_geom_3d(), and raytrace_3d_linear_basic().
void do_gridrange_1d | ( | Vector & | r_v, |
Vector & | lat_v, | ||
Vector & | za_v, | ||
Numeric & | lstep, | ||
Index & | endface, | ||
const Numeric & | r_start0, | ||
const Numeric & | lat_start, | ||
const Numeric & | za_start, | ||
const Numeric & | ppc, | ||
const Numeric & | lmax, | ||
const Numeric & | ra, | ||
const Numeric & | rb, | ||
const Numeric & | rsurface | ||
) |
Calculates the geometrical path through a 1D grid range.
This function works as do_gridcell_2d, but is valid for 1D cases.
The coding of variables and end face is as for do_gridcell_2d, with the exception that end faces 2 and 4 do not exist here.
[out] | r_v | Vector with radius of found path points. |
[out] | lat_v | Vector with latitude of found path points. |
[out] | za_v | Vector with LOS zenith angle at found path points. |
[out] | lstep | Vector with length along the path between points. |
[out] | endface | Number coding for exit face. |
[in] | r_start0 | Radius of start point. |
[in] | lat_start | Latitude of start point. |
[in] | za_start | LOS zenith angle at start point. |
[in] | ppc | Propagation path constant. |
[in] | lmax | Maximum allowed length along the path. -1 = no limit. |
[in] | ra | Radius of lower pressure level. |
[in] | rb | Radius of upper pressure level (rb > ra); |
[in] | rsurface | Radius for the surface. |
Definition at line 2300 of file ppath.cc.
References geompath_from_r1_to_r2(), and RTOL.
Referenced by ppath_step_geom_1d(), and raytrace_1d_linear_basic().
void error_if_limb_ppath | ( | const Ppath & | ppath | ) |
Throws an error if ppath altitudes not are strictly increasing or decreasing.
[in] | ppath | Propagation path structure. |
Definition at line 555 of file ppath.cc.
References ARTS::Var::Ppath::pos(), ARTS::Var::ppath(), and sign().
Referenced by iyIndependentBeamApproximation(), and yActive().
Identifies the tangent point of a propagation path.
The tangent points is defined as the point with the lowest altitude.
The index of the tangent point is determined. If no tangent point is found, the index is set to -1.
[out] | it | Index of tangent point |
[in] | ppath | Propagation path structure. |
Definition at line 525 of file ppath.cc.
References ARTS::Var::Ppath::pos(), and ARTS::Var::ppath().
Referenced by defocusing_sat2sat(), TangentPointExtract(), and TangentPointPrint().
Determines ppath position just below an altitude.
Returns -1 if the selected altitude is not passed.
[in] | ppath | Propagation path structure. |
[in] | alt | Altitude |
Definition at line 537 of file ppath.cc.
References Ppath::np, and Ppath::pos.
Referenced by ppathCalcFromAltitude().
Calculates the propagation path constant for pure geometrical calculations.
Both positive and negative zenith angles are handled.
[in] | r | Radius of the sensor position. |
[in] | za | Zenith angle of the sensor line-of-sight. |
Definition at line 96 of file ppath.cc.
Referenced by ppath_start_stepping(), ppath_step_geom_1d(), ppath_step_geom_2d(), ppath_step_geom_3d(), raytrace_1d_linear_basic(), raytrace_2d_linear_basic(), and raytrace_3d_linear_basic().
void geompath_from_r1_to_r2 | ( | Vector & | r, |
Vector & | lat, | ||
Vector & | za, | ||
Numeric & | lstep, | ||
const Numeric & | ppc, | ||
const Numeric & | r1, | ||
const Numeric & | lat1, | ||
const Numeric & | za1, | ||
const Numeric & | r2, | ||
const bool & | tanpoint, | ||
const Numeric & | lmax | ||
) |
Determines radii, latitudes and zenith angles between two points of a propagation path.
Both start and end point are included in the returned vectors.
[out] | r | Radius of propagation path points. |
[out] | lat | Latitude of propagation path points. |
[out] | za | Zenith angle of propagation path points. |
[out] | lstep | Distance along the path between the points. |
[in] | ppc | Propagation path constant. |
[in] | r1 | Radius for first point. |
[in] | lat1 | Latitude for first point. |
[in] | za1 | Zenith angle for first point. |
[in] | r2 | Radius for second point. |
[in] | tanpoint | True if there is a tangent point (r-based) between r1 and r2. Otherwise false. |
[in] | lmax | Length criterion for distance between path points. A negative value means no length criterion. |
Definition at line 236 of file ppath.cc.
References abs, ANGTOL, geompath_l_at_r(), geompath_lat_at_za(), geompath_r_at_l(), geompath_za_at_r(), ARTS::Var::lat(), max, Vector::resize(), and sign().
Referenced by do_gridrange_1d().
Calculates the length from the tangent point for the given radius.
The tangent point is either real or imaginary depending on the zenith angle of the sensor. See geometrical_tangent_radius.
[in] | ppc | Propagation path constant. |
[in] | r | Radius of the point of concern. |
Definition at line 158 of file ppath.cc.
Referenced by cart2poslos(), geompath_from_r1_to_r2(), ppath_start_stepping(), r_crossing_2d(), raytrace_1d_linear_basic(), and raytrace_2d_linear_basic().
Calculates the latitude for a given zenith angle along a geometrical propagation path.
Positive and negative zenith angles are handled. A positive zenith angle means a movement towards higher latitudes.
[in] | za0 | The zenith angle of the starting point. |
[in] | lat0 | The latitude of the starting point. |
[in] | za | The zenith angle of the second point. |
Definition at line 148 of file ppath.cc.
References abs.
Referenced by geompath_from_r1_to_r2(), ppath_start_stepping(), r_crossing_2d(), raytrace_1d_linear_basic(), and raytrace_2d_linear_basic().
Calculates the radius for a distance from the tangent point.
The tangent point is either real or imaginary depending on the zenith angle of the sensor. See geometrical_tangent_radius.
[in] | ppc | Propagation path constant. |
[in] | l | Length from the tangent point (positive or negative). |
Definition at line 182 of file ppath.cc.
References sqrt().
Referenced by geompath_from_r1_to_r2(), raytrace_1d_linear_basic(), and raytrace_2d_linear_basic().
Numeric geompath_r_at_lat | ( | const Numeric & | ppc, |
const Numeric & | lat0, | ||
const Numeric & | za0, | ||
const Numeric & | lat | ||
) |
Calculates the radius for a given latitude.
[in] | ppc | Propagation path constant. |
[in] | lat0 | Latitude at some other point of the path. |
[in] | za0 | Zenith angle for the point with latitude lat0. |
[in] | lat | Latitude of the point of interest. |
Definition at line 200 of file ppath.cc.
References abs, geompath_r_at_za(), and ARTS::Var::lat().
Calculates the zenith angle for a given radius along a geometrical propagation path.
Both positive and negative zenith angles are handled.
[in] | ppc | Propagation path constant. |
[in] | za | Zenith angle at the point of interest. |
Definition at line 141 of file ppath.cc.
Referenced by geompath_r_at_lat().
Calculates the zenith angle for a given radius along a geometrical propagation path.
For downlooking cases, the two points must be on the same side of the tangent point.
Both positive and negative zenith angles are handled.
[in] | ppc | Propagation path constant. |
[in] | a_za | A zenith angle along the path on the same side of the tangent point as the point of interest. |
[in] | r | Radius of the point of interest. |
Definition at line 103 of file ppath.cc.
References abs, RAD2DEG, and RTOL.
Referenced by geompath_from_r1_to_r2(), ppath_start_stepping(), r_crossing_2d(), raytrace_1d_linear_basic(), raytrace_2d_linear_basic(), and VectorZtanToZa1D().
Determines if a line-of-sight is downwards compared to the angular tilt of the surface or a pressure level.
For example, this function can be used to determine if the line-of-sight goes into the surface for a starting point exactly on the surface radius.
As the radius of the surface and pressure levels varies as a function of latitude, it is not clear if a zenith angle of 90 is above or below e.g. the surface.
[in] | za | Zenith angle of line-of-sight. |
[in] | tilt | Angular tilt of the surface or the pressure level (as returned by plevel_angletilt) |
Definition at line 638 of file ppath.cc.
References abs.
Referenced by ppath_start_2d(), and ppath_start_stepping().
Calculates the angular tilt of the surface or a pressure level.
Note that the tilt value is a local value. The tilt for a constant slope value, is different for different radii.
[in] | r | The radius for the level at the point of interest. |
[in] | c1 | The radial slope, as returned by e.g. plevel_slope_2d. |
Definition at line 632 of file ppath.cc.
References RAD2DEG.
Referenced by ppath_start_2d(), ppath_start_3d(), ppath_start_stepping(), and specular_losCalc().
void plevel_crossing_2d | ( | Numeric & | r, |
Numeric & | lat, | ||
Numeric & | l, | ||
const Numeric & | r_start0, | ||
const Numeric & | lat_start, | ||
const Numeric & | za_start, | ||
const Numeric & | ppc, | ||
const Numeric & | lat1, | ||
const Numeric & | lat3, | ||
const Numeric & | r1, | ||
const Numeric & | r3, | ||
const bool & | above | ||
) |
Handles the crossing with a geometric ppaths step and a atmospheric grid box level for 2D.
That is, we have a part of a pressure level or the planet's surface, extending between two latitudes (lat1 and lat3). The radius at each latitude is given (r1 and r3). The function first of determines if the ppath crosses the level/surface between the two latitudes. If yes, the radius and the latitude of the crossing point are calculated.
If the given path point is on the pressure level (rp=r0), the solution of zero length is rejected.
[out] | r | Radius at crossing. |
[out] | lat | Latitude at crossing. |
[out] | l | Length between start and crossing points. |
[in] | r_start0 | Radius of start point. |
[in] | lat_start | Latitude of start point. |
[in] | za_start | LOS zenith angle at start point. |
[in] | ppc | Propagation path constant. |
[in] | lat1 | Latitude of lower end. |
[in] | lat3 | Latitude of upper end. |
[in] | r1 | Radius at lat1. |
[in] | r3 | Radius at lat3. |
[in] | above | True if ppath start point is above level. Otherwise false. |
Definition at line 871 of file ppath.cc.
References abs, ANGTOL, L_NOT_FOUND, ARTS::Var::lat(), LAT_NOT_FOUND, max, R_NOT_FOUND, and rsurf_at_lat().
void plevel_slope_2d | ( | Numeric & | c1, |
const Numeric & | lat1, | ||
const Numeric & | lat2, | ||
const Numeric & | r1, | ||
const Numeric & | r2 | ||
) |
Calculates the radial slope of the surface or a pressure level for 2D.
This function returns the same quantity as the function above, but takes the radius and latitude at two points of the pressure level, instead of vector input. That is, for this function the interesting latitude range is known when calling the function.
[out] | c1 | The radial slope [m/degree] |
[in] | lat1 | A latitude. |
[in] | lat2 | Another latitude. |
[in] | r1 | Radius at lat1. |
[in] | r2 | Radius at lat2. |
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.
The radial slope is here the derivative of the radius with respect to the latitude. The unit is accordingly m/degree.
Note that the radius is defined to change linearly between grid points, and the slope is constant between to points of the latitude grid. The radius can inside the grid range be expressed as r = r0(lat0) + c1*(lat-lat0) .
Note also that the slope is always calculated with respect to increasing latitudes, independently of the zenith angle. The zenith angle is only used to determine which grid range that is of interest when the position is exactly on top of a grid point.
[out] | c1 | The radial slope [m/degree] |
[in] | lat_grid | The latitude grid. |
[in] | refellipsoid | As the WSV with the same name. |
[in] | z_surf | Geometrical altitude of the surface, or the pressure level of interest, for the latitide dimension |
[in] | gp | Latitude grid position for the position of interest |
[in] | za | LOS zenith angle. |
Definition at line 595 of file ppath.cc.
References gridpos2gridrange(), ARTS::Var::lat_grid(), refell2r(), and ARTS::Var::refellipsoid().
Referenced by ppath_start_2d(), ppath_start_stepping(), and specular_losCalc().
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 | ||
) |
Definition at line 1084 of file ppath.cc.
References ARTS::Var::lat(), ARTS::Var::lon(), and rsurf_at_latlon().
Referenced by plevel_slope_3d(), ppath_start_3d(), ppath_start_stepping(), and specular_losCalc().
void plevel_slope_3d | ( | Numeric & | c1, |
Numeric & | c2, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstVectorView | refellipsoid, | ||
ConstMatrixView | z_surf, | ||
const GridPos & | gp_lat, | ||
const GridPos & | gp_lon, | ||
const Numeric & | aa | ||
) |
Calculates the radial slope of the surface or a pressure level for 3D.
For 2D where the radius can be expressed as r = r0 + c1*dalpha, where alpha is the latitude. The radius is here for 3D expressed as a second order polynomial: r = r0 + c1*dalpha + c2*dalpha^2, where alpha is the angular change (in degrees) along the great circle along the given azimuth angle.
For a point exactly on a grid value it is not clear if it is the range below or above that is of interest. The azimuth angle is used to resolve such cases.
[out] | c1 | See above. Unit is m/degree. |
[out] | c2 | See above. Unit is m/degree^2. |
[in] | lat_grid | The latitude grid. |
[in] | lon_grid | The longitude grid. |
[in] | refellipsoid | As the WSV with the same name. |
[in] | z_surf | Geometrical altitude of the surface, or the pressure level of interest. |
[in] | gp_lat | Latitude grid position for the position of interest. |
[in] | gp_lon | Longitude grid position for the position of interest. |
[in] | aa | Azimuth angle. |
Definition at line 1162 of file ppath.cc.
References abs, gridpos2gridrange(), interp(), interpweights(), is_lon_cyclic(), ARTS::Var::lat(), ARTS::Var::lat_grid(), ARTS::Var::lon(), ARTS::Var::lon_grid(), plevel_slope_3d(), POLELAT, refell2r(), and ARTS::Var::refellipsoid().
Combines two Ppath structures.
The function appends a Ppath structure to another structure.
All the data of ppath1 is kept.
The first point in ppath2 is assumed to be the same as the last in ppath1. Only ppath2 fields start_pos, start_los, start_lstep, pos, los, r, lstep, nreal, ngroup, gp_XXX and background are considered.
[in,out] | ppath1 | Ppath structure to be expanded. |
[in] | ppath2 | The Ppath structure to include in ppath. |
Definition at line 1581 of file ppath.cc.
References Ppath::background, Ppath::dim, Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos_copy(), Ppath::los, Ppath::lstep, Ppath::ngroup, Ppath::np, Ppath::nreal, Ppath::pos, ARTS::Var::ppath(), ppath_copy(), ppath_init_structure(), ppath_what_background(), Ppath::r, Ppath::start_los, Ppath::start_lstep, and Ppath::start_pos.
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.
This function takes mainly the same input as ppathStepByStep (that is, those input arguments are the WSV with the same name).
[in] | ws | Current Workspace |
[in] | ppath | Output: A Ppath structure |
[in] | ppath_step_agenda | As the WSM with the same name. |
[in] | atmosphere_dim | The atmospheric dimensionality. |
[in] | p_grid | The pressure grid. |
[in] | lat_grid | The latitude grid. |
[in] | lon_grid | The longitude grid. |
[in] | z_field | As the WSM with the same name. |
[in] | f_grid | As the WSM with the same name. |
[in] | refellipsoid | As the WSM with the same name. |
[in] | z_surface | Surface altitude. |
[in] | cloudbox_on | Flag to activate the cloud box. |
[in] | cloudbox_limits | Index limits of the cloud box. |
[in] | rte_pos | The position of the sensor. |
[in] | rte_los | The line-of-sight of the sensor. |
[in] | ppath_lmax | As the WSM with the same name. |
[in] | ppath_lraytrace | As the WSM with the same name. |
[in] | ppath_inside_cloudbox_do | As the WSM with the same name. |
Definition at line 5206 of file ppath.cc.
References abs, ARTS::Var::atmosphere_dim(), chk_rte_los(), chk_rte_pos(), ARTS::Var::cloudbox_limits(), ARTS::Var::cloudbox_on(), ARTS::Var::f_grid(), fractional_gp(), gridpos(), is_gridpos_at_index_i(), joker, ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), Array< base >::nelem(), ARTS::Var::p_grid(), ARTS::Var::Ppath::pos(), ARTS::Var::ppath(), ppath_copy(), ppath_init_structure(), ARTS::Var::ppath_inside_cloudbox_do(), ARTS::Var::ppath_lmax(), ARTS::Var::ppath_lraytrace(), ppath_set_background(), ppath_start_stepping(), ARTS::Var::ppath_step(), ARTS::Var::ppath_step_agenda(), ppath_step_agendaExecute(), ppath_what_background(), ARTS::Var::refellipsoid(), ARTS::Var::rte_los(), ARTS::Var::rte_pos(), ARTS::Var::verbosity(), ARTS::Var::z_field(), and ARTS::Var::z_surface().
Referenced by defocusing_general_sub(), defocusing_sat2sat(), ppathFromRtePos2(), and ppathStepByStep().
Copy the content in ppath2 to ppath1.
The ppath1 structure must be allocated before calling the function. The structure can be allocated to hold more points than found in ppath2. The data of ppath2 is placed in the first positions of ppath1.
[in] | ppath1 | Output: Ppath structure. |
[in] | ppath2 | The ppath structure to be copied. |
[in] | ncopy | Number of points in ppath2 to copy. If set to negative, the number is set to ppath2.np. |
Definition at line 1515 of file ppath.cc.
References Ppath::background, Ppath::constant, Ppath::dim, Ppath::end_los, Ppath::end_lstep, Ppath::end_pos, Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos_copy(), joker, Ppath::los, Ppath::lstep, Ppath::ngroup, Ppath::np, Ppath::nreal, Ppath::pos, Ppath::r, Ppath::start_los, Ppath::start_lstep, and Ppath::start_pos.
Referenced by ppath_append(), ppath_calc(), and ppathFromRtePos2().
void ppath_end_1d | ( | Ppath & | ppath, |
ConstVectorView | r_v, | ||
ConstVectorView | lat_v, | ||
ConstVectorView | za_v, | ||
ConstVectorView | lstep, | ||
ConstVectorView | n_v, | ||
ConstVectorView | ng_v, | ||
ConstVectorView | z_field, | ||
ConstVectorView | refellipsoid, | ||
const Index & | ip, | ||
const Index & | endface, | ||
const Numeric & | ppc | ||
) |
Internal help function for 1D path calculations.
The function performs the end part of the calculations, that are common for geometrical and refraction calculations.
See the code for details.
Definition at line 1670 of file ppath.cc.
References gridpos_check_fd(), gridpos_force_end_fd(), ConstVectorView::nelem(), ARTS::Var::Ppath::pos(), ARTS::Var::ppath(), ppath_init_structure(), ppath_set_background(), ARTS::Var::refellipsoid(), and ARTS::Var::z_field().
Referenced by ppath_step_geom_1d(), and ppath_step_refr_1d().
void ppath_end_2d | ( | Ppath & | ppath, |
ConstVectorView | r_v, | ||
ConstVectorView | lat_v, | ||
ConstVectorView | za_v, | ||
ConstVectorView | lstep, | ||
ConstVectorView | n_v, | ||
ConstVectorView | ng_v, | ||
ConstVectorView | lat_grid, | ||
ConstMatrixView | z_field, | ||
ConstVectorView | refellipsoid, | ||
const Index & | ip, | ||
const Index & | ilat, | ||
const Index & | endface, | ||
const Numeric & | ppc | ||
) |
Internal help function for 2D path calculations.
The function performs the end part of the calculations, that are common for geometrical and refraction calculations.
See the code for details.
Definition at line 1844 of file ppath.cc.
References gridpos_check_fd(), gridpos_force_end_fd(), ARTS::Var::lat_grid(), ConstVectorView::nelem(), ARTS::Var::Ppath::pos(), ARTS::Var::ppath(), ppath_init_structure(), ppath_set_background(), refell2r(), ARTS::Var::refellipsoid(), w(), and ARTS::Var::z_field().
Referenced by ppath_step_geom_2d(), and ppath_step_refr_2d().
void ppath_end_3d | ( | Ppath & | ppath, |
ConstVectorView | r_v, | ||
ConstVectorView | lat_v, | ||
ConstVectorView | lon_v, | ||
ConstVectorView | za_v, | ||
ConstVectorView | aa_v, | ||
ConstVectorView | lstep, | ||
ConstVectorView | n_v, | ||
ConstVectorView | ng_v, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstTensor3View | z_field, | ||
ConstVectorView | refellipsoid, | ||
const Index & | ip, | ||
const Index & | ilat, | ||
const Index & | ilon, | ||
const Index & | endface, | ||
const Numeric & | ppc | ||
) |
Internal help function for 3D path calculations.
The function performs the end part of the calculations, that are common for geometrical and refraction calculations.
See the code for details.
Definition at line 2141 of file ppath.cc.
References abs, gridpos_check_fd(), gridpos_force_end_fd(), ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), ConstVectorView::nelem(), POLELAT, ARTS::Var::Ppath::pos(), ARTS::Var::ppath(), ppath_init_structure(), ppath_set_background(), refell2r(), ARTS::Var::refellipsoid(), rsurf_at_latlon(), and ARTS::Var::z_field().
Referenced by ppath_step_geom_3d(), and ppath_step_refr_3d().
Initiates a Ppath structure to hold the given number of points.
The background field is set to background case 0. The constant field is set to -1. The refraction field is set to 0.
The length of the lstep field is set to np-1.
[in] | ppath | Output: A Ppath structure. |
[in] | atmosphere_dim | The atmospheric dimensionality. |
[in] | np | Number of points of the path. |
Definition at line 1426 of file ppath.cc.
References ARTS::Var::atmosphere_dim(), max, ARTS::Var::Ppath::pos(), ARTS::Var::ppath(), and ppath_set_background().
Referenced by cloud_ppath_update1D(), cloud_ppath_update1D_noseq(), cloud_ppath_update3D(), ppath_append(), ppath_calc(), ppath_end_1d(), ppath_end_2d(), ppath_end_3d(), ppath_start_stepping(), ppathFromRtePos2(), and ppathPlaneParallel().
Sets the background field of a Ppath structure.
The different background cases have a number coding to simplify a possible change of the strings and checking of the what case that is valid.
The case numbers are:
0. Unvalid.
[in] | ppath | Output: A Ppath structure. |
[in] | case_nr | Case number (see above) |
Definition at line 1467 of file ppath.cc.
References ARTS::Var::ppath().
Referenced by ppath_calc(), ppath_end_1d(), ppath_end_2d(), ppath_end_3d(), ppath_init_structure(), ppath_start_stepping(), ppathFromRtePos2(), and ppathPlaneParallel().
void ppath_start_1d | ( | Numeric & | r_start, |
Numeric & | lat_start, | ||
Numeric & | za_start, | ||
Index & | ip, | ||
const Ppath & | ppath | ||
) |
Internal help function for 1D path calculations.
The function does the asserts and determined some variables that are common for geometrical and refraction calculations.
See the code for details.
Definition at line 1641 of file ppath.cc.
References gridpos2gridrange(), ARTS::Var::Ppath::pos(), and ARTS::Var::ppath().
Referenced by ppath_step_geom_1d(), and ppath_step_refr_1d().
void ppath_start_2d | ( | Numeric & | r_start, |
Numeric & | lat_start, | ||
Numeric & | za_start, | ||
Index & | ip, | ||
Index & | ilat, | ||
Numeric & | lat1, | ||
Numeric & | lat3, | ||
Numeric & | r1a, | ||
Numeric & | r3a, | ||
Numeric & | r3b, | ||
Numeric & | r1b, | ||
Numeric & | rsurface1, | ||
Numeric & | rsurface3, | ||
Ppath & | ppath, | ||
ConstVectorView | lat_grid, | ||
ConstMatrixView | z_field, | ||
ConstVectorView | refellipsoid, | ||
ConstVectorView | z_surface | ||
) |
Internal help function for 2D path calculations.
The function does the asserts and determined some variables that are common for geometrical and refraction calculations.
See the code for details.
Definition at line 1734 of file ppath.cc.
References abs, gridpos2gridrange(), gridpos_force_end_fd(), is_gridpos_at_index_i(), is_los_downwards(), ARTS::Var::lat_grid(), plevel_angletilt(), plevel_slope_2d(), ARTS::Var::Ppath::pos(), ARTS::Var::ppath(), refell2r(), ARTS::Var::refellipsoid(), rsurf_at_lat(), RTOL, ARTS::Var::z_field(), and ARTS::Var::z_surface().
Referenced by ppath_step_geom_2d(), and ppath_step_refr_2d().
void ppath_start_3d | ( | Numeric & | r_start, |
Numeric & | lat_start, | ||
Numeric & | lon_start, | ||
Numeric & | za_start, | ||
Numeric & | aa_start, | ||
Index & | ip, | ||
Index & | ilat, | ||
Index & | ilon, | ||
Numeric & | lat1, | ||
Numeric & | lat3, | ||
Numeric & | lon5, | ||
Numeric & | lon6, | ||
Numeric & | r15a, | ||
Numeric & | r35a, | ||
Numeric & | r36a, | ||
Numeric & | r16a, | ||
Numeric & | r15b, | ||
Numeric & | r35b, | ||
Numeric & | r36b, | ||
Numeric & | r16b, | ||
Numeric & | rsurface15, | ||
Numeric & | rsurface35, | ||
Numeric & | rsurface36, | ||
Numeric & | rsurface16, | ||
Ppath & | ppath, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstTensor3View | z_field, | ||
ConstVectorView | refellipsoid, | ||
ConstMatrixView | z_surface | ||
) |
Internal help function for 3D path calculations.
The function does the asserts and determined some variables that are common for geometrical and refraction calculations.
See the code for details.
Definition at line 1951 of file ppath.cc.
References abs, gridpos(), gridpos2gridrange(), is_gridpos_at_index_i(), ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), plevel_angletilt(), plevel_slope_3d(), ARTS::Var::Ppath::pos(), ARTS::Var::ppath(), refell2r(), ARTS::Var::refellipsoid(), and ARTS::Var::z_field().
Referenced by ppath_step_geom_3d(), and ppath_step_refr_3d().
void ppath_start_stepping | ( | Ppath & | ppath, |
const Index & | atmosphere_dim, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstTensor3View | z_field, | ||
ConstVectorView | refellipsoid, | ||
ConstMatrixView | z_surface, | ||
const Index & | cloudbox_on, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
const bool & | outside_cloudbox, | ||
ConstVectorView | rte_pos, | ||
ConstVectorView | rte_los, | ||
const Verbosity & | verbosity | ||
) |
Initiates a Ppath structure for calculation of a path with ppath_step.
The function performs two main tasks. As mentioned above, it initiates a Ppath structure (a), but it also checks that the end point of the path is at an allowed location (b).
(a): The Ppath structure is set to hold the position and LOS of the last point of the path inside the atmosphere. This point is either the sensor position, or the point where the path leaves the model atmosphere. If the path is totally outside the atmosphere, no point is put into the structure. If the (practical) end and start points are identical, such as when the sensor is inside the cloud box, the background field is set.
(b): If it is found that the end point of the path is at an illegal position a detailed error message is given. Not allowed cases are:
All input variables are identical with the WSV with the same name. The output variable is here called ppath for simplicity, but is in fact ppath_step.
[in] | ppath | Output: A Ppath structure. |
[in] | atmosphere_dim | The atmospheric dimensionality. |
[in] | p_grid | The pressure grid. |
[in] | lat_grid | The latitude grid. |
[in] | lon_grid | The longitude grid. |
[in] | z_field | The field of geometrical altitudes. |
[in] | refellipsoid | As the WSV with the same name. |
[in] | z_surface | Surface altitude. |
[in] | cloudbox_on | Flag to activate the cloud box. |
[in] | cloudbox_limits | Index limits of the cloud box. |
[in] | ppath_inside_cloudbox_do | As the WSV with the same name. |
[in] | rte_pos | The position of the sensor. |
[in] | rte_los | The line-of-sight of the sensor. |
Definition at line 4495 of file ppath.cc.
References abs, ARTS::Var::atmosphere_dim(), cart2poslos(), ARTS::Var::cloudbox_limits(), ARTS::Var::cloudbox_on(), CREATE_OUT1, DEBUG_ONLY, dx, fractional_gp(), geometrical_ppc(), geompath_l_at_r(), geompath_lat_at_za(), geompath_za_at_r(), gridpos(), gridpos_check_fd(), gridpos_copy(), interp(), interpweights(), is_los_downwards(), joker, L_NOT_FOUND, LACC, ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), ARTS::Var::p_grid(), plevel_angletilt(), plevel_slope_2d(), plevel_slope_3d(), ARTS::Var::Ppath::pos(), poslos2cart(), ARTS::Var::ppath(), ppath_init_structure(), ARTS::Var::ppath_inside_cloudbox_do(), ppath_set_background(), r_crossing_2d(), r_crossing_3d(), refell2d(), refell2r(), ARTS::Var::refellipsoid(), resolve_lon(), ARTS::Var::rte_los(), ARTS::Var::rte_pos(), rte_pos2gridpos(), RTOL, ARTS::Var::x(), ARTS::Var::y(), ARTS::Var::z_field(), and ARTS::Var::z_surface().
Referenced by mcPathTraceRadar(), and ppath_calc().
void ppath_step_geom_1d | ( | Ppath & | ppath, |
ConstVectorView | z_field, | ||
ConstVectorView | refellipsoid, | ||
const Numeric & | z_surface, | ||
const Numeric & | lmax | ||
) |
Calculates 1D geometrical propagation path steps.
This is the core function to determine 1D propagation path steps by pure geometrical calculations. Path points are included for crossings with the grids, tangent points and points of intersection with the surface. In addition, points are included in the propgation path to ensure that the distance along the path between the points does not exceed the selected maximum length (lmax). If lmax is <= 0, this means that no length criterion shall be applied.
Note that the input variables are here compressed to only hold data for a 1D atmosphere. For example, z_field is z_field(:,0,0).
For more information read the chapter on propagation paths in AUG.
[in] | ppath | Output: A Ppath structure. |
[in] | z_field | Geometrical altitudes corresponding to p_grid. |
[in] | refellipsoid | As the WSV with the same name. |
[in] | z_surface | Surface altitude. |
[in] | lmax | Maximum allowed length between the path points. |
Definition at line 2372 of file ppath.cc.
References do_gridrange_1d(), geometrical_ppc(), ConstVectorView::nelem(), ARTS::Var::ppath(), ppath_end_1d(), ppath_start_1d(), ARTS::Var::refellipsoid(), ARTS::Var::z_field(), and ARTS::Var::z_surface().
Referenced by ppath_stepGeometric().
void ppath_step_geom_2d | ( | Ppath & | ppath, |
ConstVectorView | lat_grid, | ||
ConstMatrixView | z_field, | ||
ConstVectorView | refellipsoid, | ||
ConstVectorView | z_surface, | ||
const Numeric & | lmax | ||
) |
Calculates 2D geometrical propagation path steps.
Works as the same function for 1D, despite that some input arguments are of different type.
[in] | ppath | Output: A Ppath structure. |
[in] | lat_grid | Latitude grid. |
[in] | z_field | Geometrical altitudes |
[in] | refellipsoid | As the WSV with the same name. |
[in] | z_surface | Surface altitudes. |
[in] | lmax | Maximum allowed length between the path points. |
Definition at line 2736 of file ppath.cc.
References do_gridcell_2d_byltest(), geometrical_ppc(), ARTS::Var::lat_grid(), ConstVectorView::nelem(), ARTS::Var::ppath(), ppath_end_2d(), ppath_start_2d(), ARTS::Var::refellipsoid(), ARTS::Var::z_field(), and ARTS::Var::z_surface().
Referenced by ppath_stepGeometric().
void ppath_step_geom_3d | ( | Ppath & | ppath, |
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstTensor3View | z_field, | ||
ConstVectorView | refellipsoid, | ||
ConstMatrixView | z_surface, | ||
const Numeric & | lmax | ||
) |
Calculates 3D geometrical propagation path steps.
Works as the same function for 1D despite that some input arguments are of different type.
[in] | ppath | Output: A Ppath structure. |
[in] | lat_grid | Latitude grid. |
[in] | lon_grid | Longitude grid. |
[in] | z_field | Geometrical altitudes |
[in] | refellipsoid | As the WSV with the same name. |
[in] | z_surface | Surface altitudes. |
[in] | lmax | Maximum allowed length between the path points. |
Definition at line 3270 of file ppath.cc.
References do_gridcell_3d_byltest(), geometrical_ppc(), ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), ConstVectorView::nelem(), ARTS::Var::ppath(), ppath_end_3d(), ppath_start_3d(), ARTS::Var::refellipsoid(), ARTS::Var::z_field(), and ARTS::Var::z_surface().
Referenced by ppath_stepGeometric().
void ppath_step_refr_1d | ( | Workspace & | ws, |
Ppath & | ppath, | ||
ConstVectorView | p_grid, | ||
ConstTensor3View | z_field, | ||
ConstTensor3View | t_field, | ||
ConstTensor4View | vmr_field, | ||
ConstVectorView | f_grid, | ||
ConstVectorView | refellipsoid, | ||
const Numeric & | z_surface, | ||
const Numeric & | lmax, | ||
const Agenda & | refr_index_agenda, | ||
const String & | rtrace_method, | ||
const Numeric & | lraytrace | ||
) |
Calculates 1D propagation path steps including effects of refraction.
This function works as the function ppath_step_geom_1d but considers also refraction. The upper length of the ray tracing steps is set by the argument lraytrace. This argument controls only the internal calculations. The maximum distance between the path points is still determined by lmax.
[in,out] | ws | Current Workspace |
[out] | ppath | A Ppath structure. |
[in] | p_grid | Pressure grid. |
[in] | z_field | As the WSV with the same name. |
[in] | t_field | As the WSV with the same name. |
[in] | vmr_field | As the WSV with the same name. |
[in] | f_grid | As the WSV with the same name. |
[in] | refellipsoid | As the WSV with the same name. |
[in] | z_surface | Surface altitude (1D). |
[in] | lmax | Maximum allowed length between the path points. |
[in] | refr_index_air_agenda | The WSV with the same name. |
[in] | rtrace_method | String giving which ray tracing method to use. See the function for options. |
[in] | lraytrace | Maximum allowed length for ray tracing steps. |
Definition at line 3576 of file ppath.cc.
References ARTS::Var::f_grid(), get_refr_index_1d(), joker, Array< base >::nelem(), ARTS::Var::p_grid(), ARTS::Var::ppath(), ppath_end_1d(), ppath_start_1d(), raytrace_1d_linear_basic(), ARTS::Var::refellipsoid(), ARTS::Var::refr_index_air(), ARTS::Var::refr_index_air_agenda(), ARTS::Var::refr_index_air_group(), refraction_ppc(), ARTS::Var::t_field(), ARTS::Var::vmr_field(), ARTS::Var::z_field(), and ARTS::Var::z_surface().
Referenced by ppath_stepRefractionBasic().
void ppath_step_refr_2d | ( | Workspace & | ws, |
Ppath & | ppath, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstTensor3View | z_field, | ||
ConstTensor3View | t_field, | ||
ConstTensor4View | vmr_field, | ||
ConstVectorView | f_grid, | ||
ConstVectorView | refellipsoid, | ||
ConstVectorView | z_surface, | ||
const Numeric & | lmax, | ||
const Agenda & | refr_index_agenda, | ||
const String & | rtrace_method, | ||
const Numeric & | lraytrace | ||
) |
Calculates 2D propagation path steps, with refraction, using a simple and fast ray tracing scheme.
Works as the same function for 1D despite that some input arguments are of different type.
[in,out] | ws | Current Workspace |
[out] | ppath | A Ppath structure. |
[in] | p_grid | Pressure grid. |
[in] | lat_grid | Latitude grid. |
[in] | z_field | As the WSV with the same name. |
[in] | t_field | As the WSV with the same name. |
[in] | vmr_field | As the WSV with the same name. |
[in] | f_grid | As the WSV with the same name. |
[in] | refellipsoid | As the WSV with the same name. |
[in] | z_surface | Surface altitudes. |
[in] | lmax | Maximum allowed length between the path points. |
[in] | refr_index_air_agenda | The WSV with the same name. |
[in] | rtrace_method | String giving which ray tracing method to use. See the function for options. |
[in] | lraytrace | Maximum allowed length for ray tracing steps. |
Definition at line 3920 of file ppath.cc.
References ARTS::Var::f_grid(), joker, ARTS::Var::lat_grid(), Array< base >::nelem(), ARTS::Var::p_grid(), ARTS::Var::ppath(), ppath_end_2d(), ppath_start_2d(), raytrace_2d_linear_basic(), ARTS::Var::refellipsoid(), ARTS::Var::refr_index_air_agenda(), ARTS::Var::t_field(), ARTS::Var::vmr_field(), ARTS::Var::z_field(), and ARTS::Var::z_surface().
Referenced by ppath_stepRefractionBasic().
void ppath_step_refr_3d | ( | Workspace & | ws, |
Ppath & | ppath, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstTensor3View | z_field, | ||
ConstTensor3View | t_field, | ||
ConstTensor4View | vmr_field, | ||
ConstVectorView | f_grid, | ||
ConstVectorView | refellipsoid, | ||
ConstMatrixView | z_surface, | ||
const Numeric & | lmax, | ||
const Agenda & | refr_index_agenda, | ||
const String & | rtrace_method, | ||
const Numeric & | lraytrace | ||
) |
Calculates 3D propagation path steps, with refraction, using a simple and fast ray tracing scheme.
Works as the same function for 1D despite that some input arguments are of different type.
[in,out] | ws | Current Workspace |
[out] | ppath | A Ppath structure. |
[in] | p_grid | Pressure grid. |
[in] | lat_grid | Latitude grid. |
[in] | lon_grid | Longitude grid. |
[in] | z_field | Geometrical altitudes. |
[in] | t_field | Atmospheric temperatures. |
[in] | vmr_field | VMR values. |
[in] | f_grid | As the WSV with the same name. |
[in] | refellipsoid | As the WSV with the same name. |
[in] | z_surface | Surface altitudes. |
[in] | lmax | Maximum allowed length between the path points. |
[in] | refr_index_air_agenda | The WSV with the same name. |
[in] | rtrace_method | String giving which ray tracing method to use. See the function for options. |
[in] | lraytrace | Maximum allowed length for ray tracing steps. |
Definition at line 4335 of file ppath.cc.
References ARTS::Var::f_grid(), ARTS::Var::lat_grid(), ARTS::Var::lon_grid(), Array< base >::nelem(), ARTS::Var::p_grid(), ARTS::Var::ppath(), ppath_end_3d(), ppath_start_3d(), raytrace_3d_linear_basic(), ARTS::Var::refellipsoid(), ARTS::Var::refr_index_air_agenda(), ARTS::Var::t_field(), ARTS::Var::vmr_field(), ARTS::Var::z_field(), and ARTS::Var::z_surface().
Referenced by ppath_stepRefractionBasic().
Returns the case number for the radiative background.
See further the function ppath_set_background.
[in] | ppath | A Ppath structure. |
Definition at line 1494 of file ppath.cc.
References ARTS::Var::ppath().
Referenced by defocusing_general_sub(), defocusing_sat2sat(), get_iy_of_background(), iyActiveSingleScat(), iyActiveSingleScat2(), iyEmissionStandard(), iyEmissionStandardSequential(), iyHybrid(), iyHybrid2(), iyTransmissionStandard(), mcPathTraceRadar(), ppath_append(), ppath_calc(), ppath_stepGeometric(), ppath_stepRefractionBasic(), and ppathFromRtePos2().
void r_crossing_2d | ( | Numeric & | lat, |
Numeric & | l, | ||
const Numeric & | r_hit, | ||
const Numeric & | r_start, | ||
const Numeric & | lat_start, | ||
const Numeric & | za_start, | ||
const Numeric & | ppc | ||
) |
Calculates where a 2D LOS crosses the specified radius.
The function only looks for crossings in the forward direction of the given zenith angle (neglecting all solutions giving l <= 0).
For cases with r_start <= r_hit and abs(za) > 90, the tangent point is passed and the returned crossing is on the other side of the tangent point.
LAT_NOT_FOUND and L_NOT_FOUND are returned if no solution is found.
[out] | r | Radius of found crossing. |
[out] | lat | Latitude of found crossing. |
[out] | l | Length along the path to the crossing. |
[in] | r_hit | Radius of the level |
[in] | r_start | Radius of start point. |
[in] | lat_start | Latitude of start point. |
[in] | za_start | Zenith angle at start point. |
[in] | ppc | Propagation path constant |
Definition at line 671 of file ppath.cc.
References abs, geompath_l_at_r(), geompath_lat_at_za(), geompath_za_at_r(), L_NOT_FOUND, ARTS::Var::lat(), LAT_NOT_FOUND, and sign().
Referenced by ppath_start_stepping().
void r_crossing_3d | ( | Numeric & | lat, |
Numeric & | lon, | ||
Numeric & | l, | ||
const Numeric & | r_hit, | ||
const Numeric & | r_start, | ||
const Numeric & | lat_start, | ||
const Numeric & | lon_start, | ||
const Numeric & | za_start, | ||
const Numeric & | ppc, | ||
const Numeric & | x, | ||
const Numeric & | y, | ||
const Numeric & | z, | ||
const Numeric & | dx, | ||
const Numeric & | dy, | ||
const Numeric & | dz | ||
) |
Calculates where a 3D LOS crosses the specified radius.
The solution algorithm is described in ATD. See the chapter on propagation paths.
The function only looks for crossings in the forward direction of the given zenith angle (neglecting all solutions giving l <= 0). Note that the tangent point can be passed.
LAT_NOT_FOUND, LON_NOT_FOUND and L_NOT_FOUND are returned if no solution is found.
[out] | lat | Latitude of found crossing. |
[out] | lon | Longitude of found crossing. |
[out] | l | Length along the path to the crossing. |
[in] | r_hit | Target radius. |
[in] | r_start | Radius of start point. |
[in] | lat_start | Latitude of start point. |
[in] | lon_start | Longitude of start point. |
[in] | za_start | Zenith angle at start point. |
[in] | ppc | Propagation path constant |
[in] | x | x-coordinate of start position. |
[in] | y | y-coordinate of start position. |
[in] | z | z-coordinate of start position. |
[in] | dx | x-part of LOS unit vector. |
[in] | dy | y-part of LOS unit vector. |
[in] | dz | z-part of LOS unit vector. |
Definition at line 1360 of file ppath.cc.
References abs, ANGTOL, dx, L_NOT_FOUND, ARTS::Var::lat(), LAT_NOT_FOUND, ARTS::Var::lon(), LON_NOT_FOUND, max, min, q, sqrt(), ARTS::Var::x(), and ARTS::Var::y().
Referenced by ppath_start_stepping().
void raytrace_1d_linear_basic | ( | Workspace & | ws, |
Array< Numeric > & | r_array, | ||
Array< Numeric > & | lat_array, | ||
Array< Numeric > & | za_array, | ||
Array< Numeric > & | l_array, | ||
Array< Numeric > & | n_array, | ||
Array< Numeric > & | ng_array, | ||
Index & | endface, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | refellipsoid, | ||
ConstTensor3View | z_field, | ||
ConstTensor3View | t_field, | ||
ConstTensor4View | vmr_field, | ||
ConstVectorView | f_grid, | ||
const Numeric & | lmax, | ||
const Agenda & | refr_index_air_agenda, | ||
const Numeric & | lraytrace, | ||
const Numeric & | rsurface, | ||
const Numeric & | r1, | ||
const Numeric & | r3, | ||
Numeric | r, | ||
Numeric | lat, | ||
Numeric | za | ||
) |
Performs ray tracing for 1D with linear steps.
A geometrical step with length of lraytrace is taken from each point. The zenith angle for the end point of that step is calculated considering the gradient of the refractive index. The length of the last ray tracing step is set to the distance to grid box boundary.
For more information read the chapter on propagation paths in AUG. The algorithm used is described in that part of ATD.
[in,out] | ws | Current Workspace |
[out] | r_array | Radius of ray tracing points. |
[out] | lat_array | Latitude of ray tracing points. |
[out] | za_array | LOS zenith angle at ray tracing points. |
[out] | l_array | Distance along the path between ray tracing point |
[out] | n_array | Refractive index at ray tracing points. |
[out] | endface | Number coding of exit face. |
[in] | p_grid | The WSV with the same name. |
[in] | refellipsoid | The WSV with the same name. |
[in] | lat_grid | The WSV with the same name. |
[in] | z_field | The WSV with the same name. |
[in] | t_field | The WSV with the same name. |
[in] | vmr_field | The WSV with the same name. |
[in] | f_grid | As the WSV with the same name. |
[in] | lmax | As the WSV ppath_lmax |
[in] | refr_index_air_agenda | The WSV with the same name. |
[in] | lraytrace | Maximum allowed length for ray tracing steps. |
[in] | r_surface | Radius of the surface. |
[in] | r1 | Radius of lower pressure level. |
[in] | r3 | Radius of upper pressure level (r3 > r1). |
[in] | r | Start radius for ray tracing. |
[in] | lat | Start latitude for ray tracing. |
[in] | za | Start zenith angle for ray tracing. |
Definition at line 3432 of file ppath.cc.
References DEG2RAD, do_gridrange_1d(), ARTS::Var::f_grid(), geometrical_ppc(), geompath_l_at_r(), geompath_lat_at_za(), geompath_r_at_l(), geompath_za_at_r(), get_refr_index_1d(), ARTS::Var::lat(), ConstVectorView::nelem(), ARTS::Var::p_grid(), RAD2DEG, ARTS::Var::refellipsoid(), refr_gradients_1d(), ARTS::Var::refr_index_air(), ARTS::Var::refr_index_air_agenda(), ARTS::Var::refr_index_air_group(), ARTS::Var::t_field(), ARTS::Var::vmr_field(), and ARTS::Var::z_field().
Referenced by ppath_step_refr_1d().
void raytrace_2d_linear_basic | ( | Workspace & | ws, |
Array< Numeric > & | r_array, | ||
Array< Numeric > & | lat_array, | ||
Array< Numeric > & | za_array, | ||
Array< Numeric > & | l_array, | ||
Array< Numeric > & | n_array, | ||
Array< Numeric > & | ng_array, | ||
Index & | endface, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | refellipsoid, | ||
ConstTensor3View | z_field, | ||
ConstTensor3View | t_field, | ||
ConstTensor4View | vmr_field, | ||
ConstVectorView | f_grid, | ||
const Numeric & | lmax, | ||
const Agenda & | refr_index_air_agenda, | ||
const Numeric & | lraytrace, | ||
const Numeric & | lat1, | ||
const Numeric & | lat3, | ||
const Numeric & | rsurface1, | ||
const Numeric & | rsurface3, | ||
const Numeric & | r1a, | ||
const Numeric & | r3a, | ||
const Numeric & | r3b, | ||
const Numeric & | r1b, | ||
Numeric | r, | ||
Numeric | lat, | ||
Numeric | za | ||
) |
Performs ray tracing for 2D with linear steps.
A geometrical step with length of lraytrace is taken from each point. The zenith angle for the end point of that step is calculated considering the gradient of the refractive index. The length of the last ray tracing step is set to the distance to grid box boundary.
For more information read the chapter on propagation paths in AUG. The algorithm used is described in that part of ATD.
[in,out] | ws | Current Workspace |
[out] | r_array | Radius of ray tracing points. |
[out] | lat_array | Latitude of ray tracing points. |
[out] | za_array | LOS zenith angle at ray tracing points. |
[out] | l_array | Distance along the path between ray tracing points |
[out] | n_array | Refractive index at ray tracing points. |
[out] | endface | Number coding of exit face. |
[in] | p_grid | The WSV with the same name. |
[in] | lat_grid | The WSV with the same name. |
[in] | refellipsoid | The WSV with the same name. |
[in] | z_field | The WSV with the same name. |
[in] | t_field | The WSV with the same name. |
[in] | vmr_field | The WSV with the same name. |
[in] | f_grid | As the WSV with the same name. |
[in] | lmax | As the WSV ppath_lmax |
[in] | refr_index_air_agenda | The WSV with the same name. |
[in] | lraytrace | Maximum allowed length for ray tracing steps. |
[in] | lat1 | Latitude of left end face of the grid cell. |
[in] | lat3 | Latitude of right end face of the grid cell. |
[in] | rsurface1 | Radius for the surface at lat1. |
[in] | rsurface3 | Radius for the surface at lat3. |
[in] | r1a | Radius of lower-left corner of the grid cell. |
[in] | r3a | Radius of lower-right corner of the grid cell. |
[in] | r3b | Radius of upper-right corner of the grid cell. |
[in] | r1b | Radius of upper-left corner of the grid cell. |
[in] | r | Start radius for ray tracing. |
[in] | lat | Start latitude for ray tracing. |
[in] | za | Start zenith angle for ray tracing. |
Definition at line 3738 of file ppath.cc.
References abs, DEG2RAD, do_gridcell_2d_byltest(), ARTS::Var::f_grid(), geometrical_ppc(), geompath_l_at_r(), geompath_lat_at_za(), geompath_r_at_l(), geompath_za_at_r(), get_refr_index_2d(), ARTS::Var::lat(), ARTS::Var::lat_grid(), ConstVectorView::nelem(), ARTS::Var::p_grid(), RAD2DEG, ARTS::Var::refellipsoid(), refr_gradients_2d(), ARTS::Var::refr_index_air(), ARTS::Var::refr_index_air_agenda(), ARTS::Var::refr_index_air_group(), sign(), ARTS::Var::t_field(), ARTS::Var::vmr_field(), and ARTS::Var::z_field().
Referenced by ppath_step_refr_2d().
void raytrace_3d_linear_basic | ( | Workspace & | ws, |
Array< Numeric > & | r_array, | ||
Array< Numeric > & | lat_array, | ||
Array< Numeric > & | lon_array, | ||
Array< Numeric > & | za_array, | ||
Array< Numeric > & | aa_array, | ||
Array< Numeric > & | l_array, | ||
Array< Numeric > & | n_array, | ||
Array< Numeric > & | ng_array, | ||
Index & | endface, | ||
ConstVectorView | refellipsoid, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstTensor3View | z_field, | ||
ConstTensor3View | t_field, | ||
ConstTensor4View | vmr_field, | ||
ConstVectorView | f_grid, | ||
const Numeric & | lmax, | ||
const Agenda & | refr_index_air_agenda, | ||
const Numeric & | lraytrace, | ||
const Numeric & | lat1, | ||
const Numeric & | lat3, | ||
const Numeric & | lon5, | ||
const Numeric & | lon6, | ||
const Numeric & | rsurface15, | ||
const Numeric & | rsurface35, | ||
const Numeric & | rsurface36, | ||
const Numeric & | rsurface16, | ||
const Numeric & | r15a, | ||
const Numeric & | r35a, | ||
const Numeric & | r36a, | ||
const Numeric & | r16a, | ||
const Numeric & | r15b, | ||
const Numeric & | r35b, | ||
const Numeric & | r36b, | ||
const Numeric & | r16b, | ||
Numeric | r, | ||
Numeric | lat, | ||
Numeric | lon, | ||
Numeric | za, | ||
Numeric | aa | ||
) |
Performs ray tracing for 3D with linear steps.
A geometrical step with length of lraytrace is taken from each point. The zenith angle for the end point of that step is calculated considering the gradient of the refractive index. The length of the last ray tracing step is set to the distance to grid box boundary.
For more information read the chapter on propagation paths in AUG. The algorithm used is described in that part of ATD.
[in,out] | ws | Current Workspace |
[out] | r_array | Radius of ray tracing points. |
[out] | lat_array | Latitude of ray tracing points. |
[out] | lon_array | Longitude of ray tracing points. |
[out] | za_array | LOS zenith angle at ray tracing points. |
[out] | aa_array | LOS azimuth angle at ray tracing points. |
[out] | l_array | Distance along the path between ray tracing points. |
[out] | endface | Number coding of exit face. |
[out] | n_array | Refractive index at ray tracing points. |
[in] | lmax | As the WSV ppath_lmax |
[in] | refr_index_air_agenda | The WSV with the same name. |
[in] | lraytrace | Maximum allowed length for ray tracing steps. |
[in] | refellipsoid | The WSV with the same name. |
[in] | p_grid | The WSV with the same name. |
[in] | lat_grid | The WSV with the same name. |
[in] | lon_grid | The WSV with the same name. |
[in] | z_field | The WSV with the same name. |
[in] | t_field | The WSV with the same name. |
[in] | vmr_field | The WSV with the same name. |
[in] | f_grid | As the WSV with the same name. |
[in] | lat1 | Latitude of left end face of the grid cell. |
[in] | lat3 | Latitude of right end face of the grid cell. |
[in] | lon5 | Lower longitude of the grid cell. |
[in] | lon6 | Upper longitude of the grid cell. |
[in] | rsurface15 | Radius for the surface at lat1 and lon5. |
[in] | rsurface35 | Radius for the surface at lat3 and lon5. |
[in] | rsurface36 | Radius for the surface at lat3 and lon6. |
[in] | rsurface16 | Radius for the surface at lat1 and lon6. |
[in] | r15a | Radius of corner: lower p-level,lat1 and lon5. |
[in] | r35a | Radius of corner: lower p-level,lat3 and lon5. |
[in] | r36a | Radius of corner: lower p-level,lat3 and lon6. |
[in] | r16a | Radius of corner: lower p-level,lat1 and lon6. |
[in] | r15b | Radius of corner: upper p-level,lat1 and lon5. |
[in] | r35b | Radius of corner: upper p-level,lat3 and lon5. |
[in] | r36b | Radius of corner: upper p-level,lat3 and lon6. |
[in] | r16b | Radius of corner: upper p-level,lat1 and lon6. |
[in] | r | Out: Start radius for ray tracing. |
[in] | lat | Out: Start latitude for ray tracing. |
[in] | lon | Out: Start longitude for ray tracing. |
[in] | za | Out: Start zenith angle for ray tracing. |
[in] | aa | Out: Start azimuth angle for ray tracing. |
Definition at line 4095 of file ppath.cc.
References abs, adjust_los(), ANGTOL, cart2poslos(), DEG2RAD, do_gridcell_3d_byltest(), dx, ARTS::Var::f_grid(), geometrical_ppc(), get_refr_index_3d(), ARTS::Var::lat(), ARTS::Var::lat_grid(), ARTS::Var::lon(), ARTS::Var::lon_grid(), ConstVectorView::nelem(), ARTS::Var::p_grid(), poslos2cart(), RAD2DEG, ARTS::Var::refellipsoid(), refr_gradients_3d(), ARTS::Var::refr_index_air(), ARTS::Var::refr_index_air_agenda(), ARTS::Var::refr_index_air_group(), resolve_lon(), ARTS::Var::t_field(), ARTS::Var::vmr_field(), ARTS::Var::x(), ARTS::Var::y(), and ARTS::Var::z_field().
Referenced by ppath_step_refr_3d().
Calculates the propagation path constant for cases with refraction.
Both positive and negative zenith angles are handled.
[in] | r | Radius. |
[in] | za | LOS Zenith angle. |
[in] | refr_index_air | Refractive index. |
Definition at line 506 of file ppath.cc.
References abs, DEG2RAD, and ARTS::Var::refr_index_air().
Referenced by ppath_step_refr_1d().
Resolves which longitude angle that shall be used.
Longitudes are allowed to vary between -360 and 360 degress, while the inverse trigonomtric functions returns values between -180 and 180. This function determines if the longitude shall be shifted -360 or +360 to fit the longitudes set by the user.
The argument lon as input is a value calculated by some inverse trigonometric function. The arguments lon5 and lon6 are the lower and upper limit for the probable range for lon. The longitude lon* will be shifted with -360 or +360 degrees if lon is significantly outside lon5 and lon6. No error is given if it is not possible to obtain a value between lon5 and lon6.
[in,out] | lon | Longitude, possible shifted when returned. |
[in] | lon5 | Lower limit of probable range for lon. |
[in] | lon6 | Upper limit of probable range for lon |
Definition at line 515 of file ppath.cc.
References ARTS::Var::lon().
Referenced by do_gridcell_3d_byltest(), ppath_start_stepping(), raytrace_3d_linear_basic(), and surfaceFastem().
void rotationmat3D | ( | Matrix & | R, |
ConstVectorView | vrot, | ||
const Numeric & | a | ||
) |
Creates a 3D rotation matrix.
Creates a rotation matrix such that R * x, operates on x by rotating x around the origin a radians around line connecting the origin to the point vrot.
The function is based on rotationmat3D.m, by Belechi (the function is found in atmlab).
[out] | R | Rotation matrix |
[in] | vrot | Rotation axis |
[in] | a | Rotation angle |
Numeric rslope_crossing2d | ( | const Numeric & | rp, |
const Numeric & | za, | ||
const Numeric & | r0, | ||
Numeric | c1 | ||
) |
Calculates the angular distance to a crossing with a level having a radial slope.
The function solves the problem for a pressure level, or the planet's surface, where the radius changes linearly as a function of angle. No analytical solution to the original problem has been found. The problem involves sine and cosine of the latitude difference and these functions are replaced with their Taylor expansions where the two first terms are kept. This should be OK for most practical situations (the accuracy should be sufficient for values up to 1 degree?).
The problem and its solution is further described in AUG. See the chapter on propagation paths. The variable names below are the same as in AUG.
Both positive and negative zenith angles are handled.
The function only looks for crossings in the forward direction of the given zenith angle.
If the given path point is on the pressure level (rp=r0), the solution 0 is rejected. The latitude difference is set to 999 if no crossing exists.
The cases c=0, za=0 and za=180 are not allowed.
[in] | rp | Radius of a point of the path inside the grid cell |
[in] | za | Zenith angle of the path at rp. |
[in] | r0 | Radius of the pressure level or the surface at the latitude of rp. |
[in] | c1 | Linear slope term, as returned by plevel_slope_2d. |
Definition at line 742 of file ppath.cc.
References abs, beta, DEG2RAD, dmin, poly_root_solve(), RAD2DEG, and Matrix::resize().
Numeric rslope_crossing3d | ( | const Numeric & | rp, |
const Numeric & | za, | ||
const Numeric & | r0, | ||
Numeric | c1, | ||
Numeric | c2 | ||
) |
3D version of rslope_crossing2d.
[in] | rp | Radius of a point of the path inside the grid cell |
[in] | za | Zenith angle of the path at rp. |
[in] | r0 | Radius of the pressure level or the surface at the latitude of rp. |
[in] | c1 | Linear slope term, as returned by plevel_slope_3d. |
[in] | c2 | Quadratic slope term, as returned by plevel_slope_3d. |
Definition at line 1236 of file ppath.cc.
References abs, beta, DEG2RAD, dmin, poly_root_solve(), RAD2DEG, and Matrix::resize().
Numeric rsurf_at_lat | ( | const Numeric & | lat1, |
const Numeric & | lat3, | ||
const Numeric & | r1, | ||
const Numeric & | r3, | ||
const Numeric & | lat | ||
) |
Determines the radius of a pressure level or the surface given the radius at the corners of a 2D grid cell.
[in] | lat1 | Lower latitude of grid cell. |
[in] | lat3 | Upper latitude of grid cell. |
[in] | r1 | Radius at lat1 |
[in] | r3 | Radius at lat3 |
[in] | lat | Latitude for which radius shall be determined. |
Definition at line 587 of file ppath.cc.
References ARTS::Var::lat().
Referenced by do_gridcell_2d_byltest(), plevel_crossing_2d(), and ppath_start_2d().
Numeric rsurf_at_latlon | ( | 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 | ||
) |
Determines the radius of a pressure level or the surface given the radius at the corners of a 3D grid cell.
[in] | lat1 | Lower latitude of grid cell. |
[in] | lat3 | Upper latitude of grid cell. |
[in] | lon5 | Lower longitude of grid cell. |
[in] | lon6 | Upper longitude of grid cell. |
[in] | r15 | Radius at crossing of lat1 and lon5. |
[in] | r35 | Radius at crossing of lat3 and lon5. |
[in] | r36 | Radius at crossing of lat3 and lon6. |
[in] | r16 | Radius at crossing of lat1 and lon6. |
[in] | lat | Latitude for which radius shall be determined. |
[in] | lon | Longitude for which radius shall be determined. |
Definition at line 1055 of file ppath.cc.
References ARTS::Var::lat(), and ARTS::Var::lon().
Referenced by do_gridcell_3d_byltest(), plevel_slope_3d(), and ppath_end_3d().
Converts zenith and azimuth angles to a cartesian unit vector.
This function and the sister function cart2zaaa handles transformation of line-of-sights. This in contrast to the sph/poslos functions that handles positions, or combinations of positions and line-of-sight.
The cartesian coordinate system used for these two functions can be defined as z : za = 0 x : za=90, aa=0 y : za=90, aa=90
[out] | dx | x-part of LOS unit vector. |
[out] | dy | y-part of LOS unit vector. |
[out] | dz | z-part of LOS unit vector. |
[in] | za | LOS zenith angle at observation position. |
[in] | aa | LOS azimuth angle at observation position. |
Definition at line 347 of file ppath.cc.
Referenced by add_za_aa(), adjust_los(), diff_za_aa(), and specular_losCalc().
|
extern |
const Numeric L_NOT_FOUND = 99e99 |
Definition at line 76 of file ppath.cc.
Referenced by plevel_crossing_2d(), ppath_start_stepping(), r_crossing_2d(), and r_crossing_3d().
const Numeric LACC = 1e-5 |
Definition at line 72 of file ppath.cc.
Referenced by do_gridcell_2d_byltest(), do_gridcell_3d_byltest(), and ppath_start_stepping().
const Numeric LAT_NOT_FOUND = 99e99 |
Definition at line 77 of file ppath.cc.
Referenced by plevel_crossing_2d(), r_crossing_2d(), and r_crossing_3d().
const Numeric LON_NOT_FOUND = 99e99 |
Definition at line 78 of file ppath.cc.
Referenced by r_crossing_3d().
const Numeric R_NOT_FOUND = -1 |
Definition at line 75 of file ppath.cc.
Referenced by plevel_crossing_2d().
|
extern |
const Numeric RTOL = 1e-3 |
Definition at line 64 of file ppath.cc.
Referenced by do_gridcell_2d_byltest(), do_gridcell_3d_byltest(), do_gridrange_1d(), geompath_l_at_r(), geompath_za_at_r(), ppath_start_2d(), and ppath_start_stepping().