ARTS 2.5.0 (git: 9ee3ac6c)
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
48struct Ppath {
87};
88
91
97const Numeric POLELAT = 90 - 1e-8;
98
108const Numeric ANGTOL = 1e-6;
109
110/*===========================================================================
111 === Functions from ppath.cc
112 ===========================================================================*/
113
129void 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
158void cart2zaaa(Numeric& za,
159 Numeric& aa,
160 const Numeric& dx,
161 const Numeric& dy,
162 const Numeric& dz);
163
186void zaaa2cart(Numeric& dx,
187 Numeric& dy,
188 Numeric& dz,
189 const Numeric& za,
190 const Numeric& aa);
191
207void enu2zaaa(Numeric& za,
208 Numeric& aa,
209 const Numeric& de,
210 const Numeric& dn,
211 const Numeric& du);
212
228void zaaa2enu(Numeric& de,
229 Numeric& dn,
230 Numeric& du,
231 const Numeric& za,
232 const Numeric& aa);
233
249void diff_za_aa(Numeric& dza,
250 Numeric& daa,
251 const Numeric& za0,
252 const Numeric& aa0,
253 const Numeric& za,
254 const Numeric& aa);
255
263void error_if_limb_ppath(const Ppath& ppath);
264
278void find_tanpoint(Index& it, const Ppath& ppath);
279
292Index first_pos_before_altitude(const Ppath& p, const Numeric& alt);
293
306Numeric geometrical_ppc(const Numeric& r, const Numeric& za);
307
324 const Numeric& lat0,
325 const Numeric& za);
326
340Numeric geompath_l_at_r(const Numeric& ppc, const Numeric& r);
341
355Numeric geompath_r_at_l(const Numeric& ppc, const Numeric& l);
356
376 const Numeric& a_za,
377 const Numeric& r);
378
398bool is_los_downwards(const Numeric& za, const Numeric& tilt);
399
413Numeric plevel_angletilt(const Numeric& r, const Numeric& c);
414
440void plevel_slope_2d(Numeric& c1,
441 ConstVectorView lat_grid,
442 ConstVectorView refellipsoid,
443 ConstVectorView z_surf,
444 const GridPos& gp,
445 const Numeric& za);
446
471void plevel_slope_3d(Numeric& c1,
472 Numeric& c2,
473 ConstVectorView lat_grid,
474 ConstVectorView lon_grid,
475 ConstVectorView refellipsoid,
476 ConstMatrixView z_surf,
477 const GridPos& gp_lat,
478 const GridPos& gp_lon,
479 const Numeric& aa);
480
508void ppath_calc(Workspace& ws,
509 Ppath& ppath,
510 const Agenda& ppath_step_agenda,
511 const Index& atmosphere_dim,
512 const Vector& p_grid,
513 const Vector& lat_grid,
514 const Vector& lon_grid,
515 const Tensor3& z_field,
516 const Vector& f_grid,
517 const Vector& refellipsoid,
518 const Matrix& z_surface,
519 const Index& cloudbox_on,
520 const ArrayOfIndex& cloudbox_limits,
521 const Vector& rte_pos,
522 const Vector& rte_los,
523 const Numeric& ppath_lmax,
524 const Numeric& ppath_lraytrace,
525 const bool& ppath_inside_cloudbox_do,
526 const Verbosity& verbosity);
527
542void ppath_copy(Ppath& ppath1, const Ppath& ppath2, const Index& ncopy);
543
558void ppath_init_structure(Ppath& ppath,
559 const Index& atmosphere_dim,
560 const Index& np);
561
580void ppath_set_background(Ppath& ppath, const Index& case_nr);
581
625void ppath_start_stepping(Ppath& ppath,
626 const Index& atmosphere_dim,
627 ConstVectorView p_grid,
628 ConstVectorView lat_grid,
629 ConstVectorView lon_grid,
630 ConstTensor3View z_field,
631 ConstVectorView refellipsoid,
632 ConstMatrixView z_surface,
633 const Index& cloudbox_on,
634 const ArrayOfIndex& cloudbox_limits,
635 const bool& outside_cloudbox,
636 ConstVectorView rte_pos,
637 ConstVectorView rte_los,
638 const Verbosity& verbosity);
639
664void ppath_step_geom_1d(Ppath& ppath,
665 ConstVectorView z_field,
666 ConstVectorView refellipsoid,
667 const Numeric& z_surface,
668 const Numeric& lmax);
669
685void ppath_step_geom_2d(Ppath& ppath,
686 ConstVectorView lat_grid,
687 ConstMatrixView z_field,
688 ConstVectorView refellipsoid,
689 ConstVectorView z_surface,
690 const Numeric& lmax);
691
708void ppath_step_geom_3d(Ppath& ppath,
709 ConstVectorView lat_grid,
710 ConstVectorView lon_grid,
711 ConstTensor3View z_field,
712 ConstVectorView refellipsoid,
713 ConstMatrixView z_surface,
714 const Numeric& lmax);
715
743 Ppath& ppath,
744 ConstVectorView p_grid,
745 ConstTensor3View z_field,
746 ConstTensor3View t_field,
747 ConstTensor4View vmr_field,
748 ConstVectorView f_grid,
749 ConstVectorView refellipsoid,
750 const Numeric& z_surface,
751 const Numeric& lmax,
752 const Agenda& refr_index_agenda,
753 const String& rtrace_method,
754 const Numeric& lraytrace);
755
782 Ppath& ppath,
783 ConstVectorView p_grid,
784 ConstVectorView lat_grid,
785 ConstTensor3View z_field,
786 ConstTensor3View t_field,
787 ConstTensor4View vmr_field,
788 ConstVectorView f_grid,
789 ConstVectorView refellipsoid,
790 ConstVectorView z_surface,
791 const Numeric& lmax,
792 const Agenda& refr_index_agenda,
793 const String& rtrace_method,
794 const Numeric& lraytrace);
795
823 Ppath& ppath,
824 ConstVectorView p_grid,
825 ConstVectorView lat_grid,
826 ConstVectorView lon_grid,
827 ConstTensor3View z_field,
828 ConstTensor3View t_field,
829 ConstTensor4View vmr_field,
830 ConstVectorView f_grid,
831 ConstVectorView refellipsoid,
832 ConstMatrixView z_surface,
833 const Numeric& lmax,
834 const Agenda& refr_index_agenda,
835 const String& rtrace_method,
836 const Numeric& lraytrace);
837
849Index ppath_what_background(const Ppath& ppath);
850
872void resolve_lon(Numeric& lon, const Numeric& lon5, const Numeric& lon6);
873
896void zaaa2cart(Numeric& dx,
897 Numeric& dy,
898 Numeric& dz,
899 const Numeric& za,
900 const Numeric& aa);
901
902#endif // ppath_h
Declarations for agendas.
This file contains the definition of Array.
The global header file for ARTS.
The Agenda class.
Definition: agenda_class.h:44
A constant view of a Matrix.
Definition: matpackI.h:1014
A constant view of a Tensor3.
Definition: matpackIII.h:132
A constant view of a Tensor4.
Definition: matpackIV.h:133
A constant view of a Vector.
Definition: matpackI.h:489
The Matrix class.
Definition: matpackI.h:1225
The Tensor3 class.
Definition: matpackIII.h:339
The Vector class.
Definition: matpackI.h:876
Workspace class.
Definition: workspace_ng.h:40
Header file for interpolation.cc.
#define dx
Implementation of Matrix, Vector, and such stuff.
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
This file contains the definition of String, the ARTS string class.
constexpr Numeric l(const Index p0, const Index n, const Numeric x, const SortedVectorType &xi, const Index j, const std::pair< Numeric, Numeric > cycle={ -180, 180}) noexcept
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:4316
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:622
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:312
Numeric geompath_r_at_l(const Numeric &ppc, const Numeric &l)
Calculates the radius for a distance from the tangent point.
Definition: ppath.cc:169
void error_if_limb_ppath(const Ppath &ppath)
Throws an error if ppath altitudes not are strictly increasing or decreasing.
Definition: ppath.cc:540
const Numeric POLELAT
Size of north and south poles.
Definition: ppath.h:97
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:429
Index ppath_what_background(const Ppath &ppath)
Returns the case number for the radiative background.
Definition: ppath.cc:1476
Index first_pos_before_altitude(const Ppath &p, const Numeric &alt)
Determines ppath position just below an altitude.
Definition: ppath.cc:522
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:4476
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:3251
Array< Ppath > ArrayOfPpath
An array of propagation paths.
Definition: ppath.h:90
Numeric geometrical_ppc(const Numeric &r, const Numeric &za)
Calculates the propagation path constant for pure geometrical calculations.
Definition: ppath.cc:96
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:391
void zaaa2enu(Numeric &de, Numeric &dn, Numeric &du, const Numeric &za, const Numeric &aa)
Converts zenith and azimuth angles to ENU unit vector.
Definition: ppath.cc:335
void ppath_copy(Ppath &ppath1, const Ppath &ppath2, const Index &ncopy)
Copy the content in ppath2 to ppath1.
Definition: ppath.cc:1496
void enu2zaaa(Numeric &za, Numeric &aa, const Numeric &de, const Numeric &dn, const Numeric &du)
Converts ENU unit vector vector to zenith and azimuth.
Definition: ppath.cc:326
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:1145
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:2717
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
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:299
void find_tanpoint(Index &it, const Ppath &ppath)
Identifies the tangent point of a propagation path.
Definition: ppath.cc:510
void ppath_set_background(Ppath &ppath, const Index &case_nr)
Sets the background field of a Ppath structure.
Definition: ppath.cc:1450
void resolve_lon(Numeric &lon, const Numeric &lon5, const Numeric &lon6)
Resolves which longitude angle that shall be used.
Definition: ppath.cc:500
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
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:3901
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:5175
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:3557
const Numeric ANGTOL
Width of zenith and nadir directions.
Definition: ppath.h:108
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:2353
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:1409
Numeric plevel_angletilt(const Numeric &r, const Numeric &c)
Calculates the angular tilt of the surface or a pressure level.
Definition: ppath.cc:616
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
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:579
#define c
Structure to store a grid position.
Definition: interpolation.h:73
The structure to describe a propagation path and releated quantities.
Definition: ppath.h:48
Matrix los
Line-of-sight at each ppath point.
Definition: ppath.h:66
ArrayOfGridPos gp_lon
Index position with respect to the longitude grid.
Definition: ppath.h:86
String background
Radiative background.
Definition: ppath.h:56
Index np
Number of points describing the ppath.
Definition: ppath.h:52
Matrix pos
The distance between start pos and the last position in pos.
Definition: ppath.h:64
ArrayOfGridPos gp_lat
Index position with respect to the latitude grid.
Definition: ppath.h:84
Numeric end_lstep
The distance between end pos and the first position in pos.
Definition: ppath.h:76
Vector start_pos
Start position.
Definition: ppath.h:58
Vector lstep
The length between ppath points.
Definition: ppath.h:70
Numeric start_lstep
Length between sensor and atmospheric boundary.
Definition: ppath.h:62
Numeric constant
The propagation path constant (only used for 1D)
Definition: ppath.h:54
Vector r
Radius of each ppath point.
Definition: ppath.h:68
ArrayOfGridPos gp_p
Index position with respect to the pressure grid.
Definition: ppath.h:82
Vector ngroup
The group index of refraction.
Definition: ppath.h:80
Index dim
Atmospheric dimensionality.
Definition: ppath.h:50
Vector end_pos
End position.
Definition: ppath.h:72
Vector start_los
Start line-of-sight.
Definition: ppath.h:60
Vector nreal
The real part of the refractive index at each path position.
Definition: ppath.h:78
Vector end_los
End line-of-sight.
Definition: ppath.h:74