ARTS 2.5.0 (git: 9ee3ac6c)
geodetic.h File Reference
#include "interpolation.h"
#include "matpackI.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 More...
 
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 More...
 
void distance2D (Numeric &l, const Numeric &r1, const Numeric &lat1, const Numeric &r2, const Numeric &lat2)
 distance2D More...
 
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 More...
 
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 More...
 
void pol2cart (Numeric &x, Numeric &z, const Numeric &r, const Numeric &lat)
 pol2cart More...
 
void poslos2cart (Numeric &x, Numeric &z, Numeric &dx, Numeric &dz, const Numeric &r, const Numeric &lat, const Numeric &za)
 poslos2cart More...
 
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 More...
 
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 More...
 
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 More...
 
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 More...
 
void latlon_at_aa (Numeric &lat2, Numeric &lon2, const Numeric &lat1, const Numeric &lon1, const Numeric &aa, const Numeric &ddeg)
 latlon_at_aa More...
 
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 More...
 
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 More...
 
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 More...
 
Numeric pos2refell_r (const Index &atmosphere_dim, ConstVectorView refellipsoid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstVectorView rte_pos)
 pos2refell_r More...
 
Numeric refell2r (ConstVectorView refellipsoid, const Numeric &lat)
 refell2r More...
 
Numeric refell2d (ConstVectorView refellipsoid, ConstVectorView lat_grid, const GridPos gp)
 refell2d More...
 
Numeric sphdist (const Numeric &lat1, const Numeric &lon1, const Numeric &lat2, const Numeric &lon2)
 sphdist More...
 
void sph2cart (Numeric &x, Numeric &y, Numeric &z, const Numeric &r, const Numeric &lat, const Numeric &lon)
 sph2cart More...
 
void lon_shiftgrid (Vector &longrid_out, ConstVectorView longrid_in, const Numeric lon)
 lon_shiftgrid More...
 
void cycle_lat_lon (Numeric &lat, Numeric &lon)
 Cyclic latitude longitude coordinates. More...
 
void geodetic2cart (Numeric &x, Numeric &y, Numeric &z, const Numeric &h, const Numeric &lat_gd, const Numeric &lon_gd, const Vector &refellipsoid)
 Conversion from geodetic to cartesian coordinates. More...
 
void geodeticposlos2cart (Numeric &x, Numeric &y, Numeric &z, Numeric &dx, Numeric &dy, Numeric &dz, const Numeric &h, const Numeric &lat_gd, const Numeric &lon_gd, const Numeric &za, const Numeric &aa, const Vector &refellipsoid)
 geodeticposlos2cart More...
 
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 More...
 

Detailed Description

Author
Patrick Eriksson Patri.nosp@m.ck.E.nosp@m.rikss.nosp@m.on@c.nosp@m.halme.nosp@m.rs.s.nosp@m.e
Date
2012-02-06

This file contains definitions of internal functions of geodetic character.

Definition in file geodetic.h.

Function Documentation

◆ 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.

Parameters
hOut: Geodetic altitude.
latOut: Geodetic latitude
lonOut: Longitude
zaOut: LOS zenith angle
aaOut: LOS azimuth angle
xx-coordinate
yy-coordinate
zz-coordinate
dxx-part of LOS unit vector.
dyy-part of LOS unit vector.
dzz-part of LOS unit vector.
Author
Patrick Eriksson
Date
2020-09-17

Definition at line 1638 of file geodetic.cc.

◆ cart2pol()

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

Parameters
rOut: Radius of position.
latOut: Latitude of position.
xx-coordinate of position.
zz-coordinate of position.
lat0Original latitude.
za0Original zenith angle.
Author
Patrick Eriksson
Date
2012-03-20

Definition at line 74 of file geodetic.cc.

References abs, ANGTOL, RAD2DEG, and sqrt().

Referenced by defocusing_general_sub(), do_gridcell_2d_byltest(), and ppathFromRtePos2().

◆ cart2poslos() [1/2]

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.

Parameters
rOut: Radius of observation position.
latOut: Latitude of observation position.
lonOut: Longitude of observation position.
zaOut: LOS zenith angle at observation position.
aaOut: LOS azimuth angle at observation position.
xx-coordinate of observation position.
yy-coordinate of observation position.
zz-coordinate of observation position.
dxx-part of LOS unit vector.
dyy-part of LOS unit vector.
dzz-part of LOS unit vector.
ppcPropagation path constant (r*sin(za))
lat0Original latitude.
lon0Original longitude.
za0Original zenith angle.
aa0Original azimuth angle.
Author
Patrick Eriksson
Date
2002-12-30

