ARTS 2.5.11 (git: 6827797f)
|
#include "geodetic.h"
#include <cmath>
#include <stdexcept>
#include "arts_conversions.h"
#include "math_funcs.h"
#include "ppath.h"
Go to the source code of this file.
Functions | |
void | cart2pol (Numeric &r, Numeric &lat, const Numeric &x, const Numeric &z, const Numeric &lat0, const Numeric &za0) |
cart2pol | |
void | cart2poslos (Numeric &r, Numeric &lat, Numeric &za, const Numeric &x, const Numeric &z, const Numeric &dx, const Numeric &dz, const Numeric &ppc, const Numeric &lat0, const Numeric &za0) |
cart2poslos | |
void | distance2D (Numeric &l, const Numeric &r1, const Numeric &lat1, const Numeric &r2, const Numeric &lat2) |
distance2D | |
void | line_circle_intersect (Numeric &x, Numeric &z, const Numeric &xl, const Numeric &zl, const Numeric &dx, const Numeric &dz, const Numeric &xc, const Numeric &zc, const Numeric &r) |
geomtanpoint2d | |
void | pol2cart (Numeric &x, Numeric &z, const Numeric &r, const Numeric &lat) |
pol2cart | |
void | poslos2cart (Numeric &x, Numeric &z, Numeric &dx, Numeric &dz, const Numeric &r, const Numeric &lat, const Numeric &za) |
poslos2cart | |
void | cart2poslos (Numeric &r, Numeric &lat, Numeric &lon, Numeric &za, Numeric &aa, const Numeric &x, const Numeric &y, const Numeric &z, const Numeric &dx, const Numeric &dy, const Numeric &dz, const Numeric &ppc, const Numeric &x0, const Numeric &y0, const Numeric &z0, const Numeric &lat0, const Numeric &lon0, const Numeric &za0, const Numeric &aa0) |
cart2poslos | |
void | cart2poslos_plain (Numeric &r, Numeric &lat, Numeric &lon, Numeric &za, Numeric &aa, const Numeric &x, const Numeric &y, const Numeric &z, const Numeric &dx, const Numeric &dy, const Numeric &dz) |
void | cart2sph (Numeric &r, Numeric &lat, Numeric &lon, const Numeric &x, const Numeric &y, const Numeric &z, const Numeric &lat0, const Numeric &lon0, const Numeric &za0, const Numeric &aa0) |
cart2sph | |
void | cart2sph_plain (Numeric &r, Numeric &lat, Numeric &lon, const Numeric &x, const Numeric &y, const Numeric &z) |
void | distance3D (Numeric &l, const Numeric &r1, const Numeric &lat1, const Numeric &lon1, const Numeric &r2, const Numeric &lat2, const Numeric &lon2) |
distance3D | |
void | geompath_tanpos_3d (Numeric &r_tan, Numeric &lat_tan, Numeric &lon_tan, Numeric &l_tan, const Numeric &r, const Numeric &lat, const Numeric &lon, const Numeric &za, const Numeric &aa, const Numeric &ppc) |
geompath_tanpos_3d | |
void | line_refellipsoid_intersect (Numeric &l, const Vector &refellipsoid, const Numeric &x, const Numeric &y, const Numeric &z, const Numeric &dx, const Numeric &dy, const Numeric &dz) |
geomtanpoint | |
void | line_sphere_intersect (Numeric &x, Numeric &y, Numeric &z, const Numeric &xl, const Numeric &yl, const Numeric &zl, const Numeric &dx, const Numeric &dy, const Numeric &dz, const Numeric &xc, const Numeric &yc, const Numeric &zc, const Numeric &r) |
line_sphere_intersect | |
void | latlon_at_aa (Numeric &lat2, Numeric &lon2, const Numeric &lat1, const Numeric &lon1, const Numeric &aa, const Numeric &ddeg) |
latlon_at_aa | |
void | los2xyz (Numeric &za, Numeric &aa, const Numeric &r1, const Numeric &lat1, const Numeric &lon1, const Numeric &x1, const Numeric &y1, const Numeric &z1, const Numeric &x2, const Numeric &y2, const Numeric &z2) |
los2xyz | |
void | poslos2cart (Numeric &x, Numeric &y, Numeric &z, Numeric &dx, Numeric &dy, Numeric &dz, const Numeric &r, const Numeric &lat, const Numeric &lon, const Numeric &za, const Numeric &aa) |
poslos2cart | |
Numeric | pos2refell_r (const Index &atmosphere_dim, ConstVectorView refellipsoid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstVectorView rte_pos) |
pos2refell_r | |
Numeric | refell2r (ConstVectorView refellipsoid, const Numeric &lat) |
refell2r | |
Numeric | refell2d (ConstVectorView refellipsoid, ConstVectorView lat_grid, const GridPos gp) |
refell2d | |
Numeric | sphdist (const Numeric &lat1, const Numeric &lon1, const Numeric &lat2, const Numeric &lon2) |
sphdist | |
void | sph2cart (Numeric &x, Numeric &y, Numeric &z, const Numeric &r, const Numeric &lat, const Numeric &lon) |
sph2cart | |
void | lon_shiftgrid (Vector &longrid_out, ConstVectorView longrid_in, const Numeric lon) |
lon_shiftgrid | |
void | cycle_lat_lon (Numeric &lat, Numeric &lon) |
Cyclic latitude longitude coordinates. | |
void | cart2geodetic (Numeric &h, Numeric &lat, Numeric &lon, const Numeric &x, const Numeric &y, const Numeric &z, const Vector &refellipsoid) |
Conversion from cartesian to geodetic coordinates. | |
void | geodetic2cart (Numeric &x, Numeric &y, Numeric &z, const Numeric &h, const Numeric &lat, const Numeric &lon, const Vector &refellipsoid) |
Conversion from geodetic to cartesian coordinates. | |
void | geodeticposlos2cart (Numeric &x, Numeric &y, Numeric &z, Numeric &dx, Numeric &dy, Numeric &dz, const Numeric &h, const Numeric &lat, const Numeric &lon, const Numeric &za, const Numeric &aa, const Vector &refellipsoid) |
geodeticposlos2cart | |
void | cart2geodeticposlos (Numeric &h, Numeric &lat, Numeric &lon, Numeric &za, Numeric &aa, const Numeric &x, const Numeric &y, const Numeric &z, const Numeric &dx, const Numeric &dy, const Numeric &dz, const Vector &refellipsoid) |
cart2geodeticposlos | |
Variables | |
constexpr Numeric | DEG2RAD =Conversion::deg2rad(1) |
constexpr Numeric | RAD2DEG =Conversion::rad2deg(1) |
This file contains functions associated with the reference ellipsoid, conversion between latitudes and similar stuff.
Definition in file geodetic.cc.
void cart2geodetic | ( | Numeric & | h, |
Numeric & | lat, | ||
Numeric & | lon, | ||
const Numeric & | x, | ||
const Numeric & | y, | ||
const Numeric & | z, | ||
const Vector & | refellipsoid | ||
) |
Conversion from cartesian to geodetic coordinates.
Definition at line 1457 of file geodetic.cc.
References cart2sph_plain(), and RAD2DEG.
Referenced by cart2geodeticposlos().
void cart2geodeticposlos | ( | Numeric & | h, |
Numeric & | lat, | ||
Numeric & | lon, | ||
Numeric & | za, | ||
Numeric & | aa, | ||
const Numeric & | x, | ||
const Numeric & | y, | ||
const Numeric & | z, | ||
const Numeric & | dx, | ||
const Numeric & | dy, | ||
const Numeric & | dz, | ||
const Vector & | refellipsoid | ||
) |
cart2geodeticposlos
The inverse of geodeticposlos2cart.
h | Out: Geodetic altitude. |
lat | Out: Geodetic latitude |
lon | Out: Longitude |
za | Out: LOS zenith angle |
aa | Out: LOS azimuth angle |
x | x-coordinate |
y | y-coordinate |
z | z-coordinate |
dx | x-part of LOS unit vector. |
dy | y-part of LOS unit vector. |
dz | z-part of LOS unit vector. |
Definition at line 1621 of file geodetic.cc.
References cart2geodetic(), DEG2RAD, and enu2zaaa().
Referenced by y_geoToGeodetic().
void cart2pol | ( | Numeric & | r, |
Numeric & | lat, | ||
const Numeric & | x, | ||
const Numeric & | z, | ||
const Numeric & | lat0, | ||
const Numeric & | za0 | ||
) |
cart2pol
The inverse of pol2cart.
A 2D version of cart2sph
r | Out: Radius of position. |
lat | Out: Latitude of position. |
x | x-coordinate of position. |
z | z-coordinate of position. |
lat0 | Original latitude. |
za0 | Original zenith angle. |
Definition at line 57 of file geodetic.cc.
References ANGTOL, and RAD2DEG.
Referenced by defocusing_general_sub(), and do_gridcell_2d_byltest().
void cart2poslos | ( | Numeric & | r, |
Numeric & | lat, | ||
Numeric & | lon, | ||
Numeric & | za, | ||
Numeric & | aa, | ||
const Numeric & | x, | ||
const Numeric & | y, | ||
const Numeric & | z, | ||
const Numeric & | dx, | ||
const Numeric & | dy, | ||
const Numeric & | dz, | ||
const Numeric & | ppc, | ||
const Numeric & | x0, | ||
const Numeric & | y0, | ||
const Numeric & | z0, | ||
const Numeric & | lat0, | ||
const Numeric & | lon0, | ||
const Numeric & | za0, | ||
const Numeric & | aa0 | ||
) |
cart2poslos
The inverse of poslos2cart.
Beside the cartesian coordinates (x,y,z,dx,dy,dz), the function takes as input information about the original position and LOS. The later data are used to improve the accuracy. For example, for zenith and nadir cases it is ensured that the latitude and longitude are not changed. This makes the function slower, but accuarcy is favoured as zenith, nadir, north and south line-of-sights are especially tricky as they can go along a grid box boundary and the smallest rounding error can move the path from one grid box to the neighbouring one.
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. |
ppc | Propagation path constant (r*sin(za)) |
lat0 | Original latitude. |
lon0 | Original longitude. |
za0 | Original zenith angle. |
aa0 | Original azimuth angle. |
Definition at line 404 of file geodetic.cc.
References ANGTOL, DEG2RAD, geompath_l_at_r(), POLELAT, and RAD2DEG.
void cart2poslos | ( | Numeric & | r, |
Numeric & | lat, | ||
Numeric & | za, | ||
const Numeric & | x, | ||
const Numeric & | z, | ||
const Numeric & | dx, | ||
const Numeric & | dz, | ||
const Numeric & | ppc, | ||
const Numeric & | lat0, | ||
const Numeric & | za0 | ||
) |
cart2poslos
2D version of the 3D cart2poslos.
r | Out: Radius of observation position. |
lat | Out: Latitude of observation position. |
za | Out: LOS zenith angle at observation position. |
x | x-coordinate of observation position. |
z | z-coordinate of observation position. |
dx | x-part of LOS unit vector. |
dz | z-part of LOS unit vector. |
ppc | Propagation path constant (r*sin(za)) |
lat0 | Original latitude. |
za0 | Original zenith angle. |
Definition at line 96 of file geodetic.cc.
References ANGTOL, DEG2RAD, and RAD2DEG.
Referenced by do_gridcell_2d_byltest(), do_gridcell_3d_byltest(), ppath_start_stepping(), and raytrace_3d_linear_basic().
void cart2poslos_plain | ( | Numeric & | r, |
Numeric & | lat, | ||
Numeric & | lon, | ||
Numeric & | za, | ||
Numeric & | aa, | ||
const Numeric & | x, | ||
const Numeric & | y, | ||
const Numeric & | z, | ||
const Numeric & | dx, | ||
const Numeric & | dy, | ||
const Numeric & | dz | ||
) |
Definition at line 525 of file geodetic.cc.
References cart2sph_plain(), DEG2RAD, and RAD2DEG.
Referenced by IntersectionGeometricalWithAltitude(), sensor_poslosFromECEF(), and sensor_poslosFromGeodetic().
void cart2sph | ( | Numeric & | r, |
Numeric & | lat, | ||
Numeric & | lon, | ||
const Numeric & | x, | ||
const Numeric & | y, | ||
const Numeric & | z, | ||
const Numeric & | lat0, | ||
const Numeric & | lon0, | ||
const Numeric & | za0, | ||
const Numeric & | aa0 | ||
) |
cart2sph
The inverse of sph2cart.
For definition of lat0, lon0, za0 and aa0, see cart2poslos.
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. |
lat0 | Original latitude. |
lon0 | Original longitude. |
za0 | Original zenith angle. |
aa0 | Original azimuth angle. |
Definition at line 585 of file geodetic.cc.
References ANGTOL, POLELAT, and RAD2DEG.
Referenced by defocusing_general_sub(), do_gridcell_3d_byltest(), geompath_tanpos_3d(), and sunsAddSingleFromGridAtLocation().
void cart2sph_plain | ( | Numeric & | r, |
Numeric & | lat, | ||
Numeric & | lon, | ||
const Numeric & | x, | ||
const Numeric & | y, | ||
const Numeric & | z | ||
) |
Definition at line 624 of file geodetic.cc.
References RAD2DEG.
Referenced by cart2geodetic(), cart2poslos_plain(), sensor_poslosFromECEF(), and sensor_poslosFromGeodetic().
void cycle_lat_lon | ( | Numeric & | lat, |
Numeric & | lon | ||
) |
Cyclic latitude longitude coordinates.
Definition at line 1415 of file geodetic.cc.
References ARTS_USER_ERROR_IF.
Referenced by TelsemAtlas::calc_cellnum_nearest_neighbor().
void distance2D | ( | Numeric & | l, |
const Numeric & | r1, | ||
const Numeric & | lat1, | ||
const Numeric & | r2, | ||
const Numeric & | lat2 | ||
) |
distance2D
The distance between two 2D points.
The two latitudes can deviate with max 180 degrees.
l | Out: The distance |
r1 | Radius of position 1 |
lat1 | Latitude of position 1 |
r2 | Radius of position 2 |
lat2 | Latitude of position 2 |
Definition at line 165 of file geodetic.cc.
References ARTS_ASSERT, and pol2cart().
Referenced by defocusing_general().
void distance3D | ( | Numeric & | l, |
const Numeric & | r1, | ||
const Numeric & | lat1, | ||
const Numeric & | lon1, | ||
const Numeric & | r2, | ||
const Numeric & | lat2, | ||
const Numeric & | lon2 | ||
) |
distance3D
The distance between two 3D points.
l | Out: The distance |
r1 | Radius of position 1 |
lat1 | Latitude of position 1 |
lon1 | Longitude of position 1 |
r2 | Radius of position 2 |
lat2 | Latitude of position 2 |
lon2 | Longitude of position 2 |
Definition at line 652 of file geodetic.cc.
References sph2cart().
Referenced by defocusing_general(), DisortCalc(), DisortCalcIrradiance(), DisortCalcWithARTSSurface(), and get_direct_radiation().
void geodetic2cart | ( | Numeric & | x, |
Numeric & | y, | ||
Numeric & | z, | ||
const Numeric & | h, | ||
const Numeric & | lat, | ||
const Numeric & | lon, | ||
const Vector & | refellipsoid | ||
) |
Conversion from geodetic to cartesian coordinates.
Definition at line 1504 of file geodetic.cc.
References a, DEG2RAD, and sph2cart().
Referenced by geodeticposlos2cart(), and sensor_poslosFromGeodetic().
void geodeticposlos2cart | ( | Numeric & | x, |
Numeric & | y, | ||
Numeric & | z, | ||
Numeric & | dx, | ||
Numeric & | dy, | ||
Numeric & | dz, | ||
const Numeric & | h, | ||
const Numeric & | lat, | ||
const Numeric & | lon, | ||
const Numeric & | za, | ||
const Numeric & | aa, | ||
const Vector & | refellipsoid | ||
) |
geodeticposlos2cart
As poslos2cart but starts with geodetic position and LOS.
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. |
h | Geodetic altitude of observation position. |
lat | Geodetic 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 1549 of file geodetic.cc.
References ARTS_ASSERT, DEG2RAD, geodetic2cart(), POLELAT, sign(), and zaaa2enu().
Referenced by sensor_poslosFromGeodetic().
void geompath_tanpos_3d | ( | Numeric & | r_tan, |
Numeric & | lat_tan, | ||
Numeric & | lon_tan, | ||
Numeric & | l_tan, | ||
const Numeric & | r, | ||
const Numeric & | lat, | ||
const Numeric & | lon, | ||
const Numeric & | za, | ||
const Numeric & | aa, | ||
const Numeric & | 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 | Geometrical propagation path constant. |
Definition at line 689 of file geodetic.cc.
References ARTS_ASSERT, cart2sph(), and poslos2cart().
void latlon_at_aa | ( | Numeric & | lat2, |
Numeric & | lon2, | ||
const Numeric & | lat1, | ||
const Numeric & | lon1, | ||
const Numeric & | aa, | ||
const Numeric & | ddeg | ||
) |
latlon_at_aa
Destination point given distance and bearing from start point
Calculates the latitude and longitide, given a position, an azimuth angle and an angular distance.
lat2 | Latitude of end position. |
lon2 | Longitude of end position. |
lat1 | Latitude of start position. |
lon1 | Longitude of start position. |
aa | Azimuth/bearing at start point. |
ddeg | Angular distance (in degrees). |
Definition at line 996 of file geodetic.cc.
References DEG2RAD, and RAD2DEG.
Referenced by plevel_slope_3d().
void line_circle_intersect | ( | Numeric & | x, |
Numeric & | z, | ||
const Numeric & | xl, | ||
const Numeric & | zl, | ||
const Numeric & | dx, | ||
const Numeric & | dz, | ||
const Numeric & | xc, | ||
const Numeric & | zc, | ||
const Numeric & | r | ||
) |
geomtanpoint2d
Position of the tangent point for 3D cases.
Calculates the 3D geometrical tangent point for arbitrary reference ellipsiod. That is, a spherical planet is not assumed. The tangent point is thus defined as the point closest to the ellipsoid (not as the ppoint with za=90).
Geocentric coordinates are used for both sensor and tangent point positions.
The algorithm used for non-spherical cases is derived by Nick Lloyd at University of Saskatchewan, Canada (nick..nosp@m.lloy.nosp@m.d@usa.nosp@m.sk.c.nosp@m.a), and is part of the operational code for both OSIRIS and SMR on-board- the Odin satellite.
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. |
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. |
Find the intersection between a line and a circle
x | Out: X-coordinate of intersection |
z | Out: Z-coordinate of intersection |
xl | A x-coordinate on the line |
zl | A z-coordinate on the line |
dx | X-component of line direction vector |
dz | Z-component of line direction vector |
xc | X-coordinate of sphere origo |
zc | Z-coordinate of sphere origo |
r | Radius of sphere |
Definition at line 261 of file geodetic.cc.
void line_refellipsoid_intersect | ( | Numeric & | l, |
const Vector & | refellipsoid, | ||
const Numeric & | x, | ||
const Numeric & | y, | ||
const Numeric & | z, | ||
const Numeric & | dx, | ||
const Numeric & | dy, | ||
const Numeric & | dz | ||
) |
geomtanpoint
Position of the tangent point for 3D cases.
Calculates the 3D geometrical tangent point for arbitrary reference ellipsiod. That is, a spherical planet is not assumed. The tangent point is thus defined as the point closest to the ellipsoid (not as the ppoint with za=90).
Geocentric coordinates are used for both sensor and tangent point positions.
The algorithm used for non-spherical cases is derived by Nick Lloyd at University of Saskatchewan, Canada (nick..nosp@m.lloy.nosp@m.d@usa.nosp@m.sk.c.nosp@m.a), and is part of the operational code for both OSIRIS and SMR on-board- the Odin satellite.
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. |
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. |
Find the intersection between a line and the reference ellipsoid
A negative distance is returned if there is no intersection.
If you the zenith angle and the reference ellipsoid is spherical, use the function geompath_l_at_r instead.
l | Out: Distance to intersection |
refell | Vector defining reference ellipsoid |
xl | A x-coordinate on the line |
yl | A y-coordinate on the line |
zl | A z-coordinate on the line |
dx | X-component of line direction vector |
dy | Y-component of line direction vector |
dz | Z-component of line direction vector |
Definition at line 857 of file geodetic.cc.
Referenced by IntersectionGeometricalWithAltitude().
void line_sphere_intersect | ( | Numeric & | x, |
Numeric & | y, | ||
Numeric & | z, | ||
const Numeric & | xl, | ||
const Numeric & | yl, | ||
const Numeric & | zl, | ||
const Numeric & | dx, | ||
const Numeric & | dy, | ||
const Numeric & | dz, | ||
const Numeric & | xc, | ||
const Numeric & | yc, | ||
const Numeric & | zc, | ||
const Numeric & | r | ||
) |
line_sphere_intersect
Find the intersection between a line and a sphere
x | Out: X-coordinate of intersection |
y | Out: Y-coordinate of intersection |
z | Out: Z-coordinate of intersection |
xl | A x-coordinate on the line |
yl | A y-coordinate on the line |
zl | A z-coordinate on the line |
dx | X-component of line direction vector |
dy | Y-component of line direction vector |
dz | Z-component of line direction vector |
xc | X-coordinate of sphere origo |
yc | Y-coordinate of sphere origo |
zc | Z-coordinate of sphere origo |
r | Radius of sphere |
Definition at line 936 of file geodetic.cc.
void lon_shiftgrid | ( | Vector & | longrid_out, |
ConstVectorView | longrid_in, | ||
const Numeric | lon | ||
) |
lon_shiftgrid
Shifting longitude grid by +/- 360 to the same region as a given longitude.
Longitudes are allowed to be in [-360,360], but only covering at maximum 360 degrees at once. Different variables might be specified in different spaces of the allowed range. lon_shiftgrid shifts the longitude grid to the same space as the lon value. However, no check is done that lon is indeed within the range of longrid_out (only same region).
longrid_out | Out: shifted longitude grid. |
longrid_in | Original longitude grid. |
lon | A longitude value. |
Definition at line 1391 of file geodetic.cc.
Referenced by InterpGriddedField2ToPosition(), InterpSurfaceTypeMask(), surface_complex_refr_indexFromGriddedField5(), surface_reflectivityFromGriddedField6(), and surface_scalar_reflectivityFromGriddedField4().
void los2xyz | ( | Numeric & | za, |
Numeric & | aa, | ||
const Numeric & | r1, | ||
const Numeric & | lat1, | ||
const Numeric & | lon1, | ||
const Numeric & | x1, | ||
const Numeric & | y1, | ||
const Numeric & | z1, | ||
const Numeric & | x2, | ||
const Numeric & | y2, | ||
const Numeric & | z2 | ||
) |
los2xyz
Line-of-sight to another position given in cartesian coordinates.
Calculates the zenith and azimuth angle for the geomrical path from position 1 to position 2.
za | Out: LOS zenith angle at position 1. |
aa | Out: LOS azimuth angle at position 1. |
r | Radius of position 1. |
lat | Latitude of position 1. |
lon | Longitude of position 1. |
x1 | x-coordinate of position 1. |
y1 | y-coordinate of position 1. |
z1 | z-coordinate of position 1. |
x2 | x-coordinate of position 2. |
y2 | y-coordinate of position 2. |
z2 | z-coordinate of position 2. |
Definition at line 1042 of file geodetic.cc.
void pol2cart | ( | Numeric & | x, |
Numeric & | z, | ||
const Numeric & | r, | ||
const Numeric & | lat | ||
) |
pol2cart
Conversion from polar to cartesian coordinates.
The cartesian coordinate system is defined such as the x-axis goes along lat=0 and lon=0 and z-axis goes along lat=90.
x | Out: x position. |
z | Out: z position. |
r | Radius. |
lat | Latitude. |
Definition at line 314 of file geodetic.cc.
References ARTS_ASSERT, and DEG2RAD.
Referenced by distance2D().
Numeric pos2refell_r | ( | const Index & | atmosphere_dim, |
ConstVectorView | refellipsoid, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
ConstVectorView | rte_pos | ||
) |
pos2refell_r
Extracts the reference ellipsoid for the specified position.
The reference ellipsoid radius is defined slightly differently inside and outside of the model atmosphere. See refell2r. This function takes care of all those aspects.
If you know the latitude grid position of rte_pos, it is faster to use refell2d*.
atmosphere_dim | In: As the WSV with same name. |
refellipsoid | In: As the WSV with same name. |
lat_grid | In: As the WSV with same name. |
lon_grid | In: As the WSV with same name. |
rte_pos | In: As the WSV with same name. |
Definition at line 1194 of file geodetic.cc.
References ARTS_ASSERT, gridpos(), last(), refell2d(), and refell2r().
Referenced by get_direct_radiation(), get_sun_ppaths(), and IntersectionGeometricalWithAltitude().
void poslos2cart | ( | Numeric & | x, |
Numeric & | y, | ||
Numeric & | z, | ||
Numeric & | dx, | ||
Numeric & | dy, | ||
Numeric & | dz, | ||
const Numeric & | r, | ||
const Numeric & | lat, | ||
const Numeric & | lon, | ||
const Numeric & | za, | ||
const Numeric & | 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 1110 of file geodetic.cc.
References ARTS_ASSERT, DEG2RAD, POLELAT, and sign().
void poslos2cart | ( | Numeric & | x, |
Numeric & | z, | ||
Numeric & | dx, | ||
Numeric & | dz, | ||
const Numeric & | r, | ||
const Numeric & | lat, | ||
const Numeric & | za | ||
) |
poslos2cart
2D version of poslos2cart
x | Out: x-coordinate of observation position. |
z | Out: z-coordinate of observation position. |
dx | Out: x-part of LOS unit vector. |
dz | Out: z-part of LOS unit vector. |
r | Radius of observation position. |
lat | Latitude of observation position. |
za | LOS zenith angle at observation position. |
Definition at line 338 of file geodetic.cc.
References ARTS_ASSERT, and DEG2RAD.
Referenced by defocusing_general_sub(), do_gridcell_2d_byltest(), do_gridcell_3d_byltest(), geompath_tanpos_3d(), get_sun_radiation(), IntersectionGeometricalWithAltitude(), ppath_start_stepping(), raytrace_3d_linear_basic(), sunsAddSingleFromGridAtLocation(), and y_geoToGeodetic().
Numeric refell2d | ( | ConstVectorView | refellipsoid, |
ConstVectorView | lat_grid, | ||
const GridPos | gp | ||
) |
refell2d
Reference ellipsoid radius for points inside 2D and 3D atmospheres.
To be consistent with the ppath calculations, the ellipsoid radius shall be treated to vary linear between the latitude grid points. This function performs this operation. The latitude position is specified by its grid position (gp).
refellipsoid | In: As the WSV with same name. |
lat_grid | In: As the WSV with same name. |
gp | In: Latitude grid position. |
Definition at line 1287 of file geodetic.cc.
References GridPos::fd, GridPos::idx, and refell2r().
Referenced by get_refr_index_2d(), get_refr_index_3d(), pos2refell_r(), ppath_start_stepping(), and specular_losCalc().
Numeric refell2r | ( | ConstVectorView | refellipsoid, |
const Numeric & | lat | ||
) |
refell2r
Reference ellipsoid radius, directly from refellipsoid.
Gives the distance from the Earth's centre and the reference ellipsoid as a function of geoCENTRIC latitude.
For 1D, extract r directly as refellipsoid[0] to save time.
This is the basic function to calculate the reference ellipsoid radius. However, inside the atmosphere this radius is just used at the positions of the lat_grid. A linear interpolation is applied between these points. This is handled by other functions. For 2D and 3D and the grid position is known, use refell2d. The function pos2refell_r handles all this in a general way (but not always the fastest option).
refellipsoid | In: As the WSV with same name. |
latitude | In: A geoecentric latitude. |
Definition at line 1248 of file geodetic.cc.
References ARTS_ASSERT, b, c, DEG2RAD, and v.
Referenced by cloud_ppath_update3D(), defocusing_general(), DisortCalc(), DisortCalcIrradiance(), DisortCalcWithARTSSurface(), get_direct_radiation(), get_sun_radiation(), plevel_slope_2d(), plevel_slope_3d(), pos2refell_r(), ppath_end_2d(), ppath_end_3d(), ppath_start_2d(), ppath_start_3d(), ppath_start_stepping(), refell2d(), refellipsoidOrbitPlane(), sensor_poslosFromECEF(), sensor_poslosFromGeodetic(), sunsAddSingleFromGridAtLocation(), and y_geoToGeodetic().
void sph2cart | ( | Numeric & | x, |
Numeric & | y, | ||
Numeric & | z, | ||
const Numeric & | r, | ||
const Numeric & | lat, | ||
const Numeric & | 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, the z-axis goes along lat=0 and lon=90, and z-axis goes along lat=90.
x | Out: x position. |
y | Out: y position. |
z | Out: z position. |
r | Radius. |
lat | Latitude. |
lon | Longitude. |
Definition at line 1349 of file geodetic.cc.
References ARTS_ASSERT, and DEG2RAD.
Referenced by distance3D(), geodetic2cart(), and get_sun_radiation().
Numeric sphdist | ( | const Numeric & | lat1, |
const Numeric & | lon1, | ||
const Numeric & | lat2, | ||
const Numeric & | lon2 | ||
) |
sphdist
The distance between two geograpgical positions
"As-the-crow-flies" angular distance between two points, specified by their latitude and longitude.
Note that angular distance is returned. The distance in length varies with altitude.
lat1 | Latitude of position 1. |
lon1 | Longitude of position 1. |
lat2 | Latitude of position 2. |
lon2 | Longitude of position 2. |
Definition at line 1318 of file geodetic.cc.
References a, DEG2RAD, and RAD2DEG.
Referenced by bending_angle1d(), surfaceTelsem(), and telsemStandalone().
|
inlineconstexpr |
Definition at line 25 of file geodetic.cc.
Referenced by cart2geodeticposlos(), cart2poslos(), cart2poslos_plain(), geodetic2cart(), geodeticposlos2cart(), latlon_at_aa(), los2xyz(), pol2cart(), poslos2cart(), refell2r(), sph2cart(), and sphdist().
|
inlineconstexpr |
Definition at line 26 of file geodetic.cc.
Referenced by cart2geodetic(), cart2pol(), cart2poslos(), cart2poslos_plain(), cart2sph(), cart2sph_plain(), latlon_at_aa(), los2xyz(), and sphdist().