ARTS  2.3.1285(git:92a29ea9-dirty)
m_ppath.cc File Reference

Workspace functions releated to propagation paths variables. More...

#include <cmath>
#include "arts.h"
#include "auto_md.h"
#include "check_input.h"
#include "geodetic.h"
#include "lin_alg.h"
#include "m_general.h"
#include "m_xml.h"
#include "math_funcs.h"
#include "messages.h"
#include "ppath.h"
#include "refraction.h"
#include "special_interp.h"
#include "xml_io.h"

Go to the source code of this file.

Functions

void AddZaAa (Matrix &new_los, const Vector &ref_los, const Matrix &dlos, const Verbosity &)
 WORKSPACE METHOD: AddZaAa. More...
 
void DiffZaAa (Matrix &dlos, const Vector &ref_los, const Matrix &other_los, const Verbosity &)
 WORKSPACE METHOD: DiffZaAa. More...
 
void geo_posEndOfPpath (Vector &geo_pos, const Ppath &ppath, const Verbosity &verbosity)
 WORKSPACE METHOD: geo_posEndOfPpath. More...
 
void geo_posLowestAltitudeOfPpath (Vector &geo_pos, const Ppath &ppath, const Verbosity &verbosity)
 WORKSPACE METHOD: geo_posLowestAltitudeOfPpath. More...
 
void geo_posWherePpathPassesZref (Vector &geo_pos, const Ppath &ppath, const Numeric &z_ref, const Verbosity &verbosity)
 WORKSPACE METHOD: geo_posWherePpathPassesZref. More...
 
void ppathCalc (Workspace &ws, Ppath &ppath, const Agenda &ppath_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Index &atmgeom_checked, const Vector &f_grid, const Index &cloudbox_on, const Index &cloudbox_checked, const Index &ppath_inside_cloudbox_do, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Verbosity &)
 WORKSPACE METHOD: ppathCalc. More...
 
void ppathCalcFromAltitude (Workspace &ws, Ppath &ppath, const Agenda &ppath_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Index &atmgeom_checked, const Vector &f_grid, const Index &cloudbox_on, const Index &cloudbox_checked, const Index &ppath_inside_cloudbox_do, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Numeric &altitude, const Numeric &accuracy, const Verbosity &verbosity)
 WORKSPACE METHOD: ppathCalcFromAltitude. More...
 
void ppathFromRtePos2 (Workspace &ws, Ppath &ppath, Vector &rte_los, Numeric &ppath_lraytrace, const Agenda &ppath_step_agenda, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Vector &f_grid, const Vector &refellipsoid, const Matrix &z_surface, const Vector &rte_pos, const Vector &rte_pos2, const Numeric &ppath_lmax, const Numeric &za_accuracy, const Numeric &pplrt_factor, const Numeric &pplrt_lowest, const Verbosity &verbosity)
 WORKSPACE METHOD: ppathFromRtePos2. More...
 
void ppathPlaneParallel (Ppath &ppath, const Index &atmosphere_dim, const Tensor3 &z_field, const Matrix &z_surface, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Index &ppath_inside_cloudbox_do, const Vector &rte_pos, const Vector &rte_los, const Numeric &ppath_lmax, const Verbosity &)
 WORKSPACE METHOD: ppathPlaneParallel. More...
 
void ppathStepByStep (Workspace &ws, Ppath &ppath, const Agenda &ppath_step_agenda, const Index &ppath_inside_cloudbox_do, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Vector &f_grid, const Vector &refellipsoid, const Matrix &z_surface, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Vector &rte_pos, const Vector &rte_los, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Verbosity &verbosity)
 WORKSPACE METHOD: ppathStepByStep. More...
 
void ppathWriteXMLPartial (const String &file_format, const Ppath &ppath, const String &f, const Index &file_index, const Verbosity &verbosity)
 WORKSPACE METHOD: ppathWriteXMLPartial. More...
 
void ppath_fieldFromDownUpLimbGeoms (Workspace &ws, ArrayOfPpath &ppath_field, const Agenda &ppath_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Index &atmgeom_checked, const Tensor3 &z_field, const Vector &f_grid, const Index &cloudbox_on, const Index &cloudbox_checked, const Index &ppath_inside_cloudbox_do, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Vector &refellipsoid, const Index &atmosphere_dim, const Index &zenith_angles_per_position, const Verbosity &verbosity)
 WORKSPACE METHOD: ppath_fieldFromDownUpLimbGeoms. More...
 
void ppath_fieldCalc (Workspace &ws, ArrayOfPpath &ppath_field, const Agenda &ppath_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Index &atmgeom_checked, const Vector &f_grid, const Index &cloudbox_on, const Index &cloudbox_checked, const Index &ppath_inside_cloudbox_do, const Matrix &sensor_pos, const Matrix &sensor_los, const Vector &rte_pos2, const Verbosity &verbosity)
 WORKSPACE METHOD: ppath_fieldCalc. More...
 
void ppath_stepGeometric (Ppath &ppath_step, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Vector &refellipsoid, const Matrix &z_surface, const Numeric &ppath_lmax, const Verbosity &)
 WORKSPACE METHOD: ppath_stepGeometric. More...
 
