ARTS 2.5.10 (git: 2f1c442c)
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 "array.h"
33#include "arts.h"
34#include "messages.h"
35#include "ppath_struct.h"
36
37class Agenda;
38class Workspace;
39
45constexpr Numeric POLELAT = 90 - 1e-8;
46
56constexpr Numeric ANGTOL = 1e-6;
57
58/*===========================================================================
59 === Functions from ppath.cc
60 ===========================================================================*/
61
77void add_za_aa(Numeric& za,
78 Numeric& aa,
79 const Numeric& za0,
80 const Numeric& aa0,
81 const Numeric& dza,
82 const Numeric& daa);
83
106void cart2zaaa(Numeric& za,
107 Numeric& aa,
108 const Numeric& dx,
109 const Numeric& dy,
110 const Numeric& dz);
111
134void zaaa2cart(Numeric& dx,
135 Numeric& dy,
136 Numeric& dz,
137 const Numeric& za,
138 const Numeric& aa);
139
155void enu2zaaa(Numeric& za,
156 Numeric& aa,
157 const Numeric& de,
158 const Numeric& dn,
159 const Numeric& du);
160
176void zaaa2enu(Numeric& de,
177 Numeric& dn,
178 Numeric& du,
179 const Numeric& za,
180 const Numeric& aa);
181
197void diff_za_aa(Numeric& dza,
198 Numeric& daa,
199 const Numeric& za0,
200 const Numeric& aa0,
201 const Numeric& za,
202 const Numeric& aa);
203
211void error_if_limb_ppath(const Ppath& ppath);
212
226void find_tanpoint(Index& it, const Ppath& ppath);
227
240Index first_pos_before_altitude(const Ppath& p, const Numeric& alt);
241
254Numeric geometrical_ppc(const Numeric& r, const Numeric& za);
255
272 const Numeric& lat0,
273 const Numeric& za);
274
288Numeric geompath_l_at_r(const Numeric& ppc, const Numeric& r);
289
303Numeric geompath_r_at_l(const Numeric& ppc, const Numeric& l);
304
324 const Numeric& a_za,
325 const Numeric& r);
326
346bool is_los_downwards(const Numeric& za, const Numeric& tilt);
347
361Numeric plevel_angletilt(const Numeric& r, const Numeric& c);
362
388void plevel_slope_2d(Numeric& c1,
389 ConstVectorView lat_grid,
390 ConstVectorView refellipsoid,
391 ConstVectorView z_surf,
392 const GridPos& gp,
393 const Numeric& za);
394
419void plevel_slope_3d(Numeric& c1,
420 Numeric& c2,
421 ConstVectorView lat_grid,
422 ConstVectorView lon_grid,
423 ConstVectorView refellipsoid,
424 ConstMatrixView z_surf,
425 const GridPos& gp_lat,
426 const GridPos& gp_lon,
427 const Numeric& aa);
428
457 Ppath& ppath,
458 const Agenda& ppath_step_agenda,
459 const Index& atmosphere_dim,
460 const Vector& p_grid,
461 const Vector& lat_grid,
462 const Vector& lon_grid,
463 const Tensor3& z_field,
464 const Vector& f_grid,
465 const Vector& refellipsoid,
466 const Matrix& z_surface,
467 const Index& cloudbox_on,
468 const ArrayOfIndex& cloudbox_limits,
469 const Vector& rte_pos,
470 const Vector& rte_los,
471 const Numeric& ppath_lmax,
472 const Numeric& ppath_lraytrace,
473 const bool& ppath_inside_cloudbox_do,
474 const Verbosity& verbosity);
475
490void ppath_copy(Ppath& ppath1, const Ppath& ppath2, const Index& ncopy);
491
506void ppath_init_structure(Ppath& ppath,
507 const Index& atmosphere_dim,
508 const Index& np);
509
528void ppath_set_background(Ppath& ppath, const Index& case_nr);
529
573void ppath_start_stepping(Ppath& ppath,
574 const Index& atmosphere_dim,
575 ConstVectorView p_grid,
576 ConstVectorView lat_grid,
577 ConstVectorView lon_grid,
578 ConstTensor3View z_field,
579 ConstVectorView refellipsoid,
580 ConstMatrixView z_surface,
581 const Index& cloudbox_on,
582 const ArrayOfIndex& cloudbox_limits,
583 const bool& outside_cloudbox,
584 ConstVectorView rte_pos,
585 ConstVectorView rte_los,
586 const Verbosity& verbosity);
587
612void ppath_step_geom_1d(Ppath& ppath,
613 ConstVectorView z_field,
614 ConstVectorView refellipsoid,
615 const Numeric& z_surface,
616 const Numeric& lmax);
617
633void ppath_step_geom_2d(Ppath& ppath,
634 ConstVectorView lat_grid,
635 ConstMatrixView z_field,
636 ConstVectorView refellipsoid,
637 ConstVectorView z_surface,
638 const Numeric& lmax);
639
656void ppath_step_geom_3d(Ppath& ppath,
657 ConstVectorView lat_grid,
658 ConstVectorView lon_grid,
659 ConstTensor3View z_field,
660 ConstVectorView refellipsoid,
661 ConstMatrixView z_surface,
662 const Numeric& lmax);
663
691 Ppath& ppath,
692 ConstVectorView p_grid,
693 ConstTensor3View z_field,
694 ConstTensor3View t_field,
695 ConstTensor4View vmr_field,
696 ConstVectorView f_grid,
697 ConstVectorView refellipsoid,
698 const Numeric& z_surface,
699 const Numeric& lmax,
700 const Agenda& refr_index_agenda,
701 const String& rtrace_method,
702 const Numeric& lraytrace);
703
730 Ppath& ppath,
731 ConstVectorView p_grid,
732 ConstVectorView lat_grid,
733 ConstTensor3View z_field,
734 ConstTensor3View t_field,
735 ConstTensor4View vmr_field,
736 ConstVectorView f_grid,
737 ConstVectorView refellipsoid,
738 ConstVectorView z_surface,
739 const Numeric& lmax,
740 const Agenda& refr_index_agenda,
741 const String& rtrace_method,
742 const Numeric& lraytrace);
743
771 Ppath& ppath,
772 ConstVectorView p_grid,
773 ConstVectorView lat_grid,
774 ConstVectorView lon_grid,
775 ConstTensor3View z_field,
776 ConstTensor3View t_field,
777 ConstTensor4View vmr_field,
778 ConstVectorView f_grid,
779 ConstVectorView refellipsoid,
780 ConstMatrixView z_surface,
781 const Numeric& lmax,
782 const Agenda& refr_index_agenda,
783 const String& rtrace_method,
784 const Numeric& lraytrace);
785
797Index ppath_what_background(const Ppath& ppath);
798
820void resolve_lon(Numeric& lon, const Numeric& lon5, const Numeric& lon6);
821
844void zaaa2cart(Numeric& dx,
845 Numeric& dy,
846 Numeric& dz,
847 const Numeric& za,
848 const Numeric& aa);
849
850#endif // ppath_h
This file contains the definition of Array.
The global header file for ARTS.
The Agenda class.
Definition: agenda_class.h:69
A constant view of a Matrix.
Definition: matpackI.h:1065
A constant view of a Tensor3.
Definition: matpackIII.h:133
A constant view of a Tensor4.
Definition: matpackIV.h:133
A constant view of a Vector.
Definition: matpackI.h:521
The Matrix class.
Definition: matpackI.h:1285
The Tensor3 class.
Definition: matpackIII.h:352
The Vector class.
Definition: matpackI.h:910
Workspace class.
Definition: workspace_ng.h:53
Array< WorkspaceVariable > ws
Workspace variable container.
Definition: workspace_ng.h:73
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
Declarations having to do with the four output streams.
constexpr Numeric POLELAT
Size of north and south poles.
Definition: ppath.h:45
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:4317
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:623
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:313
Numeric geompath_r_at_l(const Numeric &ppc, const Numeric &l)
Calculates the radius for a distance from the tangent point.
Definition: ppath.cc:170
void error_if_limb_ppath(const Ppath &ppath)
Throws an error if ppath altitudes not are strictly increasing or decreasing.
Definition: ppath.cc:541
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:430
Index ppath_what_background(const Ppath &ppath)
Returns the case number for the radiative background.
Definition: ppath.cc:1477
Index first_pos_before_altitude(const Ppath &p, const Numeric &alt)
Determines ppath position just below an altitude.
Definition: ppath.cc:523
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:4477
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:3252
constexpr Numeric ANGTOL
Width of zenith and nadir directions.
Definition: ppath.h:56
Numeric geometrical_ppc(const Numeric &r, const Numeric &za)
Calculates the propagation path constant for pure geometrical calculations.
Definition: ppath.cc:97
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:392
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:336
void ppath_copy(Ppath &ppath1, const Ppath &ppath2, const Index &ncopy)
Copy the content in ppath2 to ppath1.
Definition: ppath.cc:1497
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:327
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:1146
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:2718
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:104
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:300
void find_tanpoint(Index &it, const Ppath &ppath)
Identifies the tangent point of a propagation path.
Definition: ppath.cc:511
void ppath_set_background(Ppath &ppath, const Index &case_nr)
Sets the background field of a Ppath structure.
Definition: ppath.cc:1451
void resolve_lon(Numeric &lon, const Numeric &lon5, const Numeric &lon6)
Resolves which longitude angle that shall be used.
Definition: ppath.cc:501
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:149
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:3902
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:5179
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:3558
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:2354
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:1410
Numeric plevel_angletilt(const Numeric &r, const Numeric &c)
Calculates the angular tilt of the surface or a pressure level.
Definition: ppath.cc:617
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:159
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:580
Structure to store a grid position.
Definition: interpolation.h:73
The structure to describe a propagation path and releated quantities.
Definition: ppath_struct.h:17
#define c