ARTS  2.4.0(git:4fb77825)
ppath.h
Go to the documentation of this file.
1 /* Copyright (C) 2002-2012 Patrick Eriksson <Patrick.Eriksson@chalmers.se>
2 
3  This program is free software; you can redistribute it and/or modify it
4  under the terms of the GNU General Public License as published by the
5  Free Software Foundation; either version 2, or (at your option) any
6  later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16  USA. */
17 
29 #ifndef ppath_h
30 #define ppath_h
31 
32 #include "agenda_class.h"
33 #include "array.h"
34 #include "arts.h"
35 #include "interpolation.h"
36 #include "matpackI.h"
37 #include "mystring.h"
38 
39 /*===========================================================================
40  === The Ppath structure
41  ===========================================================================*/
42 
48 struct Ppath {
87 };
88 
91 
97 const Numeric POLELAT = 90 - 1e-8;
98 
108 const Numeric ANGTOL = 1e-6;
109 
110 /*===========================================================================
111  === Functions from ppath.cc
112  ===========================================================================*/
113 
129 void add_za_aa(Numeric& za,
130  Numeric& aa,
131  const Numeric& za0,
132  const Numeric& aa0,
133  const Numeric& dza,
134  const Numeric& daa);
135 
158 void cart2zaaa(Numeric& za,
159  Numeric& aa,
160  const Numeric& dx,
161  const Numeric& dy,
162  const Numeric& dz);
163 
179 void diff_za_aa(Numeric& dza,
180  Numeric& daa,
181  const Numeric& za0,
182  const Numeric& aa0,
183  const Numeric& za,
184  const Numeric& aa);
185 
193 void error_if_limb_ppath(const Ppath& ppath);
194 
208 void find_tanpoint(Index& it, const Ppath& ppath);
209 
222 Index first_pos_before_altitude(const Ppath& p, const Numeric& alt);
223 
236 Numeric geometrical_ppc(const Numeric& r, const Numeric& za);
237 
254  const Numeric& lat0,
255  const Numeric& za);
256 
270 Numeric geompath_l_at_r(const Numeric& ppc, const Numeric& r);
271 
290 Numeric geompath_za_at_r(const Numeric& ppc,
291  const Numeric& a_za,
292  const Numeric& r);
293 
313 bool is_los_downwards(const Numeric& za, const Numeric& tilt);
314 
328 Numeric plevel_angletilt(const Numeric& r, const Numeric& c);
329 
355 void plevel_slope_2d(Numeric& c1,
358  ConstVectorView z_surf,
359  const GridPos& gp,
360  const Numeric& za);
361 
386 void plevel_slope_3d(Numeric& c1,
387  Numeric& c2,
391  ConstMatrixView z_surf,
392  const GridPos& gp_lat,
393  const GridPos& gp_lon,
394  const Numeric& aa);
395 
423 void ppath_calc(Workspace& ws,
424  Ppath& ppath,
425  const Agenda& ppath_step_agenda,
426  const Index& atmosphere_dim,
427  const Vector& p_grid,
428  const Vector& lat_grid,
429  const Vector& lon_grid,
430  const Tensor3& z_field,
431  const Vector& f_grid,
432  const Vector& refellipsoid,
433  const Matrix& z_surface,
434  const Index& cloudbox_on,
436  const Vector& rte_pos,
437  const Vector& rte_los,
438  const Numeric& ppath_lmax,
439  const Numeric& ppath_lraytrace,
440  const bool& ppath_inside_cloudbox_do,
441  const Verbosity& verbosity);
442 
457 void ppath_copy(Ppath& ppath1, const Ppath& ppath2, const Index& ncopy);
458 
474  const Index& atmosphere_dim,
475  const Index& np);
476 
495 void ppath_set_background(Ppath& ppath, const Index& case_nr);
496 
541  const Index& atmosphere_dim,
548  const Index& cloudbox_on,
550  const bool& outside_cloudbox,
553  const Verbosity& verbosity);
554 
582  const Numeric& z_surface,
583  const Numeric& lmax);
584 
605  const Numeric& lmax);
606 
629  const Numeric& lmax);
630 
658  Ppath& ppath,
665  const Numeric& z_surface,
666  const Numeric& lmax,
667  const Agenda& refr_index_agenda,
668  const String& rtrace_method,
669  const Numeric& lraytrace);
670 
697  Ppath& ppath,
706  const Numeric& lmax,
707  const Agenda& refr_index_agenda,
708  const String& rtrace_method,
709  const Numeric& lraytrace);
710 
738  Ppath& ppath,
748  const Numeric& lmax,
749  const Agenda& refr_index_agenda,
750  const String& rtrace_method,
751  const Numeric& lraytrace);
752 
765 
787 void resolve_lon(Numeric& lon, const Numeric& lon5, const Numeric& lon6);
788 
811 void zaaa2cart(Numeric& dx,
812  Numeric& dy,
813  Numeric& dz,
814  const Numeric& za,
815  const Numeric& aa);
816 
817 #endif // ppath_h
Matrix
The Matrix class.
Definition: matpackI.h:1193
ARTS::Var::atmosphere_dim
Index atmosphere_dim(Workspace &ws) noexcept
Definition: autoarts.h:2510
ANGTOL
const Numeric ANGTOL
Width of zenith and nadir directions.
Definition: ppath.h:108
ARTS::Var::z_field
Tensor3 z_field(Workspace &ws) noexcept
Definition: autoarts.h:7690
error_if_limb_ppath
void error_if_limb_ppath(const Ppath &ppath)
Throws an error if ppath altitudes not are strictly increasing or decreasing.
Definition: ppath.cc:555
ARTS::Var::ppath_step_agenda
Agenda ppath_step_agenda(Workspace &ws) noexcept
Definition: autoarts.h:5220
zaaa2cart
void zaaa2cart(Numeric &dx, Numeric &dy, Numeric &dz, const Numeric &za, const Numeric &aa)
Converts zenith and azimuth angles to a cartesian unit vector.
Definition: ppath.cc:347
Tensor3
The Tensor3 class.
Definition: matpackIII.h:339
first_pos_before_altitude
Index first_pos_before_altitude(const Ppath &p, const Numeric &alt)
Determines ppath position just below an altitude.
Definition: ppath.cc:537
geometrical_ppc
Numeric geometrical_ppc(const Numeric &r, const Numeric &za)
Calculates the propagation path constant for pure geometrical calculations.
Definition: ppath.cc:96
ARTS::Var::lat_grid
Vector lat_grid(Workspace &ws) noexcept
Definition: autoarts.h:3962
add_za_aa
void add_za_aa(Numeric &za, Numeric &aa, const Numeric &za0, const Numeric &aa0, const Numeric &dza, const Numeric &daa)
Adds up zenith and azimuth angles.
Definition: ppath.cc:406
interpolation.h
Header file for interpolation.cc.
ARTS::Var::ppath_inside_cloudbox_do
Index ppath_inside_cloudbox_do(Workspace &ws) noexcept
Definition: autoarts.h:5172
ARTS::Var::verbosity
Verbosity verbosity(Workspace &ws) noexcept
Definition: autoarts.h:7112
Ppath::background
String background
Radiative background.
Definition: ppath.h:56
POLELAT
const Numeric POLELAT
Size of north and south poles.
Definition: ppath.h:97
ARTS::Var::cloudbox_limits
ArrayOfIndex cloudbox_limits(Workspace &ws) noexcept
Definition: autoarts.h:2762
Ppath::end_lstep
Numeric end_lstep
The distance between end pos and the first position in pos.
Definition: ppath.h:76
Ppath::start_lstep
Numeric start_lstep
Length between sensor and atmospheric boundary.
Definition: ppath.h:62
geompath_l_at_r
Numeric geompath_l_at_r(const Numeric &ppc, const Numeric &r)
Calculates the length from the tangent point for the given radius.
Definition: ppath.cc:158
plevel_slope_2d
void plevel_slope_2d(Numeric &c1, ConstVectorView lat_grid, ConstVectorView refellipsoid, ConstVectorView z_surf, const GridPos &gp, const Numeric &za)
Calculates the radial slope of the surface or a pressure level for 2D.
Definition: ppath.cc:595
array.h
This file contains the definition of Array.
plevel_angletilt
Numeric plevel_angletilt(const Numeric &r, const Numeric &c)
Calculates the angular tilt of the surface or a pressure level.
Definition: ppath.cc:632
Ppath
The structure to describe a propagation path and releated quantities.
Definition: ppath.h:48
Ppath::gp_p
ArrayOfGridPos gp_p
Index position with respect to the pressure grid.
Definition: ppath.h:82
Agenda
The Agenda class.
Definition: agenda_class.h:44
ARTS::Var::lon
Numeric lon(Workspace &ws) noexcept
Definition: autoarts.h:4064
Ppath::end_pos
Vector end_pos
End position.
Definition: ppath.h:72
ConstTensor4View
A constant view of a Tensor4.
Definition: matpackIV.h:133
matpackI.h
Implementation of Matrix, Vector, and such stuff.
ppath_init_structure
void ppath_init_structure(Ppath &ppath, const Index &atmosphere_dim, const Index &np)
Initiates a Ppath structure to hold the given number of points.
Definition: ppath.cc:1426
ppath_copy
void ppath_copy(Ppath &ppath1, const Ppath &ppath2, const Index &ncopy)
Copy the content in ppath2 to ppath1.
Definition: ppath.cc:1515
Array< GridPos >
ppath_what_background
Index ppath_what_background(const Ppath &ppath)
Returns the case number for the radiative background.
Definition: ppath.cc:1494
agenda_class.h
Declarations for agendas.
Ppath::gp_lat
ArrayOfGridPos gp_lat
Index position with respect to the latitude grid.
Definition: ppath.h:84
ARTS::Var::rte_pos
Vector rte_pos(Workspace &ws) noexcept
Definition: autoarts.h:5672
Ppath::ngroup
Vector ngroup
The group index of refraction.
Definition: ppath.h:80
my_basic_string< char >
Ppath::los
Matrix los
Line-of-sight at each ppath point.
Definition: ppath.h:66
Ppath::start_pos
Vector start_pos
Start position.
Definition: ppath.h:58
Ppath::gp_lon
ArrayOfGridPos gp_lon
Index position with respect to the longitude grid.
Definition: ppath.h:86
ppath_step_refr_2d
void ppath_step_refr_2d(Workspace &ws, Ppath &ppath, ConstVectorView p_grid, ConstVectorView lat_grid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, ConstVectorView refellipsoid, ConstVectorView z_surface, const Numeric &lmax, const Agenda &refr_index_agenda, const String &rtrace_method, const Numeric &lraytrace)
Calculates 2D propagation path steps, with refraction, using a simple and fast ray tracing scheme.
Definition: ppath.cc:3920
Ppath::np
Index np
Number of points describing the ppath.
Definition: ppath.h:52
ppath_step_refr_1d
void ppath_step_refr_1d(Workspace &ws, Ppath &ppath, ConstVectorView p_grid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, ConstVectorView refellipsoid, const Numeric &z_surface, const Numeric &lmax, const Agenda &refr_index_agenda, const String &rtrace_method, const Numeric &lraytrace)
Calculates 1D propagation path steps including effects of refraction.
Definition: ppath.cc:3576
ARTS::Var::vmr_field
Tensor4 vmr_field(Workspace &ws) noexcept
Definition: autoarts.h:7130
ARTS::Var::rte_los
Vector rte_los(Workspace &ws) noexcept
Definition: autoarts.h:5651
ARTS::Var::p_grid
Vector p_grid(Workspace &ws) noexcept
Definition: autoarts.h:4763
ARTS::Var::ppath
Ppath ppath(Workspace &ws) noexcept
Definition: autoarts.h:5139
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
Verbosity
Definition: messages.h:49
ppath_step_geom_2d
void ppath_step_geom_2d(Ppath &ppath, ConstVectorView lat_grid, ConstMatrixView z_field, ConstVectorView refellipsoid, ConstVectorView z_surface, const Numeric &lmax)
Calculates 2D geometrical propagation path steps.
Definition: ppath.cc:2736
ppath_step_geom_1d
void ppath_step_geom_1d(Ppath &ppath, ConstVectorView z_field, ConstVectorView refellipsoid, const Numeric &z_surface, const Numeric &lmax)
Calculates 1D geometrical propagation path steps.
Definition: ppath.cc:2372
ppath_set_background
void ppath_set_background(Ppath &ppath, const Index &case_nr)
Sets the background field of a Ppath structure.
Definition: ppath.cc:1467
Ppath::lstep
Vector lstep
The length between ppath points.
Definition: ppath.h:70
ARTS::Var::refellipsoid
Vector refellipsoid(Workspace &ws) noexcept
Definition: autoarts.h:5519
Ppath::start_los
Vector start_los
Start line-of-sight.
Definition: ppath.h:60
ARTS::Var::f_grid
Vector f_grid(Workspace &ws) noexcept
Definition: autoarts.h:3449
ppath_start_stepping
void ppath_start_stepping(Ppath &ppath, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView refellipsoid, ConstMatrixView z_surface, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const bool &outside_cloudbox, ConstVectorView rte_pos, ConstVectorView rte_los, const Verbosity &verbosity)
Initiates a Ppath structure for calculation of a path with ppath_step.
Definition: ppath.cc:4495
resolve_lon
void resolve_lon(Numeric &lon, const Numeric &lon5, const Numeric &lon6)
Resolves which longitude angle that shall be used.
Definition: ppath.cc:515
Ppath::nreal
Vector nreal
The real part of the refractive index at each path position.
Definition: ppath.h:78
ARTS::Var::lon_grid
Vector lon_grid(Workspace &ws) noexcept
Definition: autoarts.h:4090
ARTS::Var::ppath_lmax
Numeric ppath_lmax(Workspace &ws) noexcept
Definition: autoarts.h:5183
geompath_lat_at_za
Numeric geompath_lat_at_za(const Numeric &za0, const Numeric &lat0, const Numeric &za)
Calculates the latitude for a given zenith angle along a geometrical propagation path.
Definition: ppath.cc:148
ConstMatrixView
A constant view of a Matrix.
Definition: matpackI.h:982
Ppath::end_los
Vector end_los
End line-of-sight.
Definition: ppath.h:74
geompath_za_at_r
Numeric geompath_za_at_r(const Numeric &ppc, const Numeric &a_za, const Numeric &r)
Calculates the zenith angle for a given radius along a geometrical propagation path.
Definition: ppath.cc:103
ARTS::Var::ppath_lraytrace
Numeric ppath_lraytrace(Workspace &ws) noexcept
Definition: autoarts.h:5195
ArrayOfPpath
Array< Ppath > ArrayOfPpath
An array of propagation paths.
Definition: ppath.h:90
GridPos
Structure to store a grid position.
Definition: interpolation.h:73
find_tanpoint
void find_tanpoint(Index &it, const Ppath &ppath)
Identifies the tangent point of a propagation path.
Definition: ppath.cc:525
Ppath::constant
Numeric constant
The propagation path constant (only used for 1D)
Definition: ppath.h:54
ppath_step_refr_3d
void ppath_step_refr_3d(Workspace &ws, Ppath &ppath, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, ConstVectorView refellipsoid, ConstMatrixView z_surface, const Numeric &lmax, const Agenda &refr_index_agenda, const String &rtrace_method, const Numeric &lraytrace)
Calculates 3D propagation path steps, with refraction, using a simple and fast ray tracing scheme.
Definition: ppath.cc:4335
ARTS::Var::t_field
Tensor3 t_field(Workspace &ws) noexcept
Definition: autoarts.h:6947
Workspace
Workspace class.
Definition: workspace_ng.h:40
ConstTensor3View
A constant view of a Tensor3.
Definition: matpackIII.h:132
Ppath::r
Vector r
Radius of each ppath point.
Definition: ppath.h:68
dx
#define dx
Definition: legacy_continua.cc:22180
diff_za_aa
void diff_za_aa(Numeric &dza, Numeric &daa, const Numeric &za0, const Numeric &aa0, const Numeric &za, const Numeric &aa)
Takes the difference of zenith and azimuth angles.
Definition: ppath.cc:444
plevel_slope_3d
void plevel_slope_3d(Numeric &c1, Numeric &c2, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstVectorView refellipsoid, ConstMatrixView z_surf, const GridPos &gp_lat, const GridPos &gp_lon, const Numeric &aa)
Calculates the radial slope of the surface or a pressure level for 3D.
Definition: ppath.cc:1162
ppath_step_geom_3d
void ppath_step_geom_3d(Ppath &ppath, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView refellipsoid, ConstMatrixView z_surface, const Numeric &lmax)
Calculates 3D geometrical propagation path steps.
Definition: ppath.cc:3270
cart2zaaa
void cart2zaaa(Numeric &za, Numeric &aa, const Numeric &dx, const Numeric &dy, const Numeric &dz)
Converts a cartesian directional vector to zenith and azimuth.
Definition: ppath.cc:312
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
is_los_downwards
bool is_los_downwards(const Numeric &za, const Numeric &tilt)
Determines if a line-of-sight is downwards compared to the angular tilt of the surface or a pressure ...
Definition: ppath.cc:638
Ppath::dim
Index dim
Atmospheric dimensionality.
Definition: ppath.h:50
ppath_calc
void ppath_calc(Workspace &ws, Ppath &ppath, const Agenda &ppath_step_agenda, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const 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 bool &ppath_inside_cloudbox_do, const Verbosity &verbosity)
This is the core for the WSM ppathStepByStep.
Definition: ppath.cc:5206
Vector
The Vector class.
Definition: matpackI.h:860
ConstVectorView
A constant view of a Vector.
Definition: matpackI.h:476
Ppath::pos
Matrix pos
The distance between start pos and the last position in pos.
Definition: ppath.h:64
ARTS::Var::z_surface
Matrix z_surface(Workspace &ws) noexcept
Definition: autoarts.h:7754
mystring.h
This file contains the definition of String, the ARTS string class.
arts.h
The global header file for ARTS.
ARTS::Var::cloudbox_on
Index cloudbox_on(Workspace &ws) noexcept
Definition: autoarts.h:2782