void ppath_stepRefractionBasic (Workspace &ws, Ppath &ppath_step, const Agenda &refr_index_air_agenda, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Tensor3 &t_field, const Tensor4 &vmr_field, const Vector &refellipsoid, const Matrix &z_surface, const Vector &f_grid, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Verbosity &)
 WORKSPACE METHOD: ppath_stepRefractionBasic. More...
 
void rte_losSet (Vector &rte_los, const Index &atmosphere_dim, const Numeric &za, const Numeric &aa, const Verbosity &)
 WORKSPACE METHOD: rte_losSet. More...
 
void rte_losGeometricFromRtePosToRtePos2 (Vector &rte_los, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Vector &refellipsoid, const Vector &rte_pos, const Vector &rte_pos2, const Verbosity &)
 WORKSPACE METHOD: rte_losGeometricFromRtePosToRtePos2. More...
 
void rte_posSet (Vector &rte_pos, const Index &atmosphere_dim, const Numeric &z, const Numeric &lat, const Numeric &lon, const Verbosity &)
 WORKSPACE METHOD: rte_posSet. More...
 
void rte_pos_losMoveToStartOfPpath (Vector &rte_pos, Vector &rte_los, const Index &atmosphere_dim, const Ppath &ppath, const Verbosity &)
 WORKSPACE METHOD: rte_pos_losMoveToStartOfPpath. More...
 
void sensor_losGeometricFromSensorPosToOtherPositions (Matrix &sensor_los, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Vector &refellipsoid, const Matrix &sensor_pos, const Matrix &target_pos, const Verbosity &verbosity)
 WORKSPACE METHOD: sensor_losGeometricFromSensorPosToOtherPositions. More...
 
void TangentPointExtract (Vector &tan_pos, const Ppath &ppath, const Verbosity &)
 WORKSPACE METHOD: TangentPointExtract. More...
 
void TangentPointPrint (const Ppath &ppath, const Index &level, const Verbosity &verbosity)
 WORKSPACE METHOD: TangentPointPrint. More...
 
void VectorZtanToZaRefr1D (Workspace &ws, Vector &za_vector, const Agenda &refr_index_air_agenda, const Matrix &sensor_pos, const Vector &p_grid, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const Vector &refellipsoid, const Index &atmosphere_dim, const Vector &f_grid, const Vector &ztan_vector, const Verbosity &)
 WORKSPACE METHOD: VectorZtanToZaRefr1D. More...
 
void VectorZtanToZa1D (Vector &za_vector, const Matrix &sensor_pos, const Vector &refellipsoid, const Index &atmosphere_dim, const Vector &ztan_vector, const Verbosity &)
 WORKSPACE METHOD: VectorZtanToZa1D. More...
 

Variables

const Numeric RAD2DEG
 
const Numeric DEG2RAD
 

Detailed Description

Workspace functions releated to propagation paths variables.

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
2002-05-08

The file includes special functions to set the sensor position and LOS, and functions for calculation of propagation paths.

Definition in file m_ppath.cc.

Function Documentation

◆ AddZaAa()

void AddZaAa ( Matrix new_los,
const Vector ref_los,
const Matrix dlos,
const Verbosity verbosity 
)

WORKSPACE METHOD: AddZaAa.

Adds zenith and azimuth angles.

Adds up line-of-sights (LOS). In short, dlos is added to ref_los, assuming that a unit changes in zenith and azimuth are equal where dlos=(0,0).

Author
Patrick Eriksson
Parameters
[out]new_losGeneric output
[in]ref_losGeneric Input
[in]dlosGeneric Input

Definition at line 56 of file m_ppath.cc.

References add_za_aa(), i, ConstMatrixView::ncols(), ConstVectorView::nelem(), ConstMatrixView::nrows(), and Matrix::resize().

Referenced by AddZaAa_g().

◆ DiffZaAa()

void DiffZaAa ( Matrix dlos,
const Vector ref_los,
const Matrix other_los,
const Verbosity verbosity 
)

WORKSPACE METHOD: DiffZaAa.

Derives the difference betwenn zenith and azimuth angles.

Determines the difference between a set of angles (other_los) and a reference direction (ref_los). This method reverses the addition made by AddZaAa.

Author
Patrick Eriksson
Parameters
[out]dlosGeneric output
[in]ref_losGeneric Input
[in]other_losGeneric Input

Definition at line 79 of file m_ppath.cc.

References diff_za_aa(), i, ConstMatrixView::ncols(), ConstVectorView::nelem(), ConstMatrixView::nrows(), and Matrix::resize().

Referenced by DiffZaAa_g().

◆ geo_posEndOfPpath()

void geo_posEndOfPpath ( Vector geo_pos,
const Ppath ppath,
const Verbosity verbosity 
)

WORKSPACE METHOD: geo_posEndOfPpath.

Sets geo-position based on ppath.

The geo-position is set to the position of the last point of the present propagation path. This will be the surface, top-of-the atmosphere or cloudbox position, depending of observation geometry and if the cloudbox is active.

