ARTS  2.3.1285(git:92a29ea9-dirty)
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,
356  ConstVectorView lat_grid,
357  ConstVectorView refellipsoid,
358  ConstVectorView z_surf,
359  const GridPos& gp,
360  const Numeric& za);
361 
386 void plevel_slope_3d(Numeric& c1,
387  Numeric& c2,
388  ConstVectorView lat_grid,
389  ConstVectorView lon_grid,
390  ConstVectorView refellipsoid,
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,
435  const ArrayOfIndex& cloudbox_limits,
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 
473 void ppath_init_structure(Ppath& ppath,
474  const Index& atmosphere_dim,
475  const Index& np);
476 
495 void ppath_set_background(Ppath& ppath, const Index& case_nr);
496 
540 void ppath_start_stepping(Ppath& ppath,
541  const Index& atmosphere_dim,
542  ConstVectorView p_grid,
543  ConstVectorView lat_grid,
544  ConstVectorView lon_grid,
545  ConstTensor3View z_field,
546  ConstVectorView refellipsoid,
547  ConstMatrixView z_surface,
548  const Index& cloudbox_on,
549  const ArrayOfIndex& cloudbox_limits,
550  const bool& outside_cloudbox,
551  ConstVectorView rte_pos,
552  ConstVectorView rte_los,
553  const Verbosity& verbosity);
554 
579 void ppath_step_geom_1d(Ppath& ppath,
580  ConstVectorView z_field,
581  ConstVectorView refellipsoid,
582  const Numeric& z_surface,
583  const Numeric& lmax);
584 
600 void ppath_step_geom_2d(Ppath& ppath,
601  ConstVectorView lat_grid,
602  ConstMatrixView z_field,
603  ConstVectorView refellipsoid,
604  ConstVectorView z_surface,
605  const Numeric& lmax);
606 
623 void ppath_step_geom_3d(Ppath& ppath,
624  ConstVectorView lat_grid,
625  ConstVectorView lon_grid,
626  ConstTensor3View z_field,
627  ConstVectorView refellipsoid,
628  ConstMatrixView z_surface,
629  const Numeric& lmax);
630 
658  Ppath& ppath,
659  ConstVectorView p_grid,
660  ConstTensor3View z_field,
661  ConstTensor3View t_field,
662  ConstTensor4View vmr_field,
663  ConstVectorView f_grid,
664  ConstVectorView refellipsoid,
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,
698  ConstVectorView p_grid,
699  ConstVectorView lat_grid,
700  ConstTensor3View z_field,
701  ConstTensor3View t_field,
702  ConstTensor4View vmr_field,
703  ConstVectorView f_grid,
704  ConstVectorView refellipsoid,
705  ConstVectorView z_surface,
706  const Numeric& lmax,
707  const Agenda& refr_index_agenda,
708  const String& rtrace_method,
709  const Numeric& lraytrace);
710 
738  Ppath& ppath,
739  ConstVectorView p_grid,
740  ConstVectorView lat_grid,
741  ConstVectorView lon_grid,
742  ConstTensor3View z_field,
743  ConstTensor3View t_field,
744  ConstTensor4View vmr_field,
745  ConstVectorView f_grid,
746  ConstVectorView refellipsoid,
747  ConstMatrixView z_surface,
748  const Numeric& lmax,
749  const Agenda& refr_index_agenda,
750  const String& rtrace_method,
751  const Numeric& lraytrace);
752 
764 Index ppath_what_background(const Ppath& ppath);
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
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
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
ArrayOfGridPos gp_lat
Index position with respect to the latitude grid.
Definition: ppath.h:84
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
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
Numeric constant
The propagation path constant (only used for 1D)
Definition: ppath.h:54
void error_if_limb_ppath(const Ppath &ppath)
Throws an error if ppath altitudes not are strictly increasing or decreasing.
Definition: ppath.cc:555
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
The Agenda class.
Definition: agenda_class.h:44
void resolve_lon(Numeric &lon, const Numeric &lon5, const Numeric &lon6)
Resolves which longitude angle that shall be used.
Definition: ppath.cc:515
Index ppath_what_background(const Ppath &ppath)
Returns the case number for the radiative background.
Definition: ppath.cc:1494
Matrix los
Line-of-sight at each ppath point.
Definition: ppath.h:66
The Vector class.
Definition: matpackI.h:860
Array< Ppath > ArrayOfPpath
An array of propagation paths.
Definition: ppath.h:90
Vector end_pos
End position.
Definition: ppath.h:72
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
Index dim
Atmospheric dimensionality.
Definition: ppath.h:50
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
Vector lstep
The length between ppath points.
Definition: ppath.h:70
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
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
Matrix pos
The distance between start pos and the last position in pos.
Definition: ppath.h:64
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
Vector ngroup
The group index of refraction.
Definition: ppath.h:80
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
Header file for interpolation.cc.
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
Vector start_pos
Start position.
Definition: ppath.h:58
Vector r
Radius of each ppath point.
Definition: ppath.h:68
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
Structure to store a grid position.
Definition: interpolation.h:73
A constant view of a Tensor4.
Definition: matpackIV.h:133
Numeric end_lstep
The distance between end pos and the first position in pos.
Definition: ppath.h:76
This file contains the definition of Array.
Vector end_los
End line-of-sight.
Definition: ppath.h:74
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
The Tensor3 class.
Definition: matpackIII.h:339
void find_tanpoint(Index &it, const Ppath &ppath)
Identifies the tangent point of a propagation path.
Definition: ppath.cc:525
The global header file for ARTS.
String background
Radiative background.
Definition: ppath.h:56
Numeric plevel_angletilt(const Numeric &r, const Numeric &c)
Calculates the angular tilt of the surface or a pressure level.
Definition: ppath.cc:632
const Numeric ANGTOL
Width of zenith and nadir directions.
Definition: ppath.h:108
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
Declarations for agendas.
Numeric start_lstep
Length between sensor and atmospheric boundary.
Definition: ppath.h:62
void ppath_set_background(Ppath &ppath, const Index &case_nr)
Sets the background field of a Ppath structure.
Definition: ppath.cc:1467
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
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
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
The Matrix class.
Definition: matpackI.h:1193
Vector nreal
The real part of the refractive index at each path position.
Definition: ppath.h:78
Implementation of Matrix, Vector, and such stuff.
#define dx
void ppath_copy(Ppath &ppath1, const Ppath &ppath2, const Index &ncopy)
Copy the content in ppath2 to ppath1.
Definition: ppath.cc:1515
A constant view of a Tensor3.
Definition: matpackIII.h:132
A constant view of a Vector.
Definition: matpackI.h:476
Index np
Number of points describing the ppath.
Definition: ppath.h:52
ArrayOfGridPos gp_lon
Index position with respect to the longitude grid.
Definition: ppath.h:86
A constant view of a Matrix.
Definition: matpackI.h:982
Vector start_los
Start line-of-sight.
Definition: ppath.h:60
Workspace class.
Definition: workspace_ng.h:40
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
Index first_pos_before_altitude(const Ppath &p, const Numeric &alt)
Determines ppath position just below an altitude.
Definition: ppath.cc:537
Numeric geometrical_ppc(const Numeric &r, const Numeric &za)
Calculates the propagation path constant for pure geometrical calculations.
Definition: ppath.cc:96
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
The structure to describe a propagation path and releated quantities.
Definition: ppath.h:48
const Numeric POLELAT
Size of north and south poles.
Definition: ppath.h:97
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
ArrayOfGridPos gp_p
Index position with respect to the pressure grid.
Definition: ppath.h:82
This file contains the definition of String, the ARTS string class.