Definition at line 421 of file geodetic.cc.

References abs, ANGTOL, DEG2RAD, dx, geompath_l_at_r(), nonstd::isnan(), Interpolation::l(), POLELAT, pow(), IGRF::r0, RAD2DEG, and sqrt().

◆ cart2poslos() [2/2]

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.

Parameters
rOut: Radius of observation position.
latOut: Latitude of observation position.
zaOut: LOS zenith angle at observation position.
xx-coordinate of observation position.
zz-coordinate of observation position.
dxx-part of LOS unit vector.
dzz-part of LOS unit vector.
ppcPropagation path constant (r*sin(za))
lat0Original latitude.
za0Original zenith angle.
Author
Patrick Eriksson
Date
2012-03-21

Definition at line 113 of file geodetic.cc.

References abs, ANGTOL, DEG2RAD, dx, nonstd::isnan(), RAD2DEG, and sqrt().

Referenced by do_gridcell_2d_byltest(), do_gridcell_3d_byltest(), ppath_start_stepping(), ppathFromRtePos2(), and raytrace_3d_linear_basic().

◆ cart2poslos_plain()

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 542 of file geodetic.cc.

References cart2sph_plain(), DEG2RAD, dx, nonstd::isnan(), and RAD2DEG.

Referenced by sensor_poslosFromECEF().

◆ cart2sph()

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.

Parameters
rOut: Radius of observation position.
latOut: Latitude of observation position.
lonOut: Longitude of observation position.
xx-coordinate of observation position.
yy-coordinate of observation position.
zz-coordinate of observation position.
lat0Original latitude.
lon0Original longitude.
za0Original zenith angle.
aa0Original azimuth angle.
Author
Patrick Eriksson
Date
2002-12-30

Definition at line 602 of file geodetic.cc.

References abs, ANGTOL, POLELAT, RAD2DEG, and sqrt().

Referenced by defocusing_general_sub(), do_gridcell_3d_byltest(), geompath_tanpos_3d(), ppathFromRtePos2(), and surf_radius_at_l().

◆ cart2sph_plain()

void cart2sph_plain ( Numeric r,
Numeric lat,
Numeric lon,
const Numeric x,
const Numeric y,
const Numeric z 
)

Definition at line 641 of file geodetic.cc.

References RAD2DEG, and sqrt().

Referenced by cart2poslos_plain(), and sensor_poslosFromECEF().

◆ cycle_lat_lon()

void cycle_lat_lon ( Numeric lat,
Numeric lon 
)

Cyclic latitude longitude coordinates.

Definition at line 1432 of file geodetic.cc.

References ARTS_USER_ERROR_IF.

Referenced by TelsemAtlas::calc_cellnum_nearest_neighbor().

◆ distance2D()

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.

Parameters
lOut: The distance
r1Radius of position 1
lat1Latitude of position 1
r2Radius of position 2
lat2Latitude of position 2
Author
Patrick Eriksson
Date
2012-03-20

Definition at line 182 of file geodetic.cc.

References abs, and ARTS_ASSERT.

Referenced by defocusing_general(), and ppathFromRtePos2().

◆ distance3D()

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.

Parameters
lOut: The distance
r1Radius of position 1
lat1Latitude of position 1
lon1Longitude of position 1
r2Radius of position 2
lat2Latitude of position 2
lon2Longitude of position 2
Author
Patrick Eriksson
Date
2012-03-20

Definition at line 669 of file geodetic.cc.

Referenced by defocusing_general(), and ppathFromRtePos2().

◆ geodetic2cart()

void geodetic2cart ( Numeric x,
Numeric y,
Numeric z,
const Numeric h,
const Numeric lat_gd,
const Numeric lon_gd,
const Vector refellipsoid 
)

Conversion from geodetic to cartesian coordinates.

Definition at line 1521 of file geodetic.cc.

◆ geodeticposlos2cart()

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.

Parameters
xOut: x-coordinate of observation position.
yOut: y-coordinate of observation position.
zOut: z-coordinate of observation position.
dxOut: x-part of LOS unit vector.
dyOut: y-part of LOS unit vector.
dzOut: z-part of LOS unit vector.
hGeodetic altitude of observation position.
latGeodetic latitude of observation position.
lonLongitude of observation position.
zaLOS zenith angle at observation position.
aaLOS azimuth angle at observation position.
Author
Patrick Eriksson
Date
2020-09-17

Definition at line 1566 of file geodetic.cc.

◆ geompath_tanpos_3d()

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.

Parameters
r_tanOut: Radius of tangent point.
lat_tanOut: Latitude of tangent point.
lon_tanOut: Longitude of tangent point.
l_tanOut: Distance along path to the tangent point.
rRadius of observation position.
latLatitude of observation position.
lonLongitude of observation position.
zaLOS zenith angle at observation position.
aaLOS azimuth angle at observation position.
ppcGeometrical propagation path constant.
Author
Patrick Eriksson
Date
2002-12-31

Definition at line 706 of file geodetic.cc.

References ARTS_ASSERT, cart2sph(), dx, poslos2cart(), and sqrt().

◆ latlon_at_aa()

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.

Parameters
lat2Latitude of end position.
lon2Longitude of end position.
lat1Latitude of start position.
lon1Longitude of start position.
aaAzimuth/bearing at start point.
ddegAngular distance (in degrees).
Author
Patrick Eriksson
Date
2012-04-23

Definition at line 1013 of file geodetic.cc.

References DEG2RAD, and RAD2DEG.

◆ line_circle_intersect()

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.

Parameters
r_tanOut: Radius of tangent point.
lat_tanOut: Latitude of tangent point.
lon_tanOut: Longitude of tangent point.
rRadius of observation position.
latLatitude of observation position.
lonLongitude of observation position.
zaLOS zenith angle at observation position.
aaLOS azimuth angle at observation position.
Author
Patrick Eriksson
Date
2012-02-12 line_circle_intersect

Find the intersection between a line and a circle

Parameters
xOut: X-coordinate of intersection
zOut: Z-coordinate of intersection
xlA x-coordinate on the line
zlA z-coordinate on the line
dxX-component of line direction vector
dzZ-component of line direction vector
xcX-coordinate of sphere origo
zcZ-coordinate of sphere origo
rRadius of sphere
Author
Patrick Eriksson
Date
2012-03-30

Definition at line 278 of file geodetic.cc.

References a, a2, ARTS_ASSERT, b, b2, c, d, and dx.

Referenced by ppathFromRtePos2().

◆ line_refellipsoid_intersect()

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.

Parameters
r_tanOut: Radius of tangent point.
lat_tanOut: Latitude of tangent point.
lon_tanOut: Longitude of tangent point.
rRadius of observation position.
latLatitude of observation position.
lonLongitude of observation position.
zaLOS zenith angle at observation position.
aaLOS azimuth angle at observation position.
Author
Patrick Eriksson
Date
2012-02-12 line_refellipsoid_intersect

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.

Parameters
lOut: Distance to intersection
refellVector defining reference ellipsoid
xlA x-coordinate on the line
ylA y-coordinate on the line
zlA z-coordinate on the line
dxX-component of line direction vector
dyY-component of line direction vector
dzZ-component of line direction vector
Author
Patrick Eriksson
Date
2012-03-30

Definition at line 874 of file geodetic.cc.

◆ line_sphere_intersect()

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

Parameters
xOut: X-coordinate of intersection
yOut: Y-coordinate of intersection
zOut: Z-coordinate of intersection
xlA x-coordinate on the line
ylA y-coordinate on the line
zlA z-coordinate on the line
dxX-component of line direction vector
dyY-component of line direction vector
dzZ-component of line direction vector
xcX-coordinate of sphere origo
ycY-coordinate of sphere origo
zcZ-coordinate of sphere origo
rRadius of sphere
Author
Patrick Eriksson
Date
2012-03-30

Definition at line 953 of file geodetic.cc.

References a, a2, ARTS_ASSERT, b, b2, c, d, and dx.

Referenced by ppathFromRtePos2().

◆ lon_shiftgrid()

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).

Parameters
longrid_outOut: shifted longitude grid.
longrid_inOriginal longitude grid.
lonA longitude value.
Author
Jana Mendrok
Date
2012-06-28

Definition at line 1408 of file geodetic.cc.

References ConstVectorView::nelem().

Referenced by InterpGriddedField2ToPosition(), surface_complex_refr_indexFromGriddedField5(), surface_reflectivityFromGriddedField6(), surface_scalar_reflectivityFromGriddedField4(), and surface_typeInterpTypeMask().

◆ los2xyz()

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.

Parameters
zaOut: LOS zenith angle at position 1.
aaOut: LOS azimuth angle at position 1.
rRadius of position 1.
latLatitude of position 1.
lonLongitude of position 1.
x1x-coordinate of position 1.
y1y-coordinate of position 1.
z1z-coordinate of position 1.
x2x-coordinate of position 2.
y2y-coordinate of position 2.
z2z-coordinate of position 2.
Author
Patrick Eriksson
Date
2012-03-26

Definition at line 1059 of file geodetic.cc.

◆ pol2cart()

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.

Parameters
xOut: x position.
zOut: z position.
rRadius.
latLatitude.
Author
Patrick Eriksson
Date
2012-03-20

Definition at line 331 of file geodetic.cc.

References ARTS_ASSERT, and DEG2RAD.

Referenced by ppathFromRtePos2().

◆ pos2refell_r()

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*.

Returns
Ellispoid radius
Parameters
atmosphere_dimIn: As the WSV with same name.
refellipsoidIn: As the WSV with same name.
lat_gridIn: As the WSV with same name.
lon_gridIn: As the WSV with same name.
rte_posIn: As the WSV with same name.
Author
Patrick Eriksson
Date
2012-03-27

Definition at line 1211 of file geodetic.cc.

References ARTS_ASSERT, gridpos(), last(), ConstVectorView::nelem(), refell2d(), and refell2r().

Referenced by ppathFromRtePos2(), and rte_losGeometricFromRtePosToRtePos2().

◆ poslos2cart() [1/2]

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.

Parameters
xOut: x-coordinate of observation position.
yOut: y-coordinate of observation position.
zOut: z-coordinate of observation position.
dxOut: x-part of LOS unit vector.
dyOut: y-part of LOS unit vector.
dzOut: z-part of LOS unit vector.
rRadius of observation position.
latLatitude of observation position.
lonLongitude of observation position.
zaLOS zenith angle at observation position.
aaLOS azimuth angle at observation position.
Author
Patrick Eriksson
Date
2002-12-30

Definition at line 1127 of file geodetic.cc.

References abs, ARTS_ASSERT, DEG2RAD, dx, POLELAT, and sign().

◆ poslos2cart() [2/2]

void poslos2cart ( Numeric x,
Numeric z,
Numeric dx,
Numeric dz,
const Numeric r,
const Numeric lat,
const Numeric za 
)

poslos2cart

2D version of poslos2cart

Parameters
xOut: x-coordinate of observation position.
zOut: z-coordinate of observation position.
dxOut: x-part of LOS unit vector.
dzOut: z-part of LOS unit vector.
rRadius of observation position.
latLatitude of observation position.
zaLOS zenith angle at observation position.
Author
Patrick Eriksson
Date
2012-03-20

Definition at line 355 of file geodetic.cc.

References ARTS_ASSERT, DEG2RAD, and dx.

Referenced by defocusing_general_sub(), do_gridcell_2d_byltest(), do_gridcell_3d_byltest(), geompath_tanpos_3d(), ppath_start_stepping(), ppathFromRtePos2(), and raytrace_3d_linear_basic().

◆ refell2d()

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).

Returns
Ellispoid radius
Parameters
refellipsoidIn: As the WSV with same name.
lat_gridIn: As the WSV with same name.
gpIn: Latitude grid position.
Author
Patrick Eriksson
Date
2012-02-09

Definition at line 1304 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(), specular_losCalc(), and surf_radius_at_l().

◆ refell2r()

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).

Returns
Ellispoid radius
Parameters
refellipsoidIn: As the WSV with same name.
latitudeIn: A geoecentric latitude.
Author
Patrick Eriksson
Date
2012-02-07

Definition at line 1265 of file geodetic.cc.

References ARTS_ASSERT, and ConstVectorView::nelem().

Referenced by cloud_ppath_update3D(), defocusing_general(), 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(), and sensor_poslosFromECEF().

◆ sph2cart()

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.

Parameters
xOut: x position.
yOut: y position.
zOut: z position.
rRadius.
latLatitude.
lonLongitude.
Author
Patrick Eriksson
Date
2002-12-17

Definition at line 1366 of file geodetic.cc.

References abs, ARTS_ASSERT, and DEG2RAD.

Referenced by ppathFromRtePos2().

◆ sphdist()

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.

Returns
Angular distance (in degrees)
Parameters
lat1Latitude of position 1.
lon1Longitude of position 1.
lat2Latitude of position 2.
lon2Longitude of position 2.
Author
Patrick Eriksson
Date
2012-04-05

Definition at line 1335 of file geodetic.cc.

References a, DEG2RAD, RAD2DEG, and sqrt().

Referenced by surfaceTelsem(), and telsemStandalone().