Author
Patrick Eriksson
Parameters
[out]geo_posWS Output
[in]ppathWS Input

Definition at line 103 of file m_ppath.cc.

References CREATE_OUT2, Ppath::los, ConstMatrixView::ncols(), Ppath::np, Ppath::pos, and Vector::resize().

Referenced by geo_posEndOfPpath_g().

◆ geo_posLowestAltitudeOfPpath()

void geo_posLowestAltitudeOfPpath ( Vector geo_pos,
const Ppath ppath,
const Verbosity verbosity 
)

WORKSPACE METHOD: geo_posLowestAltitudeOfPpath.

Sets geo-position based on ppath.

The geo-position is set to the position of the last point of the present propagation path having the lowest altitude.

Author
Patrick Eriksson
Parameters
[out]geo_posWS Output
[in]ppathWS Input

Definition at line 119 of file m_ppath.cc.

References CREATE_OUT2, i, Ppath::los, ConstMatrixView::ncols(), Ppath::np, Ppath::pos, and Vector::resize().

Referenced by geo_posLowestAltitudeOfPpath_g().

◆ geo_posWherePpathPassesZref()

void geo_posWherePpathPassesZref ( Vector geo_pos,
const Ppath ppath,
const Numeric z_ref,
const Verbosity verbosity 
)

WORKSPACE METHOD: geo_posWherePpathPassesZref.

Sets geo-position based on ppath.

The geo-position is set to the position where the propagation path passes the reference altitude. If this altitude is passes more than once, the passing closest to the sensor is selected. If the reference altitude is not passed at all, geo_pos is set to NaN.

Author
Patrick Eriksson
Parameters
[out]geo_posWS Output
[in]ppathWS Input
[in]z_refGeneric Input

Definition at line 145 of file m_ppath.cc.

References CREATE_OUT2, Ppath::los, ConstMatrixView::ncols(), Ppath::np, Ppath::pos, Vector::resize(), and w().

Referenced by geo_posWherePpathPassesZref_g().

◆ ppath_fieldCalc()

void ppath_fieldCalc ( Workspace ws,
ArrayOfPpath ppath_field,
const Agenda ppath_agenda,
const Numeric ppath_lmax,
const Numeric ppath_lraytrace,
const Index atmgeom_checked,
const Vector f_grid,
const Index cloudbox_on,
const Index cloudbox_checked,
const Index ppath_inside_cloudbox_do,
const Matrix sensor_pos,
const Matrix sensor_los,
const Vector rte_pos2,
const Verbosity verbosity 
)

WORKSPACE METHOD: ppath_fieldCalc.

Stand-alone calculation of propagation path field from sensors.

Uses ppathCalc internally.

Author
Richard Larsson
Parameters
[in,out]wsWorkspace
[out]ppath_fieldWS Output
[in]ppath_agendaWS Input
[in]ppath_lmaxWS Input
[in]ppath_lraytraceWS Input
[in]atmgeom_checkedWS Input
[in]f_gridWS Input
[in]cloudbox_onWS Input
[in]cloudbox_checkedWS Input
[in]ppath_inside_cloudbox_doWS Input
[in]sensor_posWS Input
[in]sensor_losWS Input
[in]rte_pos2WS Input

Definition at line 1239 of file m_ppath.cc.

References i, joker, n, ConstMatrixView::nrows(), and ppathCalc().

Referenced by ppath_fieldCalc_g().

◆ ppath_fieldFromDownUpLimbGeoms()

void ppath_fieldFromDownUpLimbGeoms ( Workspace ws,
ArrayOfPpath ppath_field,
const Agenda ppath_agenda,
const Numeric ppath_lmax,
const Numeric ppath_lraytrace,
const Index atmgeom_checked,
const Tensor3 z_field,
const Vector f_grid,
const Index cloudbox_on,
const Index cloudbox_checked,
const Index ppath_inside_cloudbox_do,
const Vector rte_pos,
const Vector rte_los,
const Vector rte_pos2,
const Vector refellipsoid,
const Index atmosphere_dim,
const Index nz,
const Verbosity verbosity 
)

WORKSPACE METHOD: ppath_fieldFromDownUpLimbGeoms.

Computes ppath_field from "standalone" sensors looking upwards from 0 m altitude with zenith angles range [0, 90], downwards from the top of the atmosphere covering the zenith angle range from 180 degrees to the surface tangent minus 1e-4 degrees, and through the limb covering at the same position as the downwards looking sensor covering the zenith angle range from the surface tangent plus 1e-4 degrees to 90 degrees minus 1e-4 degrees.

The top of the atmosphere is from z_field(-1, 0, 0) [python range notation].

The field will consist of 3*nz arrays structured as [up, limb, down]

The intent of this function is to generate a field so that calculations of ppvar_iy of all the fields will cover the zenith angle space of all positions in z_field.

Only works for atmosphere_dim 1, spherical planets, and ppath_lmax<0

Author
Richard Larsson
Parameters
[in,out]wsWorkspace
[out]ppath_fieldWS Output
[in]ppath_agendaWS Input
[in]ppath_lmaxWS Input
[in]ppath_lraytraceWS Input
[in]atmgeom_checkedWS Input
[in]z_fieldWS Input
[in]f_gridWS Input
[in]cloudbox_onWS Input
[in]cloudbox_checkedWS Input
[in]ppath_inside_cloudbox_doWS Input
[in]rte_posWS Input
[in]rte_losWS Input
[in]rte_pos2WS Input
[in]refellipsoidWS Input
[in]atmosphere_dimWS Input
[in]nzGeneric Input (Default: "3")

Definition at line 1120 of file m_ppath.cc.

References ConstTensor3View::npages(), r, and RAD2DEG.

Referenced by ppath_fieldFromDownUpLimbGeoms_g().

◆ ppath_stepGeometric()

void ppath_stepGeometric ( Ppath ppath_step,
const Index atmosphere_dim,
const Vector lat_grid,
const Vector lon_grid,
const Tensor3 z_field,
const Vector refellipsoid,
const Matrix z_surface,
const Numeric ppath_lmax,
const Verbosity verbosity 
)

WORKSPACE METHOD: ppath_stepGeometric.

Calculates a geometrical propagation path step.

This function determines a propagation path step by pure geometrical calculations. That is, refraction is neglected. Path points are always included for crossings with the grids, tangent points and intersection points with the surface. The WSV ppath_lmax gives the option to include additional points to ensure that the distance along the path between the points does not exceed the selected maximum length. No additional points are included if ppath_lmax* is set to <= 0.

For further information, type see the on-line information for ppath_step_agenda*.

Author
Patrick Eriksson
Parameters
[in,out]ppath_stepWS Input/Output
[in]atmosphere_dimWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]z_fieldWS Input
[in]refellipsoidWS Input
[in]z_surfaceWS Input
[in]ppath_lmaxWS Input

Definition at line 1278 of file m_ppath.cc.

References joker, Ppath::ngroup, Ppath::np, Ppath::nreal, ppath_step_geom_1d(), ppath_step_geom_2d(), ppath_step_geom_3d(), and ppath_what_background().

Referenced by ARTS::Agenda::ppath_step_agenda_geometric_path(), and ppath_stepGeometric_g().

◆ ppath_stepRefractionBasic()

void ppath_stepRefractionBasic ( Workspace ws,
Ppath ppath_step,
const Agenda refr_index_air_agenda,
const Index atmosphere_dim,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid,
const Tensor3 z_field,
const Tensor3 t_field,
const Tensor4 vmr_field,
const Vector refellipsoid,
const Matrix z_surface,
const Vector f_grid,
const Numeric ppath_lmax,
const Numeric ppath_lraytrace,
const Verbosity verbosity 
)

WORKSPACE METHOD: ppath_stepRefractionBasic.

Calculates a propagation path step, considering refraction by a basic approach.

Refraction is taken into account by probably the simplest approach possible. The path is treated to consist of piece-wise geometric steps. A geometric path step is calculated from each point by using the local line-of-sight. Snell's law for spherical symmetry is used for 1D to determine the zenith angle at the new point. For 2D and 3D, the zenith angle is calculated using the average gradient of the refractive index between the two points. For 3D, the azimuth angle is treated in the same way as the zenith one.

The maximum length of each ray tracing step is given by the WSV ppath_lraytrace*. The length will never exceed the given maximum, but it can be smaller. The ray tracing steps are only used to determine the path. Points to describe the path are included as for ppath_stepGeometric, this including the functionality of ppath_lmax*.

Author
Patrick Eriksson
Parameters
[in,out]wsWorkspace
[in,out]ppath_stepWS Input/Output
[in]refr_index_air_agendaWS Input
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]z_fieldWS Input
[in]t_fieldWS Input
[in]vmr_fieldWS Input
[in]refellipsoidWS Input
[in]z_surfaceWS Input
[in]f_gridWS Input
[in]ppath_lmaxWS Input
[in]ppath_lraytraceWS Input

Definition at line 1336 of file m_ppath.cc.

References get_refr_index_1d(), get_refr_index_2d(), get_refr_index_3d(), joker, Ppath::ngroup, Ppath::np, Ppath::nreal, Ppath::pos, ppath_step_refr_1d(), ppath_step_refr_2d(), ppath_step_refr_3d(), ppath_what_background(), and Ppath::r.

Referenced by ARTS::Agenda::ppath_step_agenda_refracted_path(), and ppath_stepRefractionBasic_g().

◆ ppathCalc()

void ppathCalc ( Workspace ws,
Ppath ppath,
const Agenda ppath_agenda,
const Numeric ppath_lmax,
const Numeric ppath_lraytrace,
const Index atmgeom_checked,
const Vector f_grid,
const Index cloudbox_on,
const Index cloudbox_checked,
const Index ppath_inside_cloudbox_do,
const Vector rte_pos,
const Vector rte_los,
const Vector rte_pos2,
const Verbosity verbosity 
)

WORKSPACE METHOD: ppathCalc.

Stand-alone calculation of propagation paths.

Beside a few checks of input data, the only operation of this method is to execute ppath_agenda.

Propagation paths are normally calculated as part of the radiative transfer calculations, and this method is not part of the control file. A reason to call this function directly would be to obtain a propagation path for plotting. Anyhow, use this method instead of calling e.g.*ppathStepByStep directly.

Author
Patrick Eriksson
Parameters
[in,out]wsWorkspace
[out]ppathWS Output
[in]ppath_agendaWS Input
[in]ppath_lmaxWS Input
[in]ppath_lraytraceWS Input
[in]atmgeom_checkedWS Input
[in]f_gridWS Input
[in]cloudbox_onWS Input
[in]cloudbox_checkedWS Input
[in]ppath_inside_cloudbox_doWS Input
[in]rte_posWS Input
[in]rte_losWS Input
[in]rte_pos2WS Input

Definition at line 193 of file m_ppath.cc.

References ppath_agendaExecute().

Referenced by ARTS::Agenda::iy_main_agenda_emission(), ARTS::Agenda::iy_main_agenda_transmission(), ppath_fieldCalc(), ppathCalc_g(), and ppathCalcFromAltitude().

◆ ppathCalcFromAltitude()

void ppathCalcFromAltitude ( Workspace ws,
Ppath ppath,
const Agenda ppath_agenda,
const Numeric ppath_lmax,
const Numeric ppath_lraytrace,
const Index atmgeom_checked,
const Vector f_grid,
const Index cloudbox_on,
const Index cloudbox_checked,
const Index ppath_inside_cloudbox_do,
const Vector rte_pos,
const Vector rte_los,
const Vector rte_pos2,
const Numeric altitude,
const Numeric accuracy,
const Verbosity verbosity 
)

WORKSPACE METHOD: ppathCalcFromAltitude.

Moves rte_pos forwards to near altitude before calling ppathCalc to compute a different ppath. The accuracy-variable gives minimum distance before the input altitude.

The forward-moving algorithm calls ppathCalc several times at reduced maximum distances. The intention is to maintain the correct rte_los for a given rte_pos at all altitudes. The method is thus relatively slow, and VERY memory intense at low accuracy.

Intended to be used with "tropospheric corrections" from ground geometry. Not well-tested

Throws error if no altitude is in line of sight.

Author
Richard Larsson
Parameters
[in,out]wsWorkspace
[out]ppathWS Output
[in]ppath_agendaWS Input
[in]ppath_lmaxWS Input
[in]ppath_lraytraceWS Input
[in]atmgeom_checkedWS Input
[in]f_gridWS Input
[in]cloudbox_onWS Input
[in]cloudbox_checkedWS Input
[in]ppath_inside_cloudbox_doWS Input
[in]rte_posWS Input
[in]rte_losWS Input
[in]rte_pos2WS Input
[in]altitudeGeneric Input
[in]accuracyGeneric Input (Default: "0.5")

Definition at line 232 of file m_ppath.cc.

References abs, Ppath::dim, first_pos_before_altitude(), joker, Ppath::los, Ppath::pos, and ppathCalc().

Referenced by ppathCalcFromAltitude_g().

◆ ppathFromRtePos2()

void ppathFromRtePos2 ( Workspace ws,
Ppath ppath,
Vector rte_los,
Numeric ppath_lraytrace,
const Agenda ppath_step_agenda,
const Index atmosphere_dim,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid,
const Tensor3 z_field,
const Vector f_grid,
const Vector refellipsoid,
const Matrix z_surface,
const Vector rte_pos,
const Vector rte_pos2,
const Numeric ppath_lmax,
const Numeric za_accuracy,
const Numeric pplrt_factor,
const Numeric pplrt_lowest,
const Verbosity verbosity 
)

WORKSPACE METHOD: ppathFromRtePos2.

Determines the propagation path from rte_pos2 to rte_pos.

The propagation path linking rte_pos and rte_pos2 is calculated and returned. The method determines the path in a pure numerical manner, where a simple algorithm is applied. The task is to find the value of rte_los (at rte_pos) linking the two positions.

See the user guide for a description of the search algorithm, including a more detailed definition of za_accuracy, pplrt_factor* and pplrt_lowest.

The standard application of this method should be to radio link calculations, where rte_pos2 corresponds to a transmitter, and rte_pos* to the receiver/sensor.

The details of the ray tracing is controlled by ppath_step_agenda as usual.

Author
Patrick Eriksson
Parameters
[in,out]wsWorkspace
[out]ppathWS Output
[in,out]rte_losWS Input/Output
[in,out]ppath_lraytraceWS Input/Output
[in]ppath_step_agendaWS Input
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]z_fieldWS Input
[in]f_gridWS Input
[in]refellipsoidWS Input
[in]z_surfaceWS Input
[in]rte_posWS Input
[in]rte_pos2WS Input
[in]ppath_lmaxWS Input
[in]za_accuracyGeneric Input (Default: "2e-5")
[in]pplrt_factorGeneric Input (Default: "5")
[in]pplrt_lowestGeneric Input (Default: "0.5")

Definition at line 306 of file m_ppath.cc.

References abs, cart2pol(), cart2poslos(), cart2sph(), CREATE_OUT2, CREATE_OUT3, DEG2RAD, distance2D(), distance3D(), Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos_copy(), i, joker, l12, line_circle_intersect(), line_sphere_intersect(), linreg(), ll, Ppath::los, Ppath::lstep, max, min, Ppath::ngroup, Ppath::np, Ppath::nreal, pol2cart(), Ppath::pos, pos2refell_r(), poslos2cart(), ppath_calc(), ppath_copy(), ppath_init_structure(), ppath_set_background(), ppath_what_background(), ppathFromRtePos2(), Ppath::r, rte_losGeometricFromRtePosToRtePos2(), rte_pos2gridpos(), sph2cart(), Ppath::start_los, Ppath::start_lstep, Ppath::start_pos, w(), and x1.

Referenced by ppathFromRtePos2(), and ppathFromRtePos2_g().

◆ ppathPlaneParallel()

void ppathPlaneParallel ( Ppath ppath,
const Index atmosphere_dim,
const Tensor3 z_field,
const Matrix z_surface,
const Index cloudbox_on,
const ArrayOfIndex cloudbox_limits,
const Index ppath_inside_cloudbox_do,
const Vector rte_pos,
const Vector rte_los,
const Numeric ppath_lmax,
const Verbosity verbosity 
)

WORKSPACE METHOD: ppathPlaneParallel.

Propagation path calculations for a plane parallel atmosphere.

This method basically assumes that the planet's radius is infinite, i.e. the planet surface has no curvature. Some consequences of this assumption: <br> - the mathod can only be used for 1D <br> - zenith angles between 89.9 and 90.1 deg are not allowed <br> - refraction is always neglected <br> - radii in ppath are set to Inf

Notice that the method provides full propagation paths. This means that ppath_step_agenda is ignored (and thus also refraction). On the other hand, the method considers the cloudbox exactly as the standard path calculations.

Author
Patrick Eriksson
Parameters
[out]ppathWS Output
[in]atmosphere_dimWS Input
[in]z_fieldWS Input
[in]z_surfaceWS Input
[in]cloudbox_onWS Input
[in]cloudbox_limitsWS Input
[in]ppath_inside_cloudbox_doWS Input
[in]rte_posWS Input
[in]rte_losWS Input
[in]ppath_lmaxWS Input

Definition at line 761 of file m_ppath.cc.

References abs, chk_rte_los(), chk_rte_pos(), Ppath::constant, DEG2RAD, Ppath::end_los, Ppath::end_lstep, Ppath::end_pos, Ppath::gp_p, i, GridPos::idx, joker, Ppath::los, Ppath::lstep, Array< base >::nelem(), Ppath::ngroup, Ppath::np, ConstTensor3View::npages(), Ppath::nreal, Ppath::pos, ppath_init_structure(), ppath_set_background(), Ppath::r, Ppath::start_los, Ppath::start_pos, and _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str().

Referenced by ARTS::Agenda::ppath_agenda_plane_parallel(), ppathPlaneParallel_g(), spectral_radiance_fieldClearskyPlaneParallel(), and spectral_radiance_fieldExpandCloudboxField().

◆ ppathStepByStep()

void ppathStepByStep ( Workspace ws,
Ppath ppath,
const Agenda ppath_step_agenda,
const Index ppath_inside_cloudbox_do,
const Index atmosphere_dim,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid,
const Tensor3 z_field,
const Vector f_grid,
const Vector refellipsoid,
const Matrix z_surface,
const Index cloudbox_on,
const ArrayOfIndex cloudbox_limits,
const Vector rte_pos,
const Vector rte_los,
const Numeric ppath_lmax,
const Numeric ppath_lraytrace,
const Verbosity verbosity 
)

WORKSPACE METHOD: ppathStepByStep.

Standard method for calculation of propagation paths.

This method calculates complete propagation paths in a stepwise manner. Each step is denoted as a "ppath_step" and is the path through/inside a single grid box.

The definition of a propgation path cannot be accommodated here. For more information read the chapter on propagation paths in the ARTS user guide.

This method should never be called directly. Use ppathCalc instead if you want to extract propagation paths.

Author
Patrick Eriksson
Parameters
[in,out]wsWorkspace
[out]ppathWS Output
[in]ppath_step_agendaWS Input
[in]ppath_inside_cloudbox_doWS Input
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]z_fieldWS Input
[in]f_gridWS Input
[in]refellipsoidWS Input
[in]z_surfaceWS Input
[in]cloudbox_onWS Input
[in]cloudbox_limitsWS Input
[in]rte_posWS Input
[in]rte_losWS Input
[in]ppath_lmaxWS Input
[in]ppath_lraytraceWS Input

Definition at line 1050 of file m_ppath.cc.

References ppath_calc().

Referenced by ARTS::Agenda::ppath_agenda_follow_sensor_los(), and ppathStepByStep_g().

◆ ppathWriteXMLPartial()

void ppathWriteXMLPartial ( const String output_file_format,
const Ppath ppath,
const String filename,
const Index file_index,
const Verbosity verbosity 
)

WORKSPACE METHOD: ppathWriteXMLPartial.

WSM to only write a reduced Ppath, omitting grid positions.

The following fields are set to be empty: gp_p, gp_lat and gp_lon. This cam drastically decrease the time for reading the structure by some external software.

If file_index is >= 0, the variable is written to a file with name: <br> <filename>.<file_index>.xml. where <file_index> is the value of *file_index.

This means that filename shall here not include the .xml extension. Omitting filename works as for WriteXML.

Author
Oliver Lemke
Parameters
[in]output_file_formatWS Input
[in]ppathWS Input
[in]filenameGeneric Input (Default: "")
[in]file_indexGeneric Input (Default: "-1")

Definition at line 1091 of file m_ppath.cc.

References filename_xml_with_index(), Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, and WriteXML().

Referenced by ppathWriteXMLPartial_g().

◆ rte_losGeometricFromRtePosToRtePos2()

void rte_losGeometricFromRtePosToRtePos2 ( Vector rte_los,
const Index atmosphere_dim,
const Vector lat_grid,
const Vector lon_grid,
const Vector refellipsoid,
const Vector rte_pos,
const Vector rte_pos2,
const Verbosity verbosity 
)

WORKSPACE METHOD: rte_losGeometricFromRtePosToRtePos2.

The geometric line-of-sight between two points.

The method sets rte_los to the line-of-sight, at rte_pos, that matches the geometrical propagation path between rte_pos and rte_pos2.

The standard case should be that rte_pos2 corresponds to a transmitter, and rte_pos to the receiver/sensor.

Author
Patrick Eriksson
Parameters
[out]rte_losWS Output
[in]atmosphere_dimWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]refellipsoidWS Input
[in]rte_posWS Input
[in]rte_pos2WS Input

Definition at line 1476 of file m_ppath.cc.

References chk_rte_pos(), los2xyz(), pol2cart(), pos2refell_r(), Vector::resize(), sph2cart(), x1, and x2.

Referenced by MCRadar(), ppathFromRtePos2(), rte_losGeometricFromRtePosToRtePos2_g(), and sensor_losGeometricFromSensorPosToOtherPositions().

◆ rte_losSet()

void rte_losSet ( Vector rte_los,
const Index atmosphere_dim,
const Numeric za,
const Numeric aa,
const Verbosity verbosity 
)

WORKSPACE METHOD: rte_losSet.

Sets rte_los to the given angles.

The azimuth angle is ignored for 1D and 2D.

Author
Patrick Eriksson
Parameters
[out]rte_losWS Output
[in]atmosphere_dimWS Input
[in]zaGeneric Input
[in]aaGeneric Input

Definition at line 1458 of file m_ppath.cc.

References chk_if_in_range(), and Vector::resize().

Referenced by rte_losSet_g().

◆ rte_pos_losMoveToStartOfPpath()

void rte_pos_losMoveToStartOfPpath ( Vector rte_pos,
Vector rte_los,
const Index atmosphere_dim,
const Ppath ppath,
const Verbosity verbosity 
)

WORKSPACE METHOD: rte_pos_losMoveToStartOfPpath.

Sets rte_pos and rte_los to values for last point in ppath.

For example, if the propagation path intersects with the surface, this method gives you the position and angle of ppath at the surface.

Author
Patrick Eriksson
Parameters
[out]rte_posWS Output
[out]rte_losWS Output
[in]atmosphere_dimWS Input
[in]ppathWS Input

Definition at line 1557 of file m_ppath.cc.

References chk_if_in_range(), Ppath::los, Ppath::np, ConstMatrixView::nrows(), and Ppath::pos.

Referenced by rte_pos_losMoveToStartOfPpath_g().

◆ rte_posSet()

void rte_posSet ( Vector rte_pos,
const Index atmosphere_dim,
const Numeric z,
const Numeric lat,
const Numeric lon,
const Verbosity verbosity 
)

WORKSPACE METHOD: rte_posSet.

Sets rte_pos to the given co-ordinates.

The longitude is ignored for 1D and 2D, and the latitude is also ignored for 1D.

Author
Patrick Eriksson
Parameters
[out]rte_posWS Output
[in]atmosphere_dimWS Input
[in]zGeneric Input
[in]latGeneric Input
[in]lonGeneric Input

Definition at line 1537 of file m_ppath.cc.

References chk_if_in_range(), and Vector::resize().

Referenced by rte_posSet_g().

◆ sensor_losGeometricFromSensorPosToOtherPositions()

void sensor_losGeometricFromSensorPosToOtherPositions ( Matrix sensor_los,
const Index atmosphere_dim,
const Vector lat_grid,
const Vector lon_grid,
const Vector refellipsoid,
const Matrix sensor_pos,
const Matrix target_pos,
const Verbosity verbosity 
)

WORKSPACE METHOD: sensor_losGeometricFromSensorPosToOtherPositions.

The geometric line-of-sight between pair of points.

The method sets sensor_los to the line-of-sights, that matches the geometrical propagation path from sensor_pos to target_pos. This is done for pair of positions, i.e. the two matrices shall have the same number of rows. The number of columns in target_pos shall be two for 1D and 2D and two for 3D, exactly as for rte_pos2.

See also rte_losGeometricFromRtePosToRtePos2. This method calls that method for each pair of positions, where values in sensor_pos matches rte_pos and values in target_pos matches rte_pos2.

Author
Patrick Eriksson
Parameters
[out]sensor_losWS Output
[in]atmosphere_dimWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]refellipsoidWS Input
[in]sensor_posWS Input
[in]target_posGeneric Input

Definition at line 1581 of file m_ppath.cc.

References i, joker, n, ConstMatrixView::ncols(), ConstMatrixView::nrows(), Matrix::resize(), and rte_losGeometricFromRtePosToRtePos2().

Referenced by sensor_losGeometricFromSensorPosToOtherPositions_g().

◆ TangentPointExtract()

void TangentPointExtract ( Vector tan_pos,
const Ppath ppath,
const Verbosity verbosity 
)

WORKSPACE METHOD: TangentPointExtract.

Finds the tangent point of a propagation path.

The tangent point is here defined as the point with the lowest altitude (which differes from the definition used in the code where it is the point with the lowest radius, or equally the point with a zenith angle of 90 deg.)

The tangent point is returned as a vector, with columns matching e.g. rte_pos. If the propagation path has no tangent point, the vector is set to NaN.

Author
Patrick Eriksson
Parameters
[out]tan_posGeneric output
[in]ppathWS Input

Definition at line 1623 of file m_ppath.cc.

References find_tanpoint(), ConstMatrixView::ncols(), Ppath::pos, and Vector::resize().

Referenced by TangentPointExtract_g().

◆ TangentPointPrint()

void TangentPointPrint ( const Ppath ppath,
const Index level,
const Verbosity verbosity 
)

WORKSPACE METHOD: TangentPointPrint.

Prints information about the tangent point of a propagation path.

The tangent point is here defined as the point with the lowest altitude (which differes from the definition used in the code where it is the point with the lowest radius, or equally the point with a zenith angle of 90 deg.)

Author
Patrick Eriksson
Parameters
[in]ppathWS Input
[in]levelGeneric Input (Default: "1")

Definition at line 1643 of file m_ppath.cc.

References CREATE_OUTS, find_tanpoint(), ConstMatrixView::ncols(), Ppath::pos, _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), and SWITCH_OUTPUT.

Referenced by TangentPointPrint_g().

◆ VectorZtanToZa1D()

void VectorZtanToZa1D ( Vector v_za,
const Matrix sensor_pos,
const Vector refellipsoid,
const Index atmosphere_dim,
const Vector v_ztan,
const Verbosity verbosity 
)

WORKSPACE METHOD: VectorZtanToZa1D.

Converts a set of geometrical tangent altitudes to zenith angles.

The tangent altitudes are given to the function as a vector, which are converted to a generic vector of zenith angles. The position of the sensor is given by the WSV sensor_pos. The function works only for 1D. The zenith angles are always set to be positive.

Author
Patrick Eriksson
Mattias Ekstrom
Parameters
[out]v_zaGeneric output
[in]sensor_posWS Input
[in]refellipsoidWS Input
[in]atmosphere_dimWS Input
[in]v_ztanGeneric Input

Definition at line 1728 of file m_ppath.cc.

References geompath_za_at_r(), i, ConstVectorView::nelem(), ConstMatrixView::nrows(), Vector::resize(), and _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str().

Referenced by VectorZtanToZa1D_g().

◆ VectorZtanToZaRefr1D()

void VectorZtanToZaRefr1D ( Workspace ws,
Vector v_za,
const Agenda refr_index_air_agenda,
const Matrix sensor_pos,
const Vector p_grid,
const Tensor3 t_field,
const Tensor3 z_field,
const Tensor4 vmr_field,
const Vector refellipsoid,
const Index atmosphere_dim,
const Vector f_grid,
const Vector v_ztan,
const Verbosity verbosity 
)

WORKSPACE METHOD: VectorZtanToZaRefr1D.

Converts a set of true tangent altitudes to zenith angles.

The tangent altitudes are given to the function as a vector, which are converted to a generic vector of zenith angles. The position of the sensor is given by the WSV sensor_pos. The function works only for 1D. The zenith angles are always set to be positive.

Author
Patrick Eriksson
Mattias Ekstrom
Parameters
[in,out]wsWorkspace
[out]v_zaGeneric output
[in]refr_index_air_agendaWS Input
[in]sensor_posWS Input
[in]p_gridWS Input
[in]t_fieldWS Input
[in]z_fieldWS Input
[in]vmr_fieldWS Input
[in]refellipsoidWS Input
[in]atmosphere_dimWS Input
[in]f_gridWS Input
[in]v_ztanGeneric Input

Definition at line 1668 of file m_ppath.cc.

References get_refr_index_1d(), i, ConstVectorView::nelem(), ConstMatrixView::nrows(), RAD2DEG, Vector::resize(), and _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str().

Referenced by VectorZtanToZaRefr1D_g().

Variable Documentation

◆ DEG2RAD

const Numeric DEG2RAD

◆ RAD2DEG