ARTS 2.5.11 (git: 6827797f)
m_geodetic.cc File Reference

Workspace functions of geodetic character. More...

#include <cmath>
#include <stdexcept>
#include "arts.h"
#include "arts_conversions.h"
#include "auto_md.h"
#include "check_input.h"
#include "geodetic.h"
#include "matpack_data.h"
#include "messages.h"

Go to the source code of this file.

Functions

void refellipsoidForAzimuth (Vector &refellipsoid, const Numeric &latitude, const Numeric &azimuth, const Verbosity &)
 WORKSPACE METHOD: refellipsoidForAzimuth.
 
void refellipsoidOrbitPlane (Vector &refellipsoid, const Numeric &orbitinc, const Verbosity &)
 WORKSPACE METHOD: refellipsoidOrbitPlane.
 
void refellipsoidSet (Vector &refellipsoid, const Numeric &re, const Numeric &e, const Verbosity &)
 WORKSPACE METHOD: refellipsoidSet.
 
void rte_poslosFromECEF (Vector &rte_pos, Vector &rte_los, const Matrix &sensor_pos_ecef, const Matrix &sensor_los_ecef, const Vector &refellipsoid, const Verbosity &v)
 WORKSPACE METHOD: rte_poslosFromECEF.
 
void rte_poslosFromGeodetic (Vector &rte_pos, Vector &rte_los, const Matrix &sensor_pos_geodetic, const Matrix &sensor_los_geodetic, const Vector &refellipsoid, const Verbosity &v)
 WORKSPACE METHOD: rte_poslosFromGeodetic.
 
void sensor_poslosFromECEF (Matrix &sensor_pos, Matrix &sensor_los, const Matrix &sensor_pos_ecef, const Matrix &sensor_los_ecef, const Vector &refellipsoid, const Verbosity &)
 WORKSPACE METHOD: sensor_poslosFromECEF.
 
void sensor_poslosFromGeodetic (Matrix &sensor_pos, Matrix &sensor_los, const Matrix &sensor_pos_geodetic, const Matrix &sensor_los_geodetic, const Vector &refellipsoid, const Verbosity &)
 WORKSPACE METHOD: sensor_poslosFromGeodetic.
 
void y_geoToGeodetic (Matrix &y_geo, const Vector &refellipsoid, const Verbosity &)
 WORKSPACE METHOD: y_geoToGeodetic.
 
void IntersectionGeometricalWithAltitude (Matrix &pos, Matrix &los, const Matrix &sensor_pos, const Matrix &sensor_los, const Vector &refellipsoid, const Vector &lat_grid, const Vector &lon_grid, const Numeric &altitude, const Verbosity &)
 WORKSPACE METHOD: IntersectionGeometricalWithAltitude.
 

Variables

constexpr Numeric DEG2RAD =Conversion::deg2rad(1)
 

Detailed Description

Workspace functions of geodetic character.

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

These functions are listed in the doxygen documentation as entries of the file auto_md.h.

Definition in file m_geodetic.cc.

Function Documentation

◆ IntersectionGeometricalWithAltitude()

void IntersectionGeometricalWithAltitude ( Matrix &  pos,
Matrix &  los,
const Matrix &  sensor_pos,
const Matrix &  sensor_los,
const Vector &  refellipsoid,
const Vector &  lat_grid,
const Vector &  lon_grid,
const Numeric &  altitude,
const Verbosity verbosity 
)

WORKSPACE METHOD: IntersectionGeometricalWithAltitude.

Calculates the geometrical intersection with an altitude.

This method only handles 3D !!! For non-spherical geoids the altitude obtained in sensor_pos can deviate a bit from the GIN altitude if the position is outside of lat_grid, due to the internal handling of the geoid. Improvements around this are planned, but not clear when they will be in place.

For each observation geometry specified by the combination of sensor_pos* and sensor_los, the geometrical intersection with an altitude is determined. The intersections are described by the GOUT pos and *los.

For cases with no intersection, pos and los are filled with NaN.

The GOUT pos and los can NOT be sensor_pos and sensor_los. If you want to store the intersections in sensor_pos and sensor_los use sensor_pos_losForwardToAltitude. For rte_pos and rte_los you have rte_pos_losForwardToAltitude.

Author
Patrick Eriksson
Parameters
[out]posGeneric output
[out]losGeneric output
[in]sensor_posWS Input
[in]sensor_losWS Input
[in]refellipsoidWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]altitudeGeneric Input (Default: "0")

Definition at line 297 of file m_geodetic.cc.

References ARTS_USER_ERROR_IF, cart2poslos_plain(), line_refellipsoid_intersect(), pos2refell_r(), and poslos2cart().

Referenced by IntersectionGeometricalWithAltitude_g(), and surface_rtpropFromTypesAverage().

◆ refellipsoidForAzimuth()

void refellipsoidForAzimuth ( Vector &  refellipsoid,
const Numeric &  latitude,
const Numeric &  azimuth,
const Verbosity verbosity 
)

WORKSPACE METHOD: refellipsoidForAzimuth.

Conversion of 3D ellipsoid to 1D curvature radius.

Calculates the curvature radius for the given latitude and azimuth angle, and uses this to set a spherical reference ellipsoid suitable for 1D calculations. The curvature radius is a better local approximation than using the local ellipsoid radius.

The used expression assumes a geodetic latitude, but also latitudes should be OK as using this method anyhow signifies an approximation.

Author
Patrick Eriksson
Parameters
[in,out]refellipsoidWS Input/Output
[in]latitudeGeneric Input
[in]azimuthGeneric Input

Definition at line 37 of file m_geodetic.cc.

References a, ARTS_USER_ERROR_IF, DEG2RAD, and v.

Referenced by refellipsoidForAzimuth_g().

◆ refellipsoidOrbitPlane()

void refellipsoidOrbitPlane ( Vector &  refellipsoid,
const Numeric &  orbitinc,
const Verbosity verbosity 
)

WORKSPACE METHOD: refellipsoidOrbitPlane.

Conversion of 3D ellipsoid to 2D orbit track geometry.

Determines an approximate reference ellipsoid following an orbit track. The new ellipsoid is determined simply, by determining the radius at the maximum latitude and from this value calculate a new new eccentricity. The orbit is specified by giving the orbit inclination (orbitinc), that is normally a value around 100 deg for polar sun-synchronous orbits.

Author
Patrick Eriksson
Parameters
[in,out]refellipsoidWS Input/Output
[in]orbitincGeneric Input

Definition at line 62 of file m_geodetic.cc.

References ARTS_USER_ERROR_IF, chk_if_in_range(), and refell2r().

Referenced by refellipsoidOrbitPlane_g().

◆ refellipsoidSet()

void refellipsoidSet ( Vector &  refellipsoid,
const Numeric &  re,
const Numeric &  e,
const Verbosity verbosity 
)

WORKSPACE METHOD: refellipsoidSet.

Manual setting of the reference ellipsoid.

The two values of refellipsoid can here be set manually. The two arguments correspond directly to first and second element of refellipsoid*.

Author
Patrick Eriksson
Parameters
[out]refellipsoidWS Output
[in]reGeneric Input
[in]eGeneric Input (Default: "0")

Definition at line 79 of file m_geodetic.cc.

Referenced by refellipsoidSet_g().

◆ rte_poslosFromECEF()

void rte_poslosFromECEF ( Vector &  rte_pos,
Vector &  rte_los,
const Matrix &  sensor_pos_ecef,
const Matrix &  sensor_los_ecef,
const Vector &  refellipsoid,
const Verbosity verbosity 
)

WORKSPACE METHOD: rte_poslosFromECEF.

Converts sensor position and LOS from ECEF to geocentric values.

Works exactly as sensor_poslosFromECEF but places the output in rte_pos and rte_los. Accordingly, the input can only cover one combination of position and LOS.

Author
Patrick Eriksson
Parameters
[out]rte_posWS Output
[out]rte_losWS Output
[in]sensor_pos_ecefWS Input
[in]sensor_los_ecefWS Input
[in]refellipsoidWS Input

Definition at line 92 of file m_geodetic.cc.

References ARTS_USER_ERROR_IF, sensor_poslosFromECEF(), and v.

Referenced by rte_poslosFromECEF_g().

◆ rte_poslosFromGeodetic()

void rte_poslosFromGeodetic ( Vector &  rte_pos,
Vector &  rte_los,
const Matrix &  sensor_pos_geodetic,
const Matrix &  sensor_los_geodetic,
const Vector &  refellipsoid,
const Verbosity verbosity 
)

WORKSPACE METHOD: rte_poslosFromGeodetic.

Converts sensor position and LOS from geodetic to geocentric values.

Works exactly as sensor_poslosFromGeodetic but places the output in rte_pos and rte_los. Accordingly, the input can only cover one combination of position and LOS.

Author
Patrick Eriksson
Parameters
[out]rte_posWS Output
[out]rte_losWS Output
[in]sensor_pos_geodeticWS Input
[in]sensor_los_geodeticWS Input
[in]refellipsoidWS Input

Definition at line 118 of file m_geodetic.cc.

References ARTS_USER_ERROR_IF, sensor_poslosFromGeodetic(), and v.

Referenced by rte_poslosFromGeodetic_g().

◆ sensor_poslosFromECEF()

void sensor_poslosFromECEF ( Matrix &  sensor_pos,
Matrix &  sensor_los,
const Matrix &  sensor_pos_ecef,
const Matrix &  sensor_los_ecef,
const Vector &  refellipsoid,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_poslosFromECEF.

Converts sensor position and LOS from ECEF to geocentric values.

The geodetic position and line-of-sight (LOS) are defined by sensor_pos_ecef* and sensor_los_ecef. The later WSV is here allowed to be empty (but gives an empty sensor_los). Otherwise the number of rows in the two WSVs must agree.

So far only 3D is handled.

Author
Patrick Eriksson
Parameters
[out]sensor_posWS Output
[out]sensor_losWS Output
[in]sensor_pos_ecefWS Input
[in]sensor_los_ecefWS Input
[in]refellipsoidWS Input

Definition at line 144 of file m_geodetic.cc.

References ARTS_USER_ERROR_IF, cart2poslos_plain(), cart2sph_plain(), and refell2r().

Referenced by rte_poslosFromECEF(), and sensor_poslosFromECEF_g().

◆ sensor_poslosFromGeodetic()

void sensor_poslosFromGeodetic ( Matrix &  sensor_pos,
Matrix &  sensor_los,
const Matrix &  sensor_pos_geodetic,
const Matrix &  sensor_los_geodetic,
const Vector &  refellipsoid,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_poslosFromGeodetic.

Converts sensor position and LOS from geodetic to geocentric values.

The geodetic position and line-of-sight (LOS) are defined by sensor_pos_geodetic* and sensor_los_geodetic. The later WSV is here allowed to be empty (but gives an empty sensor_los). Otherwise the number of rows in the two WSVs must agree.

So far only 3D is handled.

Author
Patrick Eriksson
Parameters
[out]sensor_posWS Output
[out]sensor_losWS Output
[in]sensor_pos_geodeticWS Input
[in]sensor_los_geodeticWS Input
[in]refellipsoidWS Input

Definition at line 202 of file m_geodetic.cc.

References ARTS_USER_ERROR_IF, cart2poslos_plain(), cart2sph_plain(), geodetic2cart(), geodeticposlos2cart(), and refell2r().

Referenced by rte_poslosFromGeodetic(), and sensor_poslosFromGeodetic_g().

◆ y_geoToGeodetic()

void y_geoToGeodetic ( Matrix &  y_geo,
const Vector &  refellipsoid,
const Verbosity verbosity 
)

WORKSPACE METHOD: y_geoToGeodetic.

Converts y_geo to hold geodetic values.

Replaces geocentric values with corresponding geodetic ones.

Author
Patrick Eriksson
Parameters
[in,out]y_geoWS Input/Output
[in]refellipsoidWS Input

Definition at line 273 of file m_geodetic.cc.

References cart2geodeticposlos(), poslos2cart(), and refell2r().

Referenced by y_geoToGeodetic_g().

Variable Documentation

◆ DEG2RAD

constexpr Numeric DEG2RAD =Conversion::deg2rad(1)
inlineconstexpr

Definition at line 30 of file m_geodetic.cc.

Referenced by refellipsoidForAzimuth().