ARTS
2.0.49
|
Functions releated to calculation of propagation paths. More...
#include <cmath>
#include <stdexcept>
#include "agenda_class.h"
#include "array.h"
#include "arts_omp.h"
#include "auto_md.h"
#include "check_input.h"
#include "math_funcs.h"
#include "messages.h"
#include "mystring.h"
#include "logic.h"
#include "poly_roots.h"
#include "ppath.h"
#include "refraction.h"
#include "special_interp.h"
Go to the source code of this file.
Functions | |
double | geometrical_ppc (const double &r, const double &za) |
geometrical_ppc More... | |
double | geompath_za_at_r (const double &ppc, const double &a_za, const double &r) |
geompath_za_at_r More... | |
double | geompath_r_at_za (const double &ppc, const double &za) |
geompath_r_at_za More... | |
double | geompath_lat_at_za (const double &za0, const double &lat0, const double &za) |
geompath_lat_at_za More... | |
double | geompath_l_at_r (const double &ppc, const double &r) |
geompath_l_at_r More... | |
double | geompath_r_at_l (const double &ppc, const double &l) |
geompath_r_at_l More... | |
double | geompath_r_at_lat (const double &ppc, const double &lat0, const double &za0, const double &lat) |
geompath_r_at_lat More... | |
void | geompath_from_r1_to_r2 (Vector &r, Vector &lat, Vector &za, double &lstep, const double &ppc, const double &r1, const double &lat1, const double &za1, const double &r2, const double &lmax) |
geompath_from_r1_to_r2 More... | |
double | za_geom2other_point (const double &r1, const double &lat1, const double &r2, const double &lat2) |
za_geom2other_point More... | |
void | sph2cart (double &x, double &y, double &z, const double &r, const double &lat, const double &lon) |
sph2cart More... | |
void | cart2sph (double &r, double &lat, double &lon, const double &x, const double &y, const double &z) |
cart2sph More... | |
void | poslos2cart (double &x, double &y, double &z, double &dx, double &dy, double &dz, const double &r, const double &lat, const double &lon, const double &za, const double &aa) |
poslos2cart More... | |
void | cart2poslos (double &r, double &lat, double &lon, double &za, double &aa, const double &x, const double &y, const double &z, const double &dx, const double &dy, const double &dz) |
cart2poslos More... | |
void | resolve_lon (double &lon, const double &lon5, const double &lon6) |
resolve_lon More... | |
void | resolve_lon (float &lon, const double &lon5, const double &lon6) |
void | geompath_tanpos_3d (double &r_tan, double &lat_tan, double &lon_tan, double &l_tan, const double &r, const double &lat, const double &lon, const double &za, const double &aa, const double &ppc) |
geompath_tanpos_3d More... | |
void | zaaa2cart (double &dx, double &dy, double &dz, const double &za, const double &aa) |
zaaa2cart More... | |
void | cart2zaaa (double &za, double &aa, const double &dx, const double &dy, const double &dz) |
cart2zaaa More... | |
void | rotationmat3D (Matrix &R, ConstVectorView vrot, const Numeric &a) |
rotationmat3D More... | |
void | map_daa (double &za, double &aa, const double &za0, const double &aa0, const double &aa_grid) |
double | plevel_slope_2d (ConstVectorView lat_grid, ConstVectorView r_geoid, ConstVectorView z_surf, const GridPos &gp, const double &za) |
plevel_slope_2d More... | |
double | plevel_slope_2d (const double &lat1, const double &lat2, const double &r1, const double &r2) |
plevel_slope_2d More... | |
double | rsurf_at_lat (const double &lat1, const double &lat3, const double &r1, const double &r3, const double &lat) |
rsurf_at_lat More... | |
double | rsurf_at_latlon (const double &lat1, const double &lat3, const double &lon5, const double &lon6, const double &r15, const double &r35, const double &r36, const double &r16, const double &lat, const double &lon) |
rsurf_at_latlon More... | |
double | plevel_slope_3d (const double &lat1, const double &lat3, const double &lon5, const double &lon6, const double &r15, const double &r35, const double &r36, const double &r16, const double &lat, const double &lon, const double &aa) |
plevel_slope_3d More... | |
double | plevel_slope_3d (ConstVectorView lat_grid, ConstVectorView lon_grid, ConstMatrixView r_geoid, ConstMatrixView z_surf, const GridPos &gp_lat, const GridPos &gp_lon, const double &aa) |
plevel_slope_3d More... | |
double | plevel_angletilt (const double &r, const double &c) |
plevel_angletilt More... | |
double | surfacetilt (const Index &atmosphere_dim, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstMatrixView r_geoid, ConstMatrixView z_surface, const GridPos &gp_lat, const GridPos &gp_lon, ConstVectorView los) |
surfacetilt More... | |
bool | is_los_downwards (const double &za, const double &tilt) |
is_los_downwards More... | |
double | plevel_crossing_2d (const double &rp, const double &za, const double &r0, double c) |
plevel_crossing_2d More... | |
void | plevel_crossing_3d (double &r, double &lat, double &lon, double &l, const double r_surf, const double r_start, const double lat_start, const double lon_start, const double za_start, const double &x, const double &y, const double &z, const double &dx, const double &dy, const double &dz) |
plevel_crossing_3d More... | |
void | do_gridrange_1d (Vector &r_v, Vector &lat_v, Vector &za_v, double &lstep, Index &endface, Index &tanpoint, const double &r_start0, const double &lat_start, const double &za_start, const double &ppc, const double &lmax, const double &ra, const double &rb, const double &rsurface) |
do_gridrange_1d More... | |
void | do_gridcell_2d (Vector &r_v, Vector &lat_v, Vector &za_v, double &lstep, Index &endface, Index &tanpoint, const double &r_start0, const double &lat_start, const double &za_start, const double &ppc, const double &lmax, const double &lat1, const double &lat3, const double &r1a, const double &r3a, const double &r3b, const double &r1b, const double &rsurface1, const double &rsurface3) |
do_gridcell_2d More... | |
void | do_gridcell_3d (Vector &r_v, Vector &lat_v, Vector &lon_v, Vector &za_v, Vector &aa_v, double &lstep, Index &endface, Index &tanpoint, const double &r_start0, const double &lat_start0, const double &lon_start0, const double &za_start, const double &aa_start, const double &ppc, const double &lmax, const double &lat1, const double &lat3, const double &lon5, const double &lon6, const double &r15a, const double &r35a, const double &r36a, const double &r16a, const double &r15b, const double &r35b, const double &r36b, const double &r16b, const double &rsurface15, const double &rsurface35, const double &rsurface36, const double &rsurface16) |
do_gridcell_3d More... | |
void | ppath_init_structure (Ppath &ppath, const Index &atmosphere_dim, const Index &np) |
ppath_init_structure More... | |
void | ppath_set_background (Ppath &ppath, const Index &case_nr) |
ppath_set_background More... | |
Index | ppath_what_background (const Ppath &ppath) |
ppath_what_background More... | |
void | ppath_copy (Ppath &ppath1, const Ppath &ppath2) |
ppath_copy More... | |
void | ppath_append (Ppath &ppath1, const Ppath &ppath2) |
ppath_append More... | |
void | ppath_fill_1d (Ppath &ppath, ConstVectorView r, ConstVectorView lat, ConstVectorView za, ConstVectorView lstep, const double &r_geoid, ConstVectorView z_field, const Index &ip) |
ppath_fill_1d More... | |
void | ppath_fill_2d (Ppath &ppath, ConstVectorView r, ConstVectorView lat, ConstVectorView za, const double &lstep, ConstVectorView r_geoid, ConstMatrixView z_field, ConstVectorView lat_grid, const Index &ip, const Index &ilat) |
ppath_fill_2d More... | |
void | ppath_fill_3d (Ppath &ppath, ConstVectorView r, ConstVectorView lat, ConstVectorView lon, ConstVectorView za, ConstVectorView aa, const double &lstep, ConstMatrixView r_geoid, ConstTensor3View z_field, ConstVectorView lat_grid, ConstVectorView lon_grid, const Index &ip, const Index &ilat, const Index &ilon) |
ppath_fill_3d More... | |
double | refraction_ppc (const double &r, const double &za, const double &refr_index) |
refraction_ppc More... | |
void | ppath_start_1d (double &r_start, double &lat_start, double &za_start, Index &ip, const Ppath &ppath) |
ppath_start_1d More... | |
void | ppath_end_1d (Ppath &ppath, ConstVectorView r_v, ConstVectorView lat_v, ConstVectorView za_v, const double &lstep, ConstVectorView z_field, const double &r_geoid, const Index &ip, const Index &endface, const Index &tanpoint, const double &ppc) |
ppath_end_1d More... | |
void | ppath_start_2d (double &r_start, double &lat_start, double &za_start, Index &ip, Index &ilat, double &lat1, double &lat3, double &r1a, double &r3a, double &r3b, double &r1b, double &rsurface1, double &rsurface3, Ppath &ppath, ConstVectorView lat_grid, ConstMatrixView z_field, ConstVectorView r_geoid, ConstVectorView z_surface) |
ppath_start_2d More... | |
void | ppath_end_2d (Ppath &ppath, ConstVectorView r_v, ConstVectorView lat_v, ConstVectorView za_v, const double &lstep, ConstVectorView lat_grid, ConstMatrixView z_field, ConstVectorView r_geoid, const Index &ip, const Index &ilat, const Index &endface, const Index &tanpoint, const double &ppc) |
ppath_end_2d More... | |
void | ppath_start_3d (double &r_start, double &lat_start, double &lon_start, double &za_start, double &aa_start, Index &ip, Index &ilat, Index &ilon, double &lat1, double &lat3, double &lon5, double &lon6, double &r15a, double &r35a, double &r36a, double &r16a, double &r15b, double &r35b, double &r36b, double &r16b, double &rsurface15, double &rsurface35, double &rsurface36, double &rsurface16, Ppath &ppath, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstMatrixView r_geoid, ConstMatrixView z_surface) |
ppath_start_3d More... | |
void | ppath_end_3d (Ppath &ppath, ConstVectorView r_v, ConstVectorView lat_v, ConstVectorView lon_v, ConstVectorView za_v, ConstVectorView aa_v, const double &lstep, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstMatrixView r_geoid, const Index &ip, const Index &ilat, const Index &ilon, const Index &endface, const Index &tanpoint, const double &ppc) |
ppath_end_3d More... | |
void | interpolate_raytracing_points (Vector &r_v, Vector &lat_v, Vector &lon_v, Vector &za_v, Vector &aa_v, double &lstep, ConstVectorView r_rt, ConstVectorView lat_rt, ConstVectorView lon_rt, ConstVectorView za_rt, ConstVectorView aa_rt, ConstVectorView l_rt, const double &lmax) |
interpolate_raytracing_points More... | |
void | from_raytracingarrays_to_ppath_vectors_1d_and_2d (Vector &r_v, Vector &lat_v, Vector &za_v, double &lstep, const Array< double > &r_array, const Array< double > &lat_array, const Array< double > &za_array, const Array< double > &l_array, const Index &reversed, const double &lmax) |
from_raytracingarrays_to_ppath_vectors_1d_and_2d More... | |
void | from_raytracingarrays_to_ppath_vectors_3d (Vector &r_v, Vector &lat_v, Vector &lon_v, Vector &za_v, Vector &aa_v, double &lstep, const Array< double > &r_array, const Array< double > &lat_array, const Array< double > &lon_array, const Array< double > &za_array, const Array< double > &aa_array, const Array< double > &l_array, const double &lmax) |
from_raytracingarrays_to_ppath_vectors_3d More... | |
void | ppath_step_geom_1d (Ppath &ppath, ConstVectorView p_grid, ConstVectorView z_field, const double &r_geoid, const double &z_surface, const double &lmax) |
ppath_step_geom_1d More... | |
void | ppath_step_geom_2d (Ppath &ppath, ConstVectorView p_grid, ConstVectorView lat_grid, ConstMatrixView z_field, ConstVectorView r_geoid, ConstVectorView z_surface, const double &lmax) |
ppath_step_geom_2d More... | |
void | ppath_step_geom_3d (Ppath &ppath, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstMatrixView r_geoid, ConstMatrixView z_surface, const double &lmax) |
ppath_step_geom_3d More... | |
void | raytrace_1d_linear_euler (Workspace &ws, Array< double > &r_array, Array< double > &lat_array, Array< double > &za_array, Array< double > &l_array, Index &endface, Index &tanpoint, double r, double lat, double za, Numeric &rte_pressure, Numeric &rte_temperature, Vector &rte_vmr_list, Numeric &refr_index, const Agenda &refr_index_agenda, const double &ppc, const double &lraytrace, const double &r1, const double &r3, const double &r_surface, const double &r_geoid, ConstVectorView p_grid, ConstVectorView z_field, ConstVectorView t_field, ConstMatrixView vmr_field) |
raytrace_1d_linear_euler More... | |
void | raytrace_2d_linear_euler (Workspace &ws, Array< double > &r_array, Array< double > &lat_array, Array< double > &za_array, Array< double > &l_array, Index &endface, Index &tanpoint, double r, double lat, double za, Numeric &rte_pressure, Numeric &rte_temperature, Vector &rte_vmr_list, Numeric &refr_index, const Agenda &refr_index_agenda, const double &lraytrace, const double &lat1, const double &lat3, const double &r1a, const double &r3a, const double &r3b, const double &r1b, const double &rsurface1, const double &rsurface3, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView r_geoid, ConstMatrixView z_field, ConstMatrixView t_field, ConstTensor3View vmr_field) |
raytrace_2d_linear_euler More... | |
void | raytrace_3d_linear_euler (Workspace &ws, Array< double > &r_array, Array< double > &lat_array, Array< double > &lon_array, Array< double > &za_array, Array< double > &aa_array, Array< double > &l_array, Index &endface, Index &tanpoint, double r, double lat, double lon, double za, double aa, Numeric &rte_pressure, Numeric &rte_temperature, Vector &rte_vmr_list, Numeric &refr_index, const Agenda &refr_index_agenda, const double &lraytrace, const double &lat1, const double &lat3, const double &lon5, const double &lon6, const double &r15a, const double &r35a, const double &r36a, const double &r16a, const double &r15b, const double &r35b, const double &r36b, const double &r16b, const double &rsurface15, const double &rsurface35, const double &rsurface36, const double &rsurface16, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstMatrixView r_geoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field) |
raytrace_3d_linear_euler More... | |
void | ppath_step_refr_1d (Workspace &ws, Ppath &ppath, Numeric &rte_pressure, Numeric &rte_temperature, Vector &rte_vmr_list, Numeric &refr_index, const Agenda &refr_index_agenda, ConstVectorView p_grid, ConstVectorView z_field, ConstVectorView t_field, ConstMatrixView vmr_field, const double &r_geoid, const double &z_surface, const String &rtrace_method, const double &lraytrace, const double &lmax) |
ppath_step_refr_1d More... | |
void | ppath_step_refr_2d (Workspace &ws, Ppath &ppath, Numeric &rte_pressure, Numeric &rte_temperature, Vector &rte_vmr_list, Numeric &refr_index, const Agenda &refr_index_agenda, ConstVectorView p_grid, ConstVectorView lat_grid, ConstMatrixView z_field, ConstMatrixView t_field, ConstTensor3View vmr_field, ConstVectorView r_geoid, ConstVectorView z_surface, const String &rtrace_method, const double &lraytrace, const double &lmax) |
ppath_step_refr_2d More... | |
void | ppath_step_refr_3d (Workspace &ws, Ppath &ppath, Numeric &rte_pressure, Numeric &rte_temperature, Vector &rte_vmr_list, Numeric &refr_index, const Agenda &refr_index_agenda, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstMatrixView r_geoid, ConstMatrixView z_surface, const String &rtrace_method, const double &lraytrace, const double &lmax) |
ppath_step_refr_3d More... | |
void | ppath_start_stepping (Ppath &ppath, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstMatrixView r_geoid, ConstMatrixView z_surface, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const bool &outside_cloudbox, ConstVectorView rte_pos, ConstVectorView rte_los, const Verbosity &verbosity) |
ppath_start_stepping 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 Matrix &r_geoid, const Matrix &z_surface, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Vector &rte_pos, const Vector &rte_los, const bool &outside_cloudbox, const Verbosity &verbosity) |
ppath_calc More... | |
Variables | |
const Numeric | DEG2RAD |
const Numeric | RAD2DEG |
const double | RTOL = 10 |
const double | LATLONTOL = 1e-6 |
const double | ANGTOL = 1e-4 |
const double | POLELAT = 89.9999 |
const double | PTILTMAX = 5 |
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 cart2poslos | ( | double & | r, |
double & | lat, | ||
double & | lon, | ||
double & | za, | ||
double & | aa, | ||
const double & | x, | ||
const double & | y, | ||
const double & | z, | ||
const double & | dx, | ||
const double & | dy, | ||
const double & | dz | ||
) |
cart2poslos
The inverse of poslos2cart.
The azimuth angle is set to:
0 when the zenith angle is 0 or 180. atan2(dz,dx) at the poles (lat = +- 90).
The longitude is set to 0 at the poles (lat = +- 90).
r | Out: Radius of observation position. |
lat | Out: Latitude of observation position. |
lon | Out: Longitude of observation position. |
za | Out: LOS zenith angle at observation position. |
aa | Out: LOS azimuth angle at observation position. |
x | x-coordinate of observation position. |
y | y-coordinate of observation position. |
z | z-coordinate of observation position. |
dx | x-part of LOS unit vector. |
dy | y-part of LOS unit vector. |
dz | z-part of LOS unit vector. |
Definition at line 652 of file ppath.cc.
References abs, ANGTOL, cart2sph(), DEG2RAD, dx, POLELAT, and RAD2DEG.
Referenced by do_gridcell_3d(), mcPathTraceIPA(), plevel_slope_3d(), ppath_start_stepping(), and raytrace_3d_linear_euler().
void cart2sph | ( | double & | r, |
double & | lat, | ||
double & | lon, | ||
const double & | x, | ||
const double & | y, | ||
const double & | z | ||
) |
cart2sph
The inverse of sph2cart.
r | Out: Radius of observation position. |
lat | Out: Latitude of observation position. |
lon | Out: Longitude of observation position. |
x | x-coordinate of observation position. |
y | y-coordinate of observation position. |
z | z-coordinate of observation position. |
Definition at line 527 of file ppath.cc.
References RAD2DEG.
Referenced by cart2poslos(), do_gridcell_3d(), and geompath_tanpos_3d().
void cart2zaaa | ( | double & | za, |
double & | aa, | ||
const double & | dx, | ||
const double & | dy, | ||
const double & | dz | ||
) |
cart2zaaa
Converts a cartesian directional vector to zenith and azimuth
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
za | Out: LOS zenith angle at observation position. |
aa | Out: LOS azimuth angle at observation position. |
dx | x-part of LOS unit vector. |
dy | y-part of LOS unit vector. |
dz | z-part of LOS unit vector. |
Definition at line 876 of file ppath.cc.
Referenced by map_daa().
void do_gridcell_2d | ( | Vector & | r_v, |
Vector & | lat_v, | ||
Vector & | za_v, | ||
double & | lstep, | ||
Index & | endface, | ||
Index & | tanpoint, | ||
const double & | r_start0, | ||
const double & | lat_start, | ||
const double & | za_start, | ||
const double & | ppc, | ||
const double & | lmax, | ||
const double & | lat1, | ||
const double & | lat3, | ||
const double & | r1a, | ||
const double & | r3a, | ||
const double & | r3b, | ||
const double & | r1b, | ||
const double & | rsurface1, | ||
const double & | rsurface3 | ||
) |
do_gridcell_2d
Calculates the geometrical path through a 2D grid cell.
The function determines the geometrical path from the given start point to the boundary of the grid cell. The face where the path exits the grid cell is denoted as the end face. The following number coding is used for the variable endface:
1: The face at the lower latitude point.
2: The face at the lower (geometrically) pressure level.
3: The face at the upper latitude point.
4: The face at the upper (geometrically) pressure level.
7: The end point is an intersection with the surface.
The corner points are names r[lat][a,b]. For example: r3b. The latitudes are numbered to match the end faces. This means that the lower latitude has number 1, and the upper number 3. The pressure levels are named as a and b:
a: Lower pressure level (highest pressure).
b: Upper pressure level (lowest pressure).
Path points are included if lmax>0 and the distance to the end point is > than lmax.
The return vectors (r_v etc.) can have any length when handed to the function.
r_v | Out: Vector with radius of found path points. |
lat_v | Out: Vector with latitude of found path points. |
za_v | Out: Vector with LOS zenith angle at found path points. |
lstep | Out: Vector with length along the path between points. |
endface | Out: Number coding for exit face. See above. |
tanpoint | Out: Set to 1 if end point is a tangent point. |
r_start0 | Radius of start point. |
lat_start | Latitude of start point. |
za_start | LOS zenith angle at start point. |
ppc | Propagation path constant. |
lmax | Maximum allowed length along the path. -1 = no limit. |
lat1 | Latitude of left end face (face 1) of the grid cell. |
lat3 | Latitude of right end face (face 3) of the grid cell. |
r1a | Radius of lower-left corner of the grid cell. |
r3a | Radius of lower-right corner of the grid cell. |
r3b | Radius of upper-right corner of the grid cell (r3b>r3a) |
r1b | Radius of upper-left corner of the grid cell (r1b>r1a). |
rsurface1 | Radius for the surface at lat1. |
rsurface3 | Radius for the surface at lat3. |
Definition at line 1825 of file ppath.cc.
References abs, ANGTOL, geompath_from_r1_to_r2(), geompath_r_at_lat(), geompath_r_at_za(), ConstVectorView::nelem(), plevel_crossing_2d(), plevel_slope_2d(), RTOL, and sign().
Referenced by ppath_step_geom_2d(), and raytrace_2d_linear_euler().
void do_gridcell_3d | ( | Vector & | r_v, |
Vector & | lat_v, | ||
Vector & | lon_v, | ||
Vector & | za_v, | ||
Vector & | aa_v, | ||
double & | lstep, | ||
Index & | endface, | ||
Index & | tanpoint, | ||
const double & | r_start0, | ||
const double & | lat_start0, | ||
const double & | lon_start0, | ||
const double & | za_start, | ||
const double & | aa_start, | ||
const double & | ppc, | ||
const double & | lmax, | ||
const double & | lat1, | ||
const double & | lat3, | ||
const double & | lon5, | ||
const double & | lon6, | ||
const double & | r15a, | ||
const double & | r35a, | ||
const double & | r36a, | ||
const double & | r16a, | ||
const double & | r15b, | ||
const double & | r35b, | ||
const double & | r36b, | ||
const double & | r16b, | ||
const double & | rsurface15, | ||
const double & | rsurface35, | ||
const double & | rsurface36, | ||
const double & | rsurface16 | ||
) |
do_gridcell_3d
Calculates the geometrical path through a 3D grid cell.
The function determines the geometrical path from the given start point to the boundary of the grid cell. The face where the path exits the grid cell is denoted as the end face. The same number coding as in do_gridcell_2d is used, where the additional longitude end faces are numbered as:
5: The face at the lower longitude point.
6: The face at the upper longitude point.
The corner points are numbered as do_gridcell_2d, but 5 or 6 is added after the latitude number to indicate the longitude. This means that r16a, is the corner at lat1, lon6 and pressure level a.
See further do_gridcell_2d.
r_v | Out: Vector with radius of found path points. |
lat_v | Out: Vector with latitude of found path points. |
lon_v | Out: Vector with longitude of found path points. |
za_v | Out: Vector with LOS zenith angle at found path points. |
aa_v | FIXME: Add documentation. |
lstep | Out: Vector with length along the path between points. |
endface | Out: Number coding for exit face. See above. |
tanpoint | Out: Set to 1 if end point is a tangent point. |
r_start0 | Radius of start point. |
lat_start0 | Latitude of start point. |
lon_start0 | Longitude of start point. |
za_start | LOS zenith angle at start point. |
aa_start | LOS azimuth angle at start point. |
ppc | Propagation path constant. |
lmax | Maximum allowed length along the path. -1 = no limit. |
lat1 | Latitude of left end face (face 1) of the grid cell. |
lat3 | Latitude of right end face (face 3) of the grid cell. |
lon5 | Lower longitude limit of the grid cell. |
lon6 | Upper longitude limit of the grid cell. |
r15a | Radius of corner: lower p-level,lat1 and lon5. |
r35a | Radius of corner: lower p-level,lat3 and lon5. |
r36a | Radius of corner: lower p-level,lat3 and lon6. |
r16a | Radius of corner: lower p-level,lat1 and lon6. |
r15b | Radius of corner: upper p-level,lat1 and lon5. |
r35b | Radius of corner: upper p-level,lat3 and lon5. |
r36b | Radius of corner: upper p-level,lat3 and lon6. |
r16b | Radius of corner: upper p-level,lat1 and lon6. |
rsurface15 | Radius for the surface at lat1 and lon5. |
rsurface35 | Radius for the surface at lat3 and lon5. |
rsurface36 | Radius for the surface at lat3 and lon6. |
rsurface16 | Radius for the surface at lat1 and lon6. |
Definition at line 2069 of file ppath.cc.
References abs, ANGTOL, cart2poslos(), cart2sph(), dx, geompath_tanpos_3d(), geompath_za_at_r(), LATLONTOL, poslos2cart(), Vector::resize(), resolve_lon(), rsurf_at_latlon(), and RTOL.
Referenced by ppath_step_geom_3d(), and raytrace_3d_linear_euler().
void do_gridrange_1d | ( | Vector & | r_v, |
Vector & | lat_v, | ||
Vector & | za_v, | ||
double & | lstep, | ||
Index & | endface, | ||
Index & | tanpoint, | ||
const double & | r_start0, | ||
const double & | lat_start, | ||
const double & | za_start, | ||
const double & | ppc, | ||
const double & | lmax, | ||
const double & | ra, | ||
const double & | rb, | ||
const double & | rsurface | ||
) |
do_gridrange_1d
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 excpetion that end faces 2 and 4 do not exist here.
r_v | Out: Vector with radius of found path points. |
lat_v | Out: Vector with latitude of found path points. |
za_v | Out: Vector with LOS zenith angle at found path points. |
lstep | Out: Vector with length along the path between points. |
endface | Out: Number coding for exit face. See above. |
tanpoint | Out: Set to 1 if end point is a tangent point. |
r_start0 | Radius of start point. |
lat_start | Latitude of start point. |
za_start | LOS zenith angle at start point. |
ppc | Propagation path constant. |
lmax | Maximum allowed length along the path. -1 = no limit. |
ra | Radius of lower pressure level. |
rb | Radius of upper pressure level (rb > ra); |
rsurface | Radius for the surface. |
Definition at line 1697 of file ppath.cc.
References geompath_from_r1_to_r2(), ConstVectorView::nelem(), and RTOL.
Referenced by ppath_step_geom_1d(), and raytrace_1d_linear_euler().
void from_raytracingarrays_to_ppath_vectors_1d_and_2d | ( | Vector & | r_v, |
Vector & | lat_v, | ||
Vector & | za_v, | ||
double & | lstep, | ||
const Array< double > & | r_array, | ||
const Array< double > & | lat_array, | ||
const Array< double > & | za_array, | ||
const Array< double > & | l_array, | ||
const Index & | reversed, | ||
const double & | lmax | ||
) |
from_raytracingarrays_to_ppath_vectors_1d_and_2d
A small help function to convert arrays with ray tracing points t interpolated values along the path.
This function is common for 1D and 2D.
Definition at line 3655 of file ppath.cc.
References interpolate_raytracing_points(), and Array< base >::nelem().
Referenced by ppath_step_refr_1d(), and ppath_step_refr_2d().
void from_raytracingarrays_to_ppath_vectors_3d | ( | Vector & | r_v, |
Vector & | lat_v, | ||
Vector & | lon_v, | ||
Vector & | za_v, | ||
Vector & | aa_v, | ||
double & | lstep, | ||
const Array< double > & | r_array, | ||
const Array< double > & | lat_array, | ||
const Array< double > & | lon_array, | ||
const Array< double > & | za_array, | ||
const Array< double > & | aa_array, | ||
const Array< double > & | l_array, | ||
const double & | lmax | ||
) |
from_raytracingarrays_to_ppath_vectors_3d
A small help function to convert arrays with ray tracing points to interpolated values along the path.
Definition at line 3717 of file ppath.cc.
References interpolate_raytracing_points(), and Array< base >::nelem().
Referenced by ppath_step_refr_3d().
double geometrical_ppc | ( | const double & | r, |
const double & | za | ||
) |
geometrical_ppc
Calculates the propagation path constant for pure geometrical calculations.
Both positive and negative zenith angles are handled.
r | Radius of the sensor position. |
za | Zenith angle of the sensor line-of-sight. |
Definition at line 131 of file ppath.cc.
Referenced by plevel_crossing_2d(), ppath_start_stepping(), ppath_step_geom_1d(), ppath_step_geom_2d(), ppath_step_geom_3d(), raytrace_1d_linear_euler(), raytrace_2d_linear_euler(), and raytrace_3d_linear_euler().
void geompath_from_r1_to_r2 | ( | Vector & | r, |
Vector & | lat, | ||
Vector & | za, | ||
double & | lstep, | ||
const double & | ppc, | ||
const double & | r1, | ||
const double & | lat1, | ||
const double & | za1, | ||
const double & | r2, | ||
const double & | lmax | ||
) |
geompath_from_r1_to_r2
Determines radii, latitudes and zenith angles between two points of a propagation path.
Both start and end point are included in the returned vectors.
r | Output: Radius of propagation path points. |
lat | Output: Latitude of propagation path points. |
za | Output: Zenith angle of propagation path points. |
lstep | Output: Distance along the path between the points. |
ppc | Propagation path constant. |
r1 | Radius for first point. |
lat1 | Latitude for first point. |
za1 | Zenith angle for first point. |
r2 | Radius for second point. |
lmax | Length criterion for distance between path points. A negative value means no length criterion. |
Definition at line 350 of file ppath.cc.
References abs, ANGTOL, geompath_l_at_r(), geompath_lat_at_za(), geompath_r_at_l(), geompath_za_at_r(), and Vector::resize().
Referenced by do_gridcell_2d(), and do_gridrange_1d().
double geompath_l_at_r | ( | const double & | ppc, |
const double & | r | ||
) |
geompath_l_at_r
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.
ppc | Propagation path constant. |
r | Radius of the point of concern. |
Definition at line 256 of file ppath.cc.
References RTOL.
Referenced by geompath_from_r1_to_r2(), raytrace_1d_linear_euler(), and raytrace_2d_linear_euler().
double geompath_lat_at_za | ( | const double & | za0, |
const double & | lat0, | ||
const double & | za | ||
) |
geompath_lat_at_za
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.
za0 | The zenith angle of the starting point. |
lat0 | The latitude of the starting point. |
za | The zenith angle of the second point. |
Definition at line 228 of file ppath.cc.
References abs.
Referenced by geompath_from_r1_to_r2(), plevel_crossing_2d(), and ppath_start_stepping().
double geompath_r_at_l | ( | const double & | ppc, |
const double & | l | ||
) |
geompath_r_at_l
Calculates the radius for a distance from the tangent point.
The tangent point is either rwal or imaginary depending on the zenith angle of the sensor. See geometrical_tangent_radius.
ppc | Propagation path constant. |
l | Length from the tangent point. |
Definition at line 285 of file ppath.cc.
Referenced by geompath_from_r1_to_r2(), raytrace_1d_linear_euler(), and raytrace_2d_linear_euler().
double geompath_r_at_lat | ( | const double & | ppc, |
const double & | lat0, | ||
const double & | za0, | ||
const double & | lat | ||
) |
geompath_r_at_lat
Calculates the radius for a given latitude.
ppc | Propagation path constant. |
lat0 | Latitude at some other point of the path. |
za0 | Zenith angle for the point with latitude lat0. |
lat | Latitude of the point of interest. |
Definition at line 310 of file ppath.cc.
References abs, and geompath_r_at_za().
Referenced by do_gridcell_2d(), and ppath_start_stepping().
double geompath_r_at_za | ( | const double & | ppc, |
const double & | za | ||
) |
geompath_r_at_za
Calculates the zenith angle for a given radius along a geometrical propagation path.
Both positive and negative zenith angles are handled.
ppc | Propagation path constant. |
za | Zenith angle at the point of interest. |
Definition at line 200 of file ppath.cc.
Referenced by do_gridcell_2d(), and geompath_r_at_lat().
void geompath_tanpos_3d | ( | double & | r_tan, |
double & | lat_tan, | ||
double & | lon_tan, | ||
double & | l_tan, | ||
const double & | r, | ||
const double & | lat, | ||
const double & | lon, | ||
const double & | za, | ||
const double & | aa, | ||
const double & | ppc | ||
) |
geompath_tanpos_3d
Position of the tangent point for 3D cases.
The zenith angle must be >= 90.
r_tan | Out: Radius of tangent point. |
lat_tan | Out: Latitude of tangent point. |
lon_tan | Out: Longitude of tangent point. |
l_tan | Out: Distance along path to the tangent point. |
r | Radius of observation position. |
lat | Latitude of observation position. |
lon | Longitude of observation position. |
za | LOS zenith angle at observation position. |
aa | LOS azimuth angle at observation position. |
ppc | FIXME: Add documentation. |
Definition at line 784 of file ppath.cc.
References cart2sph(), dx, and poslos2cart().
Referenced by do_gridcell_3d(), and ppath_start_stepping().
double geompath_za_at_r | ( | const double & | ppc, |
const double & | a_za, | ||
const double & | r | ||
) |
geompath_za_at_r
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.
ppc | Propagation path constant. |
a_za | A zenith angle along the path on the same side of the tangent point as the point of interest. |
r | Radius of the point of interest. |
Definition at line 160 of file ppath.cc.
References abs, RAD2DEG, and RTOL.
Referenced by do_gridcell_3d(), geompath_from_r1_to_r2(), plevel_crossing_2d(), ppath_start_stepping(), raytrace_1d_linear_euler(), raytrace_3d_linear_euler(), and VectorZtanToZa1D().
void interpolate_raytracing_points | ( | Vector & | r_v, |
Vector & | lat_v, | ||
Vector & | lon_v, | ||
Vector & | za_v, | ||
Vector & | aa_v, | ||
double & | lstep, | ||
ConstVectorView | r_rt, | ||
ConstVectorView | lat_rt, | ||
ConstVectorView | lon_rt, | ||
ConstVectorView | za_rt, | ||
ConstVectorView | aa_rt, | ||
ConstVectorView | l_rt, | ||
const double & | lmax | ||
) |
interpolate_raytracing_points
Interpolates a set of ray tracing points to a set of points linearly spaced along the path.
All quantities are interpolated linearly.
Empty vectors can be sent as input for lon_rt and aa_rt for 1D and 2D. The output vectors lon_v and aa_v are then not filled.
Definition at line 3572 of file ppath.cc.
References gridpos(), interp(), interpweights(), max, ConstVectorView::nelem(), nlinspace(), Vector::resize(), and ConstVectorView::sum().
Referenced by from_raytracingarrays_to_ppath_vectors_1d_and_2d(), and from_raytracingarrays_to_ppath_vectors_3d().
bool is_los_downwards | ( | const double & | za, |
const double & | tilt | ||
) |
is_los_downwards
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.
za | Zenith angle of line-of-sight. |
tilt | Angular tilt of the surface or the pressure level (as returned by plevel_angletilt) |
Definition at line 1402 of file ppath.cc.
References abs.
Referenced by plevel_crossing_2d(), ppath_start_2d(), ppath_start_3d(), and ppath_start_stepping().
void map_daa | ( | double & | za, |
double & | aa, | ||
const double & | za0, | ||
const double & | aa0, | ||
const double & | aa_grid | ||
) |
Maps MBLOCK_AA_GRID values to correct ZA and AA
Sensor LOS azimuth angles and mblock_aa_grid values can not be added in a straightforward way due to properties of the polar coordinate system used to define line-of-sights. This function performs a "mapping" ensuring that the pencil beam directions specified by mblock_za_grid and mblock_aa_grid form a rectangular grid (on the unit sphere) for any za.
za0 and aa0 match the angles of the ARTS WSV sensor_los. aa_grid shall hold values "close" to 0. The limit is here set to 5 degrees.
za | Out: Zenith angle matching aa0+aa_grid |
aa | Out: Azimuth angles matching aa0+aa_grid |
za0 | Zenith angle |
aa0 | Centre azimuth angle |
aa_grid | MBLOCK_AA_GRID values |
Definition at line 967 of file ppath.cc.
References abs, cart2zaaa(), mult(), rotationmat3D(), and zaaa2cart().
Referenced by iyb_calc().
double plevel_angletilt | ( | const double & | r, |
const double & | c | ||
) |
plevel_angletilt
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.
r | The radius for the level at the point of interest. |
c | The radial slope, as returned by e.g. plevel_slope_2d. |
Definition at line 1317 of file ppath.cc.
References RAD2DEG.
Referenced by plevel_crossing_2d(), ppath_start_2d(), ppath_start_3d(), ppath_start_stepping(), and surfacetilt().
double plevel_crossing_2d | ( | const double & | rp, |
const double & | za, | ||
const double & | r0, | ||
double | c | ||
) |
plevel_crossing_2d
Calculates the angular distance to a crossing of a 2D pressure level or the surface.
The function solves the problem mentioned above for a pressure level, or the surface, where the radius changes linearly as a function of latitude. 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 as in practical situations, the latitude difference inside a grid cell should not exceed 2 degrees, and the accuracy should be sufficient for values up to 3 degrees.
The problem and its solution is further described in AUG. See the chapter on propagation paths.
Both positive and negative zenith angles are handled.
The function only looks for crossings in the forward direction of the given zenith angle. This means that if r>r0 and the absolute value of the zenith angle is < 90, no crossing will be found (if not the slope of the pressure level happen to be very strong).
For downlooking cases, only the part down to the tangent point is considered.
If the given path point is on the pressure level (r=r0), the solution 0 is rejected.
The latitude difference is set to 999 if no crossing exists.
The variable names below are the same as in AUG.
rp | Radius of a point of the path inside the grid cell |
za | Zenith angle of the path at r. |
r0 | Radius of the pressure level or the surface at the latitude of r. |
c | Linear slope term, as returned by plevel_slope_2d. |
Definition at line 1462 of file ppath.cc.
References abs, ANGTOL, beta, DEG2RAD, dmin, geometrical_ppc(), geompath_lat_at_za(), geompath_za_at_r(), is_los_downwards(), plevel_angletilt(), poly_root_solve(), and RAD2DEG.
Referenced by do_gridcell_2d(), and ppath_start_stepping().
void plevel_crossing_3d | ( | double & | r, |
double & | lat, | ||
double & | lon, | ||
double & | l, | ||
const double | r_surf, | ||
const double | r_start, | ||
const double | lat_start, | ||
const double | lon_start, | ||
const double | za_start, | ||
const double & | x, | ||
const double & | y, | ||
const double & | z, | ||
const double & | dx, | ||
const double & | dy, | ||
const double & | dz | ||
) |
plevel_crossing_3d
Calculates the radius of a crossing of a 3D pressure level or the surface.
The function solves the problem mentioned above for a pressure level, or the surface, for 3D cases. The problem is solved by making calculations for five radii, between the min and max values among r15*, r35, r36 and r16. For each test radius, the latitude and longitude for the crossing of the path and the assumed radius are calculated. The test radius is then compared to the radius of the pressure level, or the surface, for the found latitude and longitude. These two radii shall ideally be identical. A radius is selected by an interpolation between the test radii.
The problem and its solution is further described in AUG. 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).
The radius r is set to -1 if no crossing is found.
r | Out: Radius of found crossing. |
lat | Out: Latitude of found crossing. |
lon | Out: Longitude of found crossing. |
l | Out: Length along the path to the crossing. |
r_surf | Radius of the level |
r_start | Radius of observation point. |
lat_start | Latitude of start point. |
lon_start | Longitude of start point. |
za_start | Zenith angle at observation point. |
x | x-coordinate of observation position. |
y | y-coordinate of observation position. |
z | z-coordinate of observation position. |
dx | x-part of LOS unit vector. |
dy | y-part of LOS unit vector. |
dz | z-part of LOS unit vector. |
Definition at line 1599 of file ppath.cc.
References abs, ANGTOL, dx, q, and RAD2DEG.
Referenced by ppath_start_stepping().
double plevel_slope_2d | ( | const double & | lat1, |
const double & | lat2, | ||
const double & | r1, | ||
const double & | r2 | ||
) |
plevel_slope_2d
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.
lat1 | A latitude. |
lat2 | Another latitude. |
r1 | Radius at lat1. |
r2 | Radius at lat2. |
double plevel_slope_2d | ( | ConstVectorView | lat_grid, |
ConstVectorView | r_geoid, | ||
ConstVectorView | z_surf, | ||
const GridPos & | gp, | ||
const double & | za | ||
) |
plevel_slope_2d
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.
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.
lat_grid | The latitude grid. |
r_geoid | Radius of the geoid for the latitude dimension. |
z_surf | Geometrical altitude of the surface, or the pressure level of interest, for the latitide dimension |
gp | Latitude grid position for the position of interest |
za | LOS zenith angle. |
Definition at line 1043 of file ppath.cc.
References abs, and gridpos2gridrange().
Referenced by do_gridcell_2d(), ppath_start_2d(), ppath_start_stepping(), and surfacetilt().
double plevel_slope_3d | ( | const double & | lat1, |
const double & | lat3, | ||
const double & | lon5, | ||
const double & | lon6, | ||
const double & | r15, | ||
const double & | r35, | ||
const double & | r36, | ||
const double & | r16, | ||
const double & | lat, | ||
const double & | lon, | ||
const double & | aa | ||
) |
plevel_slope_3d
Calculates the local radial slope of the surface or a pressure level for 3D.
The function works basically as the non-vector version of plevel_slope_2d*, but the position and viewing direction must here be specicified as the slope varies inside the cell grid, in constrast to a 2D latitude grid range.
See further the other version of the function below.
lat1 | Lower latitude of grid cell. |
lat3 | Upper latitude of grid cell. |
lon5 | Lower longitude of grid cell. |
lon6 | Upper longitude of grid cell. |
r15 | Radius at crossing of lat1 and lon5. |
r35 | Radius at crossing of lat3 and lon5. |
r36 | Radius at crossing of lat3 and lon6. |
r16 | Radius at crossing of lat1 and lon6. |
lat | Latitude for which slope shall be determined. |
lon | Longitude for which slope shall be determined. |
aa | Azimuth angle for which slope shall be determined. |
Definition at line 1195 of file ppath.cc.
References cart2poslos(), DEG2RAD, dx, poslos2cart(), resolve_lon(), and rsurf_at_latlon().
Referenced by plevel_slope_3d(), ppath_start_3d(), ppath_start_stepping(), and surfacetilt().
double plevel_slope_3d | ( | ConstVectorView | lat_grid, |
ConstVectorView | lon_grid, | ||
ConstMatrixView | r_geoid, | ||
ConstMatrixView | z_surf, | ||
const GridPos & | gp_lat, | ||
const GridPos & | gp_lon, | ||
const double & | aa | ||
) |
plevel_slope_3d
Calculates the radial slope of the surface or a pressure level for 3D.
The radial slope is here the derivative of the radius with respect to an angular change (in degrees) along the great circle along the given azimuth angle. That is, how much the radius would change for a movement of r*pi/180 in the given azimuth angle (if the slope where constant along the distance). The unit is m/degree.
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.
This function is in practice another way to call the non-vector version of the function above.
lat_grid | The latitude grid. |
lon_grid | The longitude grid. |
r_geoid | As the WSV with the same name. |
z_surf | Geometrical altitude of the surface, or the pressure level of interest. |
gp_lat | Latitude grid position for the position of interest. |
gp_lon | Longitude grid position for the position of interest. |
aa | Azimuth angle. |
Definition at line 1267 of file ppath.cc.
References abs, gridpos2gridrange(), interp(), interpweights(), and plevel_slope_3d().
void poslos2cart | ( | double & | x, |
double & | y, | ||
double & | z, | ||
double & | dx, | ||
double & | dy, | ||
double & | dz, | ||
const double & | r, | ||
const double & | lat, | ||
const double & | lon, | ||
const double & | za, | ||
const double & | aa | ||
) |
poslos2cart
Conversion from position and LOS to cartesian coordinates
A position (in geographical coordinates) and LOS are converted to a cartesian position and a viewing vector. The viewing direction is the the vector [dx,dy,dz]. This vector is normalised (it has length 1).
See the user guide for definition on the zenith and azimuth angles.
x | Out: x-coordinate of observation position. |
y | Out: y-coordinate of observation position. |
z | Out: z-coordinate of observation position. |
dx | Out: x-part of LOS unit vector. |
dy | Out: y-part of LOS unit vector. |
dz | Out: z-part of LOS unit vector. |
r | Radius of observation position. |
lat | Latitude of observation position. |
lon | Longitude of observation position. |
za | LOS zenith angle at observation position. |
aa | LOS azimuth angle at observation position. |
Definition at line 567 of file ppath.cc.
References abs, DEG2RAD, dx, POLELAT, sign(), and sph2cart().
Referenced by do_gridcell_3d(), geompath_tanpos_3d(), mcPathTraceIPA(), plevel_slope_3d(), ppath_start_stepping(), and raytrace_3d_linear_euler().
ppath_append
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 data in ppath from the fields pos, los, z, l_step, gp_XXX and background are considered.
ppath1 | Output: Ppath structure to be expanded. |
ppath2 | The Ppath structure to include in ppath. |
Definition at line 2652 of file ppath.cc.
References Ppath::background, Ppath::dim, Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos_copy(), Ppath::l_step, Ppath::los, Ppath::np, Ppath::pos, ppath_copy(), ppath_init_structure(), ppath_what_background(), and Ppath::z.
Referenced by ppath_step_geom_1d(), ppath_step_geom_2d(), ppath_step_geom_3d(), ppath_step_refr_1d(), ppath_step_refr_2d(), and ppath_step_refr_3d().
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 Matrix & | r_geoid, | ||
const Matrix & | z_surface, | ||
const Index & | cloudbox_on, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
const Vector & | rte_pos, | ||
const Vector & | rte_los, | ||
const bool & | outside_cloudbox, | ||
const Verbosity & | verbosity | ||
) |
ppath_calc
This is the core for the WSM ppathCalc.
This function takes the same input as ppathCalc (that is, those input arguments are the WSV with the same name), but there are some additional argument(s):
ws | Current Workspace |
ppath | Output: A Ppath structure |
ppath_step_agenda | FIXME: Add documentation. |
atmosphere_dim | The atmospheric dimensionality. |
p_grid | The pressure grid. |
lat_grid | The latitude grid. |
lon_grid | The longitude grid. |
z_field | The field of geometrical altitudes. |
r_geoid | The geoid radius. |
z_surface | Surface altitude. |
cloudbox_on | Flag to activate the cloud box. |
cloudbox_limits | Index limits of the cloud box. |
rte_pos | The position of the sensor. |
rte_los | The line-of-sight of the sensor. |
outside_cloudbox | Boolean to flag if the propagation path is (expected to be) outside the cloudbox. Ordinary clear sky calculations are selected by the value
|
Definition at line 6171 of file ppath.cc.
References abs, Ppath::background, chk_if_in_range(), chk_vector_length(), CREATE_OUT2, fractional_gp(), Ppath::geom_tan_pos, Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos(), is_gridpos_at_index_i(), joker, Ppath::l_step, Ppath::los, Array< base >::nelem(), ConstVectorView::nelem(), Ppath::np, Ppath::pos, ppath_init_structure(), ppath_set_background(), ppath_start_stepping(), ppath_step_agendaExecute(), ppath_what_background(), Vector::resize(), Ppath::tan_pos, and Ppath::z.
Referenced by iwp_cloud_opt_pathCalc(), iyBeerLambertStandardClearsky(), iyBeerLambertStandardCloudbox(), iyEmissionStandardClearsky(), iyEmissionStandardClearskyBasic(), iyFOS(), MCIPA(), and ppathCalc().
ppath_copy
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.
ppath1 | Output: Ppath structure. |
ppath2 | The ppath structure to be copied. |
Definition at line 2598 of file ppath.cc.
References Ppath::background, Ppath::constant, Ppath::dim, Ppath::geom_tan_pos, Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos_copy(), joker, Ppath::l_step, Ppath::los, ConstVectorView::nelem(), Ppath::np, Ppath::pos, Ppath::tan_pos, and Ppath::z.
Referenced by ppath_append(), ppath_step_geom_1d(), ppath_step_geom_2d(), ppath_step_geom_3d(), ppath_step_refr_1d(), ppath_step_refr_2d(), and ppath_step_refr_3d().
void ppath_end_1d | ( | Ppath & | ppath, |
ConstVectorView | r_v, | ||
ConstVectorView | lat_v, | ||
ConstVectorView | za_v, | ||
const double & | lstep, | ||
ConstVectorView | z_field, | ||
const double & | r_geoid, | ||
const Index & | ip, | ||
const Index & | endface, | ||
const Index & | tanpoint, | ||
const double & | ppc | ||
) |
ppath_end_1d
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 fo details.
Definition at line 3058 of file ppath.cc.
References Ppath::constant, Ppath::gp_p, gridpos_check_fd(), gridpos_force_end_fd(), ConstVectorView::nelem(), ppath_fill_1d(), ppath_init_structure(), ppath_set_background(), Vector::resize(), and Ppath::tan_pos.
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, | ||
const double & | lstep, | ||
ConstVectorView | lat_grid, | ||
ConstMatrixView | z_field, | ||
ConstVectorView | r_geoid, | ||
const Index & | ip, | ||
const Index & | ilat, | ||
const Index & | endface, | ||
const Index & | tanpoint, | ||
const double & | ppc | ||
) |
ppath_end_2d
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 fo details.
Definition at line 3233 of file ppath.cc.
References Ppath::constant, Ppath::gp_lat, Ppath::gp_p, gridpos_check_fd(), gridpos_force_end_fd(), ConstVectorView::nelem(), ConstMatrixView::nrows(), ppath_fill_2d(), ppath_init_structure(), ppath_set_background(), Vector::resize(), and Ppath::tan_pos.
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, | ||
const double & | lstep, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstTensor3View | z_field, | ||
ConstMatrixView | r_geoid, | ||
const Index & | ip, | ||
const Index & | ilat, | ||
const Index & | ilon, | ||
const Index & | endface, | ||
const Index & | tanpoint, | ||
const double & | ppc | ||
) |
ppath_end_3d
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 fo details.
Definition at line 3481 of file ppath.cc.
References Ppath::constant, Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos_force_end_fd(), ConstVectorView::nelem(), ConstTensor3View::npages(), ppath_fill_3d(), ppath_init_structure(), ppath_set_background(), Vector::resize(), and Ppath::tan_pos.
Referenced by ppath_step_geom_3d(), and ppath_step_refr_3d().
void ppath_fill_1d | ( | Ppath & | ppath, |
ConstVectorView | r, | ||
ConstVectorView | lat, | ||
ConstVectorView | za, | ||
ConstVectorView | lstep, | ||
const double & | r_geoid, | ||
ConstVectorView | z_field, | ||
const Index & | ip | ||
) |
ppath_fill_1d
Fills a 1D Ppath structure with position and LOS values.
The function fills the fields: pos, los, z, l_step and gp_p. The pressure grid positions (gp_p) are filtered through gridpos_check_fd.
The structure fields must be allocated to correct size before calling the function. The field size must be at least as large as the length of r, lat and za vectors.
The length along the path shall be the same between all points.
ppath | Output: Ppath structure. |
r | Vector with radius for the path points. |
lat | Vector with latitude for the path points. |
za | Vector with zenith angle for the path points. |
lstep | Length along the path between the points. |
r_geoid | Geoid radii. |
z_field | Geometrical altitudes. |
ip | Pressure grid range. |
Definition at line 2722 of file ppath.cc.
References Ppath::gp_p, gridpos_check_fd(), Ppath::l_step, Ppath::los, ConstVectorView::nelem(), Ppath::pos, and Ppath::z.
Referenced by ppath_end_1d().
void ppath_fill_2d | ( | Ppath & | ppath, |
ConstVectorView | r, | ||
ConstVectorView | lat, | ||
ConstVectorView | za, | ||
const double & | lstep, | ||
ConstVectorView | r_geoid, | ||
ConstMatrixView | z_field, | ||
ConstVectorView | lat_grid, | ||
const Index & | ip, | ||
const Index & | ilat | ||
) |
ppath_fill_2d
Fills a 2D Ppath structure with position and LOS values.
The function fills the fields: pos, los, z, l_step, gp_p and gp_lat.
The structure fields must be allocated to correct size before calling the function. The field size must be at least as large as the length of r, lat and za vectors.
The length along the path shall be the same between all points.
ppath | Output: Ppath structure. |
r | Vector with radius for the path points. |
lat | Vector with latitude for the path points. |
za | Vector with zenith angle for the path points. |
lstep | Length along the path between the points. |
r_geoid | Geoid radii. |
z_field | Geometrical altitudes |
lat_grid | Latitude grid. |
ip | Pressure grid range. |
ilat | Latitude grid range. |
Definition at line 2782 of file ppath.cc.
References Ppath::gp_lat, Ppath::gp_p, gridpos_check_fd(), Ppath::l_step, Ppath::los, ConstVectorView::nelem(), Ppath::pos, and Ppath::z.
Referenced by ppath_end_2d().
void ppath_fill_3d | ( | Ppath & | ppath, |
ConstVectorView | r, | ||
ConstVectorView | lat, | ||
ConstVectorView | lon, | ||
ConstVectorView | za, | ||
ConstVectorView | aa, | ||
const double & | lstep, | ||
ConstMatrixView | r_geoid, | ||
ConstTensor3View | z_field, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
const Index & | ip, | ||
const Index & | ilat, | ||
const Index & | ilon | ||
) |
ppath_fill_3d
Fills a 3D Ppath structure with position and LOS values.
The function fills the fields: pos, los, z, l_step, gp_p, gp_lat and gp_lon.
The structure fields must be allocated to correct size before calling the function. The field size must be at least as large as the length of r, lat and za vectors.
The length along the path shall be the same between all points.
ppath | Output: Ppath structure. |
r | Vector with radius for the path points. |
lat | Vector with latitude for the path points. |
lon | Vector with longitude for the path points. |
za | Vector with zenith angle for the path points. |
aa | Vector with azimuth angle for the path points. |
lstep | Length along the path between the points. |
r_geoid | Geoid radii. |
z_field | Geometrical altitudes |
lat_grid | Latitude grid. |
lon_grid | Longitude grid. |
ip | Pressure grid range. |
ilat | Latitude grid range. |
ilon | Longitude grid range. |
Definition at line 2871 of file ppath.cc.
References abs, Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos_check_fd(), Ppath::l_step, Ppath::los, ConstVectorView::nelem(), Ppath::pos, rsurf_at_latlon(), and Ppath::z.
Referenced by ppath_end_3d().
ppath_init_structure
Initiates a Ppath structure to hold the given number of points.
All fields releated with the surface, symmetry and tangent point are set to 0 or empty. 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 l_step field is set to np-1.
ppath | Output: A Ppath structure. |
atmosphere_dim | The atmospheric dimensionality. |
np | Number of points of the path. |
Definition at line 2461 of file ppath.cc.
References Ppath::constant, Ppath::dim, Ppath::geom_tan_pos, Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, Ppath::l_step, Ppath::los, Ppath::np, Ppath::pos, ppath_set_background(), Vector::resize(), Matrix::resize(), Ppath::tan_pos, and Ppath::z.
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(), ppath_step_geom_1d(), ppath_step_geom_2d(), ppath_step_geom_3d(), ppath_step_in_cloudbox(), ppath_step_refr_1d(), ppath_step_refr_2d(), and ppath_step_refr_3d().
ppath_set_background
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. Not yet set.
ppath | Output: A Ppath structure. |
case_nr | Case number (see above) |
Definition at line 2519 of file ppath.cc.
References Ppath::background.
Referenced by ppath_calc(), ppath_end_1d(), ppath_end_2d(), ppath_end_3d(), ppath_init_structure(), and ppath_start_stepping().
void ppath_start_1d | ( | double & | r_start, |
double & | lat_start, | ||
double & | za_start, | ||
Index & | ip, | ||
const Ppath & | ppath | ||
) |
ppath_start_1d
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 fo details.
Definition at line 3023 of file ppath.cc.
References Ppath::gp_p, gridpos2gridrange(), Ppath::los, Ppath::np, and Ppath::pos.
Referenced by ppath_step_geom_1d(), and ppath_step_refr_1d().
void ppath_start_2d | ( | double & | r_start, |
double & | lat_start, | ||
double & | za_start, | ||
Index & | ip, | ||
Index & | ilat, | ||
double & | lat1, | ||
double & | lat3, | ||
double & | r1a, | ||
double & | r3a, | ||
double & | r3b, | ||
double & | r1b, | ||
double & | rsurface1, | ||
double & | rsurface3, | ||
Ppath & | ppath, | ||
ConstVectorView | lat_grid, | ||
ConstMatrixView | z_field, | ||
ConstVectorView | r_geoid, | ||
ConstVectorView | z_surface | ||
) |
ppath_start_2d
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 fo details.
Definition at line 3118 of file ppath.cc.
References abs, Ppath::gp_lat, Ppath::gp_p, gridpos2gridrange(), gridpos_force_end_fd(), is_gridpos_at_index_i(), is_los_downwards(), Ppath::los, Ppath::np, plevel_angletilt(), plevel_slope_2d(), Ppath::pos, rsurf_at_lat(), and RTOL.
Referenced by ppath_step_geom_2d(), and ppath_step_refr_2d().
void ppath_start_3d | ( | double & | r_start, |
double & | lat_start, | ||
double & | lon_start, | ||
double & | za_start, | ||
double & | aa_start, | ||
Index & | ip, | ||
Index & | ilat, | ||
Index & | ilon, | ||
double & | lat1, | ||
double & | lat3, | ||
double & | lon5, | ||
double & | lon6, | ||
double & | r15a, | ||
double & | r35a, | ||
double & | r36a, | ||
double & | r16a, | ||
double & | r15b, | ||
double & | r35b, | ||
double & | r36b, | ||
double & | r16b, | ||
double & | rsurface15, | ||
double & | rsurface35, | ||
double & | rsurface36, | ||
double & | rsurface16, | ||
Ppath & | ppath, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstTensor3View | z_field, | ||
ConstMatrixView | r_geoid, | ||
ConstMatrixView | z_surface | ||
) |
ppath_start_3d
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 fo details.
Definition at line 3307 of file ppath.cc.
References abs, Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos(), gridpos2gridrange(), is_gridpos_at_index_i(), is_los_downwards(), Ppath::los, ConstVectorView::nelem(), Ppath::np, plevel_angletilt(), plevel_slope_3d(), Ppath::pos, and PTILTMAX.
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, | ||
ConstMatrixView | r_geoid, | ||
ConstMatrixView | z_surface, | ||
const Index & | cloudbox_on, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
const bool & | outside_cloudbox, | ||
ConstVectorView | rte_pos, | ||
ConstVectorView | rte_los, | ||
const Verbosity & | verbosity | ||
) |
ppath_start_stepping
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.
ppath | Output: A Ppath structure. |
atmosphere_dim | The atmospheric dimensionality. |
p_grid | The pressure grid. |
lat_grid | The latitude grid. |
lon_grid | The longitude grid. |
z_field | The field of geometrical altitudes. |
r_geoid | The geoid radius. |
z_surface | Surface altitude. |
cloudbox_on | Flag to activate the cloud box. |
cloudbox_limits | Index limits of the cloud box. |
outside_cloudbox | Boolean to flag if the propagation path is (expected to be) outside the cloudbox. Ordinary clerar sky calculations are selected by the value
|
rte_pos | The position of the sensor. |
rte_los | The line-of-sight of the sensor. |
Definition at line 5164 of file ppath.cc.
References abs, ANGTOL, cart2poslos(), Ppath::constant, CREATE_OUT1, CREATE_OUT2, dx, GridPos::fd, Ppath::geom_tan_pos, geometrical_ppc(), geompath_lat_at_za(), geompath_r_at_lat(), geompath_tanpos_3d(), geompath_za_at_r(), Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos(), gridpos2gridrange(), gridpos_check_fd(), GridPos::idx, interp(), interpweights(), is_los_downwards(), joker, Ppath::los, max, min, Array< base >::nelem(), ConstVectorView::nelem(), plevel_angletilt(), plevel_crossing_2d(), plevel_crossing_3d(), plevel_slope_2d(), plevel_slope_3d(), Ppath::pos, poslos2cart(), ppath_init_structure(), ppath_set_background(), Vector::resize(), resolve_lon(), rsurf_at_latlon(), RTOL, Ppath::z, z_at_lat_2d(), and z_at_latlon().
Referenced by mcPathTraceGeneral(), mcPathTraceIPA(), and ppath_calc().
void ppath_step_geom_1d | ( | Ppath & | ppath, |
ConstVectorView | p_grid, | ||
ConstVectorView | z_field, | ||
const double & | r_geoid, | ||
const double & | z_surface, | ||
const double & | lmax | ||
) |
ppath_step_geom_1d
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.
ppath | Output: A Ppath structure. |
p_grid | Pressure grid. |
z_field | Geometrical altitudes corresponding to p_grid. |
r_geoid | Geoid radius. |
z_surface | Surface altitude. |
lmax | Maximum allowed length between the path points. |
Definition at line 3791 of file ppath.cc.
References Ppath::constant, Ppath::dim, do_gridrange_1d(), geometrical_ppc(), Ppath::np, ppath_append(), ppath_copy(), ppath_end_1d(), ppath_init_structure(), ppath_start_1d(), and ppath_step_geom_1d().
Referenced by ppath_step_geom_1d(), and ppath_stepGeometric().
void ppath_step_geom_2d | ( | Ppath & | ppath, |
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstMatrixView | z_field, | ||
ConstVectorView | r_geoid, | ||
ConstVectorView | z_surface, | ||
const double & | lmax | ||
) |
ppath_step_geom_2d
Calculates 2D geometrical propagation path steps.
Works as the same function for 1D despite that some input arguments are of different type.
ppath | Output: A Ppath structure. |
p_grid | Pressure grid. |
lat_grid | Latitude grid. |
z_field | Geometrical altitudes |
r_geoid | Geoid radii. |
z_surface | Surface altitudes. |
lmax | Maximum allowed length between the path points. |
Definition at line 3871 of file ppath.cc.
References Ppath::constant, Ppath::dim, do_gridcell_2d(), geometrical_ppc(), Ppath::np, ppath_append(), ppath_copy(), ppath_end_2d(), ppath_init_structure(), ppath_start_2d(), and ppath_step_geom_2d().
Referenced by ppath_step_geom_2d(), and ppath_stepGeometric().
void ppath_step_geom_3d | ( | Ppath & | ppath, |
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstTensor3View | z_field, | ||
ConstMatrixView | r_geoid, | ||
ConstMatrixView | z_surface, | ||
const double & | lmax | ||
) |
ppath_step_geom_3d
Calculates 3D geometrical propagation path steps.
Works as the same function for 1D despite that some input arguments are of different type.
ppath | Output: A Ppath structure. |
p_grid | Pressure grid. |
lat_grid | Latitude grid. |
lon_grid | Longitude grid. |
z_field | Geometrical altitudes |
r_geoid | Geoid radii. |
z_surface | Surface altitudes. |
lmax | Maximum allowed length between the path points. |
Definition at line 3956 of file ppath.cc.
References Ppath::constant, Ppath::dim, do_gridcell_3d(), geometrical_ppc(), Ppath::np, ppath_append(), ppath_copy(), ppath_end_3d(), ppath_init_structure(), ppath_start_3d(), and ppath_step_geom_3d().
Referenced by mcPathTraceGeneral(), ppath_step_geom_3d(), and ppath_stepGeometric().
void ppath_step_refr_1d | ( | Workspace & | ws, |
Ppath & | ppath, | ||
Numeric & | rte_pressure, | ||
Numeric & | rte_temperature, | ||
Vector & | rte_vmr_list, | ||
Numeric & | refr_index, | ||
const Agenda & | refr_index_agenda, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | z_field, | ||
ConstVectorView | t_field, | ||
ConstMatrixView | vmr_field, | ||
const double & | r_geoid, | ||
const double & | z_surface, | ||
const String & | rtrace_method, | ||
const double & | lraytrace, | ||
const double & | lmax | ||
) |
ppath_step_refr_1d
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.
ws | Current Workspace |
ppath | Out: A Ppath structure. |
rte_pressure | Out: The WSV with the same name. |
rte_temperature | Out: The WSV with the same name. |
rte_vmr_list | Out: The WSV with the same name. |
refr_index | Out: The WSV with the same name. |
refr_index_agenda | The WSV with the same name. |
p_grid | Pressure grid. |
z_field | Geometrical altitudes corresponding to p_grid. |
t_field | Temperatures corresponding to p_grid. |
vmr_field | VMR values corresponding to p_grid. |
r_geoid | Geoid radius. |
z_surface | Surface altitude. |
rtrace_method | String giving which ray tracing method to use. See the function for options. |
lraytrace | Maximum allowed length for ray tracing steps. |
lmax | Maximum allowed length between the path points. |
Definition at line 4714 of file ppath.cc.
References Ppath::constant, Ppath::dim, from_raytracingarrays_to_ppath_vectors_1d_and_2d(), get_refr_index_1d(), Ppath::np, ppath_append(), ppath_copy(), ppath_end_1d(), ppath_init_structure(), ppath_start_1d(), ppath_step_refr_1d(), raytrace_1d_linear_euler(), and refraction_ppc().
Referenced by ppath_step_refr_1d(), and ppath_stepRefractionEuler().
void ppath_step_refr_2d | ( | Workspace & | ws, |
Ppath & | ppath, | ||
Numeric & | rte_pressure, | ||
Numeric & | rte_temperature, | ||
Vector & | rte_vmr_list, | ||
Numeric & | refr_index, | ||
const Agenda & | refr_index_agenda, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstMatrixView | z_field, | ||
ConstMatrixView | t_field, | ||
ConstTensor3View | vmr_field, | ||
ConstVectorView | r_geoid, | ||
ConstVectorView | z_surface, | ||
const String & | rtrace_method, | ||
const double & | lraytrace, | ||
const double & | lmax | ||
) |
ppath_step_refr_2d
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.
ws | Current Workspace |
ppath | Out: A Ppath structure. |
rte_pressure | Out: The WSV with the same name. |
rte_temperature | Out: The WSV with the same name. |
rte_vmr_list | Out: The WSV with the same name. |
refr_index | Out: The WSV with the same name. |
refr_index_agenda | The WSV with the same name. |
p_grid | Pressure grid. |
lat_grid | Latitude grid. |
z_field | Geometrical altitudes. |
t_field | Atmospheric temperatures. |
vmr_field | VMR values. |
r_geoid | Geoid radii. |
z_surface | Surface altitudes. |
rtrace_method | String giving which ray tracing method to use. See the function for options. |
lraytrace | Maximum allowed length for ray tracing steps. |
lmax | Maximum allowed length between the path points. |
Definition at line 4857 of file ppath.cc.
References Ppath::dim, from_raytracingarrays_to_ppath_vectors_1d_and_2d(), Ppath::np, ppath_append(), ppath_copy(), ppath_end_2d(), ppath_init_structure(), ppath_start_2d(), ppath_step_refr_2d(), and raytrace_2d_linear_euler().
Referenced by ppath_step_refr_2d(), and ppath_stepRefractionEuler().
void ppath_step_refr_3d | ( | Workspace & | ws, |
Ppath & | ppath, | ||
Numeric & | rte_pressure, | ||
Numeric & | rte_temperature, | ||
Vector & | rte_vmr_list, | ||
Numeric & | refr_index, | ||
const Agenda & | refr_index_agenda, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstTensor3View | z_field, | ||
ConstTensor3View | t_field, | ||
ConstTensor4View | vmr_field, | ||
ConstMatrixView | r_geoid, | ||
ConstMatrixView | z_surface, | ||
const String & | rtrace_method, | ||
const double & | lraytrace, | ||
const double & | lmax | ||
) |
ppath_step_refr_3d
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.
ws | Current Workspace |
ppath | Out: A Ppath structure. |
rte_pressure | Out: The WSV with the same name. |
rte_temperature | Out: The WSV with the same name. |
rte_vmr_list | Out: The WSV with the same name. |
refr_index | Out: The WSV with the same name. |
refr_index_agenda | The WSV with the same name. |
p_grid | Pressure grid. |
lat_grid | Latitude grid. |
lon_grid | Longitude grid. |
z_field | Geometrical altitudes. |
t_field | Atmospheric temperatures. |
vmr_field | VMR values. |
r_geoid | Geoid radii. |
z_surface | Surface altitudes. |
rtrace_method | String giving which ray tracing method to use. See the function for options. |
lraytrace | Maximum allowed length for ray tracing steps. |
lmax | Maximum allowed length between the path points. |
Definition at line 4992 of file ppath.cc.
References Ppath::dim, from_raytracingarrays_to_ppath_vectors_3d(), Ppath::np, ppath_append(), ppath_copy(), ppath_end_3d(), ppath_init_structure(), ppath_start_3d(), ppath_step_refr_3d(), and raytrace_3d_linear_euler().
Referenced by ppath_step_refr_3d(), and ppath_stepRefractionEuler().
ppath_what_background
Returns the case number for the radiative background.
See further the function ppath_set_background.
ppath | A Ppath structure. |
Definition at line 2561 of file ppath.cc.
References Ppath::background.
Referenced by cloud_ppath_update1D(), cloud_ppath_update1D_noseq(), get_iy_of_background(), iwp_cloud_opt_pathCalc(), iyBeerLambertStandardCloudbox(), iyEmissionStandardClearsky(), iyFOS(), mcPathTraceGeneral(), ppath_append(), and ppath_calc().
void raytrace_1d_linear_euler | ( | Workspace & | ws, |
Array< double > & | r_array, | ||
Array< double > & | lat_array, | ||
Array< double > & | za_array, | ||
Array< double > & | l_array, | ||
Index & | endface, | ||
Index & | tanpoint, | ||
double | r, | ||
double | lat, | ||
double | za, | ||
Numeric & | rte_pressure, | ||
Numeric & | rte_temperature, | ||
Vector & | rte_vmr_list, | ||
Numeric & | refr_index, | ||
const Agenda & | refr_index_agenda, | ||
const double & | ppc, | ||
const double & | lraytrace, | ||
const double & | r1, | ||
const double & | r3, | ||
const double & | r_surface, | ||
const double & | r_geoid, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | z_field, | ||
ConstVectorView | t_field, | ||
ConstMatrixView | vmr_field | ||
) |
raytrace_1d_linear_euler
Performs ray tracing for 1D with linear Euler 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 exactly by the expression c = r*n*sin(theta), and a new step is taken. The length of the last ray tracing step to reach the end radius is adopted to the distance to the end radius.
The refractive index is assumed to vary linearly between the pressure levels.
As the ray tracing is performed from the last end point, the found path will not be symmetric around the tangent point.
For more information read the chapter on propagation paths in AUG. The algorithm used is described in that part of AUG.
The array variables r_array, lat_array and za_array shall include the start position when calling the function. The length of l_array will be one smaller than the length of the other arrays.
ws | Current Workspace |
r_array | Out: Radius of ray tracing points. |
lat_array | Out: Latitude of ray tracing points. |
za_array | Out: LOS zenith angle at ray tracing points. |
l_array | Out: Distance along the path between ray tracing points. |
endface | FIXME: Add documentation. |
tanpoint | FIXME: Add documentation. |
r | Start radius for ray tracing. |
lat | Start latitude for ray tracing. |
za | Start zenith angle for ray tracing. |
rte_pressure | FIXME: Add documentation. |
rte_temperature | FIXME: Add documentation. |
rte_vmr_list | FIXME: Add documentation. |
refr_index | Refractive index. |
refr_index_agenda | FIXME: Add documentation. |
ppc | Propagation path constant. |
lraytrace | Maximum allowed length for ray tracing steps. |
r1 | Radius of lower pressure level. |
r3 | Radius of upper pressure level (r3 > r1). |
r_surface | Radius of the surface. |
r_geoid | Geoid radii. |
p_grid | Pressure grid. |
z_field | Geometrical altitudes corresponding to p_grid. |
t_field | Temperatures corresponding to p_grid. |
vmr_field | VMR values corresponding to p_grid. |
Definition at line 4090 of file ppath.cc.
References abs, do_gridrange_1d(), geometrical_ppc(), geompath_l_at_r(), geompath_r_at_l(), geompath_za_at_r(), get_refr_index_1d(), ConstVectorView::nelem(), and RAD2DEG.
Referenced by ppath_step_refr_1d().
void raytrace_2d_linear_euler | ( | Workspace & | ws, |
Array< double > & | r_array, | ||
Array< double > & | lat_array, | ||
Array< double > & | za_array, | ||
Array< double > & | l_array, | ||
Index & | endface, | ||
Index & | tanpoint, | ||
double | r, | ||
double | lat, | ||
double | za, | ||
Numeric & | rte_pressure, | ||
Numeric & | rte_temperature, | ||
Vector & | rte_vmr_list, | ||
Numeric & | refr_index, | ||
const Agenda & | refr_index_agenda, | ||
const double & | lraytrace, | ||
const double & | lat1, | ||
const double & | lat3, | ||
const double & | r1a, | ||
const double & | r3a, | ||
const double & | r3b, | ||
const double & | r1b, | ||
const double & | rsurface1, | ||
const double & | rsurface3, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | r_geoid, | ||
ConstMatrixView | z_field, | ||
ConstMatrixView | t_field, | ||
ConstTensor3View | vmr_field | ||
) |
raytrace_2d_linear_euler
Performs ray tracing for 2D with linear Euler 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 to reach the end radius is adopted to the distance to the end radius.
The refractive index is assumed to vary linearly along the pressure levels and the latitude grid points.
For more information read the chapter on propagation paths in AUG. The algorithm used is described in that part of AUG.
The array variables r_array, lat_array and za_array shall include the start position when calling the function. The length of l_array will be one smaller than the length of the other arrays.
ws | Current Workspace |
r_array | Out: Radius of ray tracing points. |
lat_array | Out: Latitude of ray tracing points. |
za_array | Out: LOS zenith angle at ray tracing points. |
l_array | Out: Distance along the path between ray tracing points. |
endface | Out: Number coding of exit face. |
tanpoint | Out: True if last point is a tangent point. |
r | Out: Start radius for ray tracing. |
lat | Out: Start latitude for ray tracing. |
za | Out: Start zenith angle for ray tracing. |
rte_pressure | Out: The WSV with the same name. |
rte_temperature | Out: The WSV with the same name. |
rte_vmr_list | Out: The WSV with the same name. |
refr_index | Out: The WSV with the same name. |
refr_index_agenda | The WSV with the same name. |
lraytrace | Maximum allowed length for ray tracing steps. |
lat1 | Latitude of left end face of the grid cell. |
lat3 | Latitude of right end face of the grid cell. |
r1a | Radius of lower-left corner of the grid cell. |
r3a | Radius of lower-right corner of the grid cell. |
r3b | Radius of upper-right corner of the grid cell. |
r1b | Radius of upper-left corner of the grid cell. |
rsurface1 | Radius for the surface at lat1. |
rsurface3 | Radius for the surface at lat3. |
p_grid | The WSV with the same name. |
lat_grid | The WSV with the same name. |
r_geoid | The WSV with the same name. |
z_field | The WSV with the same name. |
t_field | The WSV with the same name. |
vmr_field | The WSV with the same name. |
Definition at line 4257 of file ppath.cc.
References abs, DEG2RAD, do_gridcell_2d(), geometrical_ppc(), geompath_l_at_r(), geompath_r_at_l(), ConstVectorView::nelem(), RAD2DEG, refr_gradients_2d(), and sign().
Referenced by ppath_step_refr_2d().
void raytrace_3d_linear_euler | ( | Workspace & | ws, |
Array< double > & | r_array, | ||
Array< double > & | lat_array, | ||
Array< double > & | lon_array, | ||
Array< double > & | za_array, | ||
Array< double > & | aa_array, | ||
Array< double > & | l_array, | ||
Index & | endface, | ||
Index & | tanpoint, | ||
double | r, | ||
double | lat, | ||
double | lon, | ||
double | za, | ||
double | aa, | ||
Numeric & | rte_pressure, | ||
Numeric & | rte_temperature, | ||
Vector & | rte_vmr_list, | ||
Numeric & | refr_index, | ||
const Agenda & | refr_index_agenda, | ||
const double & | lraytrace, | ||
const double & | lat1, | ||
const double & | lat3, | ||
const double & | lon5, | ||
const double & | lon6, | ||
const double & | r15a, | ||
const double & | r35a, | ||
const double & | r36a, | ||
const double & | r16a, | ||
const double & | r15b, | ||
const double & | r35b, | ||
const double & | r36b, | ||
const double & | r16b, | ||
const double & | rsurface15, | ||
const double & | rsurface35, | ||
const double & | rsurface36, | ||
const double & | rsurface16, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstMatrixView | r_geoid, | ||
ConstTensor3View | z_field, | ||
ConstTensor3View | t_field, | ||
ConstTensor4View | vmr_field | ||
) |
raytrace_3d_linear_euler
Performs ray tracing for 3D with linear Euler 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 to reach the end radius is adopted to the distance to the end radius.
The refractive index is assumed to vary linearly along the pressure levels and the latitude grid points.
For more information read the chapter on propagation paths in AUG. The algorithm used is described in that part of AUG.
The array variables r_array, lat_array, lon_array, za_array and aa_array shall include the start position when calling the function. The length of l_array will be one smaller than the length of the other arrays.
ws | Current Workspace |
r_array | Out: Radius of ray tracing points. |
lat_array | Out: Latitude of ray tracing points. |
lon_array | Out: Longitude of ray tracing points. |
za_array | Out: LOS zenith angle at ray tracing points. |
aa_array | Out: LOS azimuth angle at ray tracing points. |
l_array | Out: Distance along the path between ray tracing points. |
endface | Out: Number coding of exit face. |
tanpoint | Out: True if last point is a tangent point. |
r | Out: Start radius for ray tracing. |
lat | Out: Start latitude for ray tracing. |
lon | Out: Start longitude for ray tracing. |
za | Out: Start zenith angle for ray tracing. |
aa | Out: Start azimuth angle for ray tracing. |
rte_pressure | Out: The WSV with the same name. |
rte_temperature | Out: The WSV with the same name. |
rte_vmr_list | Out: The WSV with the same name. |
refr_index | Out: The WSV with the same name. |
refr_index_agenda | The WSV with the same name. |
lraytrace | Maximum allowed length for ray tracing steps. |
lat1 | Latitude of left end face of the grid cell. |
lat3 | Latitude of right end face of the grid cell. |
lon5 | Lower longitude of the grid cell. |
lon6 | Upper longitude of the grid cell. |
r15a | Radius of corner: lower p-level,lat1 and lon5. |
r35a | Radius of corner: lower p-level,lat3 and lon5. |
r36a | Radius of corner: lower p-level,lat3 and lon6. |
r16a | Radius of corner: lower p-level,lat1 and lon6. |
r15b | Radius of corner: upper p-level,lat1 and lon5. |
r35b | Radius of corner: upper p-level,lat3 and lon5. |
r36b | Radius of corner: upper p-level,lat3 and lon6. |
r16b | Radius of corner: upper p-level,lat1 and lon6. |
rsurface15 | Radius for the surface at lat1 and lon5. |
rsurface35 | Radius for the surface at lat3 and lon5. |
rsurface36 | Radius for the surface at lat3 and lon6. |
rsurface16 | Radius for the surface at lat1 and lon6. |
p_grid | The WSV with the same name. |
lat_grid | The WSV with the same name. |
lon_grid | The WSV with the same name. |
r_geoid | The WSV with the same name. |
z_field | The WSV with the same name. |
t_field | The WSV with the same name. |
vmr_field | The WSV with the same name. |
Definition at line 4465 of file ppath.cc.
References abs, ANGTOL, cart2poslos(), DEG2RAD, do_gridcell_3d(), dx, geometrical_ppc(), geompath_za_at_r(), ConstVectorView::nelem(), poslos2cart(), RAD2DEG, refr_gradients_3d(), and resolve_lon().
Referenced by ppath_step_refr_3d().
double refraction_ppc | ( | const double & | r, |
const double & | za, | ||
const double & | refr_index | ||
) |
refraction_ppc
Calculates the propagation path constant for cases with refraction.
Both positive and negative zenith angles are handled.
r | Radius. |
za | LOS Zenith angle. |
refr_index | Refractive index. |
Definition at line 2988 of file ppath.cc.
Referenced by ppath_step_refr_1d().
void resolve_lon | ( | double & | lon, |
const double & | lon5, | ||
const double & | lon6 | ||
) |
resolve_lon
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.
The function exists both in a float and double version to avoid unnecessary copying of data for Numeric=float.
lon | In/Out: Longitude, possible shifted when returned. |
lon5 | Lower limit of probable range for lon. |
lon6 | Upper limit of probable range for lon |
Definition at line 735 of file ppath.cc.
Referenced by do_gridcell_3d(), plevel_slope_3d(), ppath_start_stepping(), and raytrace_3d_linear_euler().
void resolve_lon | ( | float & | lon, |
const double & | lon5, | ||
const double & | lon6 | ||
) |
void rotationmat3D | ( | Matrix & | R, |
ConstVectorView | vrot, | ||
const Numeric & | a | ||
) |
rotationmat3D
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).
R | Out: Rotation matrix |
vrot | Rotation axis |
a | Rotation angle |
Definition at line 911 of file ppath.cc.
References DEG2RAD, ConstMatrixView::ncols(), ConstVectorView::nelem(), and ConstMatrixView::nrows().
Referenced by map_daa().
double rsurf_at_lat | ( | const double & | lat1, |
const double & | lat3, | ||
const double & | r1, | ||
const double & | r3, | ||
const double & | lat | ||
) |
rsurf_at_lat
Determines the radius of a pressure level or the surface given the radius at the corners of a 2D grid cell.
lat1 | Lower latitude of grid cell. |
lat3 | Upper latitude of grid cell. |
r1 | Radius at lat1 |
r3 | Radius at lat3 |
lat | Latitude for which radius shall be determined. |
Definition at line 1102 of file ppath.cc.
Referenced by ppath_start_2d().
double rsurf_at_latlon | ( | const double & | lat1, |
const double & | lat3, | ||
const double & | lon5, | ||
const double & | lon6, | ||
const double & | r15, | ||
const double & | r35, | ||
const double & | r36, | ||
const double & | r16, | ||
const double & | lat, | ||
const double & | lon | ||
) |
rsurf_at_latlon
Determines the radius of a pressure level or the surface given the radius at the corners of a 3D grid cell.
lat1 | Lower latitude of grid cell. |
lat3 | Upper latitude of grid cell. |
lon5 | Lower longitude of grid cell. |
lon6 | Upper longitude of grid cell. |
r15 | Radius at crossing of lat1 and lon5. |
r35 | Radius at crossing of lat3 and lon5. |
r36 | Radius at crossing of lat3 and lon6. |
r16 | Radius at crossing of lat1 and lon6. |
lat | Latitude for which radius shall be determined. |
lon | Longitude for which radius shall be determined. |
Definition at line 1133 of file ppath.cc.
Referenced by do_gridcell_3d(), plevel_slope_3d(), ppath_fill_3d(), and ppath_start_stepping().
void sph2cart | ( | double & | x, |
double & | y, | ||
double & | z, | ||
const double & | r, | ||
const double & | lat, | ||
const double & | lon | ||
) |
sph2cart
Conversion from spherical to cartesian coordinates.
The cartesian coordinate system is defined such as the x-axis goes along lat=0 and lon=0, y-axis goes along lat=90, and the z-axis goes along lat=0 and lon=90.
x | Out: x position. |
y | Out: y position. |
z | Out: z position. |
r | Radius. |
lat | Latitude. |
lon | Longitude. |
Definition at line 490 of file ppath.cc.
Referenced by poslos2cart().
double surfacetilt | ( | const Index & | atmosphere_dim, |
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstMatrixView | r_geoid, | ||
ConstMatrixView | z_surface, | ||
const GridPos & | gp_lat, | ||
const GridPos & | gp_lon, | ||
ConstVectorView | los | ||
) |
surfacetilt
Calculation fo the angular tilt of the surface
A combination of plevel_slope_xd and plevel_angletilt. To be used from other parts (externally from ppath part).
lat_grid | The latitude grid. |
lon_grid | The longitude grid. |
r_geoid | As the WSV with the same name. |
z_surf | Geometrical altitude of the surface, or the pressure level of interest. |
gp_lat | Latitude grid position for the position of interest. |
gp_lon | Longitude grid position for the position of interest. |
los | Line-of-sight (either before or after reflection) |
Definition at line 1348 of file ppath.cc.
References interp(), interpweights(), joker, plevel_angletilt(), plevel_slope_2d(), and plevel_slope_3d().
Referenced by get_iy_of_background().
double za_geom2other_point | ( | const double & | r1, |
const double & | lat1, | ||
const double & | r2, | ||
const double & | lat2 | ||
) |
za_geom2other_point
Calculates the zenith angle for the geometrical propagation path between two specified points.
The returned zenith angle is valid for point 1. That is, the propagation path goes from point 1 to point 2.
r1 | Radius for point 1. |
lat1 | Latiytude for point 1. |
r2 | Radius for point 2. |
lat2 | Latitude for point 2. |
void zaaa2cart | ( | double & | dx, |
double & | dy, | ||
double & | dz, | ||
const double & | za, | ||
const double & | aa | ||
) |
zaaa2cart
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
dx | Out: x-part of LOS unit vector. |
dy | Out: y-part of LOS unit vector. |
dz | Out: z-part of LOS unit vector. |
za | LOS zenith angle at observation position. |
aa | LOS azimuth angle at observation position. |
Definition at line 834 of file ppath.cc.
Referenced by map_daa().
const double ANGTOL = 1e-4 |
Definition at line 98 of file ppath.cc.
Referenced by cart2poslos(), do_gridcell_2d(), do_gridcell_3d(), geompath_from_r1_to_r2(), pha_mat_labCalc(), plevel_crossing_2d(), plevel_crossing_3d(), ppath_start_stepping(), and raytrace_3d_linear_euler().
|
extern |
const double LATLONTOL = 1e-6 |
Definition at line 84 of file ppath.cc.
Referenced by do_gridcell_3d().
const double POLELAT = 89.9999 |
Definition at line 105 of file ppath.cc.
Referenced by cart2poslos(), and poslos2cart().
const double PTILTMAX = 5 |
Definition at line 110 of file ppath.cc.
Referenced by ppath_start_3d().
|
extern |
const double RTOL = 10 |
Definition at line 75 of file ppath.cc.
Referenced by do_gridcell_2d(), do_gridcell_3d(), do_gridrange_1d(), geompath_l_at_r(), geompath_za_at_r(), ppath_start_2d(), and ppath_start_stepping().