ARTS  2.2.66
m_ppath.cc
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 
18 
19 
20 /*===========================================================================
21  === File description
22  ===========================================================================*/
23 
40 /*===========================================================================
41  === External declarations
42  ===========================================================================*/
43 
44 #include <cmath>
45 #include "arts.h"
46 #include "auto_md.h"
47 #include "check_input.h"
48 #include "geodetic.h"
49 #include "lin_alg.h"
50 #include "math_funcs.h"
51 #include "messages.h"
52 #include "ppath.h"
53 #include "special_interp.h"
54 #include "m_xml.h"
55 #include "xml_io.h"
56 #include "refraction.h"
57 #include "m_general.h"
58 
59 extern const Numeric RAD2DEG;
60 extern const Numeric DEG2RAD;
61 
62 
63 
64 /*===========================================================================
65  === The functions (in alphabetical order)
66  ===========================================================================*/
67 
68 /* Workspace method: Doxygen documentation will be auto-generated */
69 void ppathCalc(
70  Workspace& ws,
71  Ppath& ppath,
72  const Agenda& ppath_agenda,
73  const Numeric& ppath_lraytrace,
74  const Index& atmgeom_checked,
75  const Tensor3& t_field,
76  const Tensor3& z_field,
77  const Tensor4& vmr_field,
78  const Vector& f_grid,
79  const Index& cloudbox_on,
80  const Index& cloudbox_checked,
81  const Index& ppath_inside_cloudbox_do,
82  const Vector& rte_pos,
83  const Vector& rte_los,
84  const Vector& rte_pos2,
85  const Verbosity& )
86 {
87  // Basics
88  //
89  if( atmgeom_checked != 1 )
90  throw runtime_error( "The atmospheric geometry must be flagged to have "
91  "passed a consistency check (atmgeom_checked=1)." );
92  if( cloudbox_checked != 1 )
93  throw runtime_error( "The cloudbox must be flagged to have "
94  "passed a consistency check (cloudbox_checked=1)." );
95 
96  ppath_agendaExecute( ws, ppath, ppath_lraytrace, rte_pos, rte_los, rte_pos2,
97  cloudbox_on, ppath_inside_cloudbox_do, t_field, z_field,
98  vmr_field, f_grid, ppath_agenda );
99 }
100 
101 
102 
103 /* Workspace method: Doxygen documentation will be auto-generated */
105  Workspace& ws,
106  Ppath& ppath,
107  Vector& rte_los,
108  Numeric& ppath_lraytrace,
109  const Agenda& ppath_step_agenda,
110  const Index& atmosphere_dim,
111  const Vector& p_grid,
112  const Vector& lat_grid,
113  const Vector& lon_grid,
114  const Tensor3& t_field,
115  const Tensor3& z_field,
116  const Tensor4& vmr_field,
117  const Vector& f_grid,
118  const Vector& refellipsoid,
119  const Matrix& z_surface,
120  const Vector& rte_pos,
121  const Vector& rte_pos2,
122  const Numeric& za_accuracy,
123  const Numeric& pplrt_factor,
124  const Numeric& pplrt_lowest,
125  const Verbosity& verbosity )
126 {
127  //--- Check input -----------------------------------------------------------
128  if( atmosphere_dim == 2 )
129  throw runtime_error( "2D atmospheres not yet handled. Support for negative"
130  " zenith angles needed. Remind me (Patrick) to fix this." );
131  //---------------------------------------------------------------------------
132 
133  // Geometric LOS from rte_pos to rte_pos2
134  Vector rte_los_geom;
135  rte_losGeometricFromRtePosToRtePos2( rte_los_geom, atmosphere_dim, lat_grid,
136  lon_grid, refellipsoid, rte_pos, rte_pos2, verbosity );
137 
138  // Radius of rte_pos and rte_pos2
139  const Numeric r1 = pos2refell_r( atmosphere_dim, refellipsoid, lat_grid,
140  lon_grid, rte_pos ) + rte_pos[0];
141  const Numeric r2 = pos2refell_r( atmosphere_dim, refellipsoid, lat_grid,
142  lon_grid, rte_pos2 ) + rte_pos2[0];
143 
144  // Geometric distance between rte_pos and rte_pos2, effective 2D-lat for
145  // rte_pos and and Cartesian coordinates of rte_pos:
146  Numeric l12, lat1=0, x1, y1=0, z1;
147  if( atmosphere_dim <= 2 )
148  {
149  if( atmosphere_dim == 2 )
150  { lat1 = rte_pos[1]; }
151  distance2D( l12, r1, lat1, r2, rte_pos2[1] );
152  pol2cart( x1, z1, r1, lat1 );
153  }
154  else
155  {
156  distance3D( l12, r1, rte_pos[1], rte_pos[2],
157  r2, rte_pos2[1], rte_pos2[2] );
158  sph2cart( x1, y1, z1, r1, rte_pos[1], rte_pos[2] );
159  }
160 
161  // Define remaining variables used in the while-loop below
162  //
163  // Basic bookkeeping variables
164  Numeric za_upp_limit = 180;
165  Numeric za_low_limit = 0;
166  //
167  // Various variables associated with the ppath, and the point of the path
168  // closest to the transmitter
169  Ppath ppt; // "Test ppath"
170  Index ip = -999; // Index of closest ppath point
171  Numeric dxip, dyip=0, dzip; // Cartesian LOS of the closest ppath point
172  //
173  // Data for the intersection of the l12-sphere
174  Vector posc(max( Index(2),atmosphere_dim));
175  Numeric rc, xc, yc=0, zc;
176 
177  CREATE_OUT2;
178  CREATE_OUT3;
179 
180  const Index maxiter=99;
181  Vector t_za(maxiter,-999), t_dza(maxiter,-999);
182  Index it = -1;
183 
184  // Keep trying until ready or ground intersetion determined
185  //
186  bool ground = false;
187  bool failed = false;
188  Index ntries = 0;
189  //
190  while( true )
191  {
192  // Path for present rte_los (no cloudbox!)
193  ppath_calc( ws, ppt, ppath_step_agenda, atmosphere_dim, p_grid, lat_grid,
194  lon_grid, t_field, z_field, vmr_field,
195  f_grid, refellipsoid, z_surface, 0, ArrayOfIndex(0),
196  rte_pos, rte_los, ppath_lraytrace, 0, verbosity );
197 
198  // Find the point closest to rte_pos2, on the side towards rte_pos.
199  // We do this by looking at the distance to rte_pos, that should be
200  // as close to l12 as possible, but not exceed it.
201  Numeric lip = 99e99;
202  ip = ppt.np;
203  //
204  while( lip >= l12 && ip > 0 )
205  {
206  ip--;
207  if( atmosphere_dim <= 2 )
208  { distance2D( lip, r1, lat1, ppt.r[ip], ppt.pos(ip,1) ); }
209  else
210  { distance3D( lip, r1, rte_pos[1], rte_pos[2],
211  ppt.r[ip], ppt.pos(ip,1), ppt.pos(ip,2) ); }
212  }
213 
214  Numeric za_new, daa=0;
215 
216  // Surface intersection:
217  // Not OK if the ground position is too far from rte_pos2.
218  // (30 km selected to allow misses of smaller size when rte_pos2 is at
219  // surface level, but surface interference never OK if rte_pos above TOA)
220  if( ppath_what_background(ppt) == 2 && ip == ppt.np-1
221  && l12-lip > 30e3 )
222  {
223  za_new = rte_los[0] - 1;
224  za_upp_limit = rte_los[0];
225  }
226 
227  // Ppath OK
228  else
229  {
230  // Estimate ppath at the distance of l12, and calculate size
231  // of "miss" (measured in diffference in geometric angles)
232  Vector los;
233  Numeric dza;
234  if( atmosphere_dim <= 2 )
235  {
236  // Convert pos and los for point ip to cartesian coordinates
237  Numeric xip, zip;
238  poslos2cart( xip, zip, dxip, dzip, ppt.r[ip], ppt.pos(ip,1),
239  ppt.los(ip,0) );
240  // Find where the extension from point ip crosses the l12
241  // sphere: point c
242  Numeric latc;
243  line_circle_intersect( xc, zc, xip, zip, dxip, dzip, x1, z1, l12);
244  cart2pol( rc, latc, xc, zc, ppt.pos(ip,1), ppt.los(ip,0) );
245  posc[1] = latc;
246  posc[0] = rc - pos2refell_r( atmosphere_dim, refellipsoid,
247  lat_grid, lon_grid, posc );
248  }
249  else
250  {
251  // Convert pos and los for point ip to cartesian coordinates
252  Numeric xip, yip, zip;
253  poslos2cart( xip, yip, zip, dxip, dyip, dzip, ppt.r[ip],
254  ppt.pos(ip,1), ppt.pos(ip,2),
255  ppt.los(ip,0), ppt.los(ip,1) );
256  // Find where the extension from point ip crosses the l12
257  // sphere: point c
258  Numeric latc, lonc;
259  line_sphere_intersect( xc, yc, zc, xip, yip, zip,
260  dxip, dyip, dzip, x1, y1, z1, l12 );
261  cart2sph( rc, latc, lonc, xc, yc, zc, ppt.pos(ip,1),
262  ppt.pos(ip,2), ppt.los(ip,0), ppt.los(ip,1) );
263  posc[1] = latc;
264  posc[2] = lonc;
265  posc[0] = rc - pos2refell_r( atmosphere_dim, refellipsoid,
266  lat_grid, lon_grid, posc );
267  }
268  //
269  rte_losGeometricFromRtePosToRtePos2( los, atmosphere_dim,
270  lat_grid, lon_grid, refellipsoid, rte_pos, posc, verbosity );
271  //
272  dza = los[0] - rte_los_geom[0];
273 
274  // Update bookkeeping variables
275  it++;
276  t_za[it] = rte_los[0];
277  t_dza[it] = dza;
278  /*
279  cout << "[\n";
280  for( Index k=0; k<=it; k++ )
281  { cout << fixed << setprecision(7) << t_za[k] << " "
282  << t_dza[k] << endl; } cout << "];\n";
283  */
284  //
285  if( dza > 0 && rte_los[0] < za_upp_limit )
286  { za_upp_limit = rte_los[0]; }
287  else if( dza < 0 && rte_los[0] > za_low_limit )
288  { za_low_limit = rte_los[0]; }
289  //cout << za_low_limit << " - " << za_upp_limit << endl;
290 
291  // Ready ?
292  if( abs(dza) <= za_accuracy )
293  {
294  break;
295  }
296  else if( za_upp_limit - za_low_limit <= za_accuracy/10 )
297  {
298  if( max(t_dza) < -10*za_accuracy )
299  {
300  ground = true;
301  out3 << " Ground intersection determined !!!\n";
302  break;
303  }
304  else
305  {
306  failed = true;
307  out3 << " Zenith angle search range closed !!!\n";
308  break;
309  }
310  }
311  // Catch non-convergence (just for extra safety, za-range should be
312  // closed quicker than this)
313  ntries += 1;
314  if( ntries >= maxiter )
315  {
316  failed = true;
317  out3 << " Too many iterations !!!\n";
318  break;
319  }
320 
321  // Estimate new angle
322  if( it < 1 )
323  { za_new = rte_los[0] - dza; }
324  else
325  {
326  // Estimate new angle by linear regression over some of the
327  // last calculations
328  const Index nfit = min( it+1, (Index)3 );
329  const Index i0 = it - nfit + 1;
330  Vector p;
331  linreg( p, t_za[Range(i0,nfit)], t_dza[Range(i0,nfit)] );
332  za_new = -p[0]/p[1];
333  }
334  //
335  if( atmosphere_dim == 3 )
336  { daa = los[1] - rte_los_geom[1]; }
337  }
338 
339  // Update rte_los. Use bisection of za_new is basically
340  // identical to old angle, or is outside lower or upper
341  // limit. Otherwise use reult of linear reg.
342  if( isinf(za_new) ||
343  isnan(za_new) ||
344  abs(za_new-rte_los[0]) < 0.99*za_accuracy ||
345  za_new <= za_low_limit ||
346  za_new >= za_upp_limit )
347  {
348  rte_los[0] = (za_low_limit+za_upp_limit)/2;
349  }
350  else
351  {
352  rte_los[0] = za_new;
353  if( atmosphere_dim == 3 )
354  { rte_los[1] -= daa; }
355  }
356  } // while
357  //--------------------------------------------------------------------------
358 
359  // If failed re-try with a shorter ppath_lraytrace, if not ending up with
360  // a too small value.
361  if( failed )
362  {
363  ppath_lraytrace /= pplrt_factor;
364 
365  if( ppath_lraytrace >= pplrt_lowest )
366  {
367  out2 << " Re-start with ppath_lraytrace = " << ppath_lraytrace;
368  ppathFromRtePos2( ws, ppath, rte_los, ppath_lraytrace,
369  ppath_step_agenda, atmosphere_dim,
370  p_grid, lat_grid, lon_grid, t_field, z_field,
371  vmr_field, f_grid, refellipsoid,
372  z_surface, rte_pos, rte_pos2, za_accuracy,
373  pplrt_factor, pplrt_lowest, verbosity );
374  }
375  else
376  {
377  ppath_init_structure( ppath, atmosphere_dim, 1 );
378  ppath_set_background( ppath, 0 );
379  }
380  return; // --->
381  }
382 
383 
384  // Create final ppath.
385  // If ground intersection: Set to length 1 and ground background,
386  // to flag non-OK path
387  // Otherwise: Fill path and set background to transmitter
388 
389  if( ground )
390  {
391  ppath_init_structure( ppath, atmosphere_dim, 1 );
392  ppath_set_background( ppath, 2 );
393  }
394 
395  else
396  {
397  // Distance between point ip of ppt and posc
398  Numeric ll;
399  if( atmosphere_dim <= 2 )
400  { distance2D( ll, rc, posc[1], ppt.r[ip], ppt.pos(ip,1) ); }
401  else
402  { distance3D( ll, rc, posc[1], posc[2], ppt.r[ip], ppt.pos(ip,1),
403  ppt.pos(ip,2) ); }
404 
405  // Last point of ppt closest to rte_pos2. No point to add, maybe
406  // calculate start_lstep and start_los:
407  if( ip == ppt.np-1 )
408  {
409  ppath_init_structure( ppath, atmosphere_dim, ppt.np );
410  ppath_copy( ppath, ppt, -1 );
411  if( ppath_what_background( ppath ) == 1 )
412  {
413  ppath.start_lstep= ll;
414  Numeric d1, d2=0, d3;
415  if( atmosphere_dim <= 2 )
416  { cart2poslos( d1, d3, ppath.start_los[0], xc, zc, dxip, dzip,
417  ppt.r[ip]*sin(DEG2RAD*ppt.los(ip,0)),
418  ppt.pos(ip,1), ppt.los(ip,0) ); }
419  else
420  { cart2poslos( d1, d2, d3, ppath.start_los[0], ppath.start_los[1],
421  xc, yc, zc, dxip, dyip, dzip,
422  ppt.r[ip]*sin(DEG2RAD*ppt.los(ip,0)),
423  ppt.pos(ip,1), ppt.pos(ip,2),
424  ppt.los(ip,0), ppt.los(ip,1) ); }
425  }
426  }
427  // rte_pos2 inside the atmosphere (posc entered as end point)
428  else
429  {
430  ppath_init_structure( ppath, atmosphere_dim, ip+2 );
431  ppath_copy( ppath, ppt, ip+1 );
432  //
433  const Index i = ip+1;
434  if( atmosphere_dim <= 2 )
435  { cart2poslos( ppath.r[i], ppath.pos(i,1), ppath.los(i,0), xc, zc,
436  dxip, dzip, ppt.r[ip]*sin(DEG2RAD*ppt.los(ip,0)),
437  ppt.pos(ip,1), ppt.los(ip,0) ); }
438  else
439  { cart2poslos( ppath.r[i], ppath.pos(i,1), ppath.pos(i,2),
440  ppath.los(i,0), ppath.los(i,1), xc, yc, zc,
441  dxip, dyip, dzip,
442  ppt.r[ip]*sin(DEG2RAD*ppt.los(ip,0)),
443  ppt.pos(ip,1), ppt.pos(ip,2),
444  ppt.los(ip,0), ppt.los(ip,1) ); }
445  //
446  ppath.pos(i,joker) = posc;
447  ppath.lstep[i-1] = ll;
448  ppath.start_los = ppath.los(i,joker);
449 
450  // n by linear interpolation
451  assert( ll < ppt.lstep[i-1] );
452  const Numeric w = ll/ppt.lstep[i-1];
453  ppath.nreal[i] = (1-w)*ppt.nreal[i-1] + w*ppt.nreal[i];
454  ppath.ngroup[i] = (1-w)*ppt.ngroup[i-1] + w*ppt.ngroup[i];
455 
456  // Grid positions
457  GridPos gp_lat, gp_lon;
458  rte_pos2gridpos( ppath.gp_p[i], gp_lat, gp_lon,
459  atmosphere_dim, p_grid, lat_grid, lon_grid, z_field,
460  ppath.pos(i,Range(0,atmosphere_dim)) );
461  if( atmosphere_dim >= 2 )
462  {
463  gridpos_copy( ppath.gp_lat[i], gp_lat );
464  if( atmosphere_dim == 3 )
465  { gridpos_copy( ppath.gp_lon[i], gp_lon ); }
466  }
467  }
468 
469  // Common stuff
470  ppath_set_background( ppath, 9 );
471  ppath.start_pos = rte_pos2;
472  }
473 }
474 
475 
476 
477 /* Workspace method: Doxygen documentation will be auto-generated */
479  Workspace& ws,
480  Ppath& ppath,
481  const Agenda& ppath_step_agenda,
482  const Index& ppath_inside_cloudbox_do,
483  const Index& atmosphere_dim,
484  const Vector& p_grid,
485  const Vector& lat_grid,
486  const Vector& lon_grid,
487  const Tensor3& t_field,
488  const Tensor3& z_field,
489  const Tensor4& vmr_field,
490  const Vector& f_grid,
491  const Vector& refellipsoid,
492  const Matrix& z_surface,
493  const Index& cloudbox_on,
494  const ArrayOfIndex& cloudbox_limits,
495  const Vector& rte_pos,
496  const Vector& rte_los,
497  const Numeric& ppath_lraytrace,
498  const Verbosity& verbosity)
499 {
500  ppath_calc( ws, ppath, ppath_step_agenda, atmosphere_dim, p_grid, lat_grid,
501  lon_grid, t_field, z_field, vmr_field, f_grid,
502  refellipsoid, z_surface, cloudbox_on, cloudbox_limits, rte_pos,
503  rte_los, ppath_lraytrace, ppath_inside_cloudbox_do, verbosity );
504 }
505 
506 
507 
508 
509 /* Workspace method: Doxygen documentation will be auto-generated */
510 void ppath_stepGeometric(// WS Output:
511  Ppath& ppath_step,
512  // WS Input:
513  const Index& atmosphere_dim,
514  const Vector& lat_grid,
515  const Vector& lon_grid,
516  const Tensor3& z_field,
517  const Vector& refellipsoid,
518  const Matrix& z_surface,
519  const Numeric& ppath_lmax,
520  const Verbosity&)
521 {
522  // Input checks here would be rather costly as this function is called
523  // many times. So we perform asserts in the sub-functions, but no checks
524  // here.
525 
526  // A call with background set, just wants to obtain the refractive index for
527  // complete ppaths consistent of a single point.
528  if( !ppath_what_background( ppath_step ) )
529  {
530  if( atmosphere_dim == 1 )
531  { ppath_step_geom_1d( ppath_step, z_field(joker,0,0),
532  refellipsoid, z_surface(0,0), ppath_lmax ); }
533 
534  else if( atmosphere_dim == 2 )
535  { ppath_step_geom_2d( ppath_step, lat_grid,
536  z_field(joker,joker,0), refellipsoid,
537  z_surface(joker,0), ppath_lmax ); }
538 
539  else if( atmosphere_dim == 3 )
540  { ppath_step_geom_3d( ppath_step, lat_grid, lon_grid,
541  z_field, refellipsoid, z_surface, ppath_lmax ); }
542 
543  else
544  { throw runtime_error( "The atmospheric dimensionality must be 1-3." );}
545  }
546 
547  else
548  {
549  assert( ppath_step.np == 1 );
550  ppath_step.nreal[0] = 1;
551  ppath_step.ngroup[0] = 1;
552  }
553 }
554 
555 
556 
557 
558 /* Workspace method: Doxygen documentation will be auto-generated */
560  Workspace& ws,
561  Ppath& ppath_step,
562  const Agenda& refr_index_air_agenda,
563  const Index& atmosphere_dim,
564  const Vector& p_grid,
565  const Vector& lat_grid,
566  const Vector& lon_grid,
567  const Tensor3& z_field,
568  const Tensor3& t_field,
569  const Tensor4& vmr_field,
570  const Vector& refellipsoid,
571  const Matrix& z_surface,
572  const Vector& f_grid,
573  const Numeric& ppath_lmax,
574  const Numeric& ppath_lraytrace,
575  const Verbosity&)
576 {
577  // Input checks here would be rather costly as this function is called
578  // many times.
579  assert( ppath_lraytrace > 0 );
580 
581  // A call with background set, just wants to obtain the refractive index for
582  // complete ppaths consistent of a single point.
583  if( !ppath_what_background( ppath_step ) )
584  {
585  if( atmosphere_dim == 1 )
586  {
587  ppath_step_refr_1d( ws, ppath_step, p_grid,
588  z_field, t_field, vmr_field,
589  f_grid, refellipsoid, z_surface(0,0),
590  ppath_lmax, refr_index_air_agenda,
591  "linear_basic", ppath_lraytrace );
592  }
593  else if( atmosphere_dim == 2 )
594  {
595  ppath_step_refr_2d( ws, ppath_step, p_grid, lat_grid,
596  z_field, t_field, vmr_field,
597  f_grid, refellipsoid, z_surface(joker,0),
598  ppath_lmax, refr_index_air_agenda,
599  "linear_basic", ppath_lraytrace );
600  }
601  else if( atmosphere_dim == 3 )
602  {
603  ppath_step_refr_3d( ws, ppath_step, p_grid, lat_grid, lon_grid,
604  z_field, t_field, vmr_field,
605  f_grid, refellipsoid, z_surface,
606  ppath_lmax, refr_index_air_agenda,
607  "linear_basic", ppath_lraytrace );
608  }
609  else
610  { throw runtime_error( "The atmospheric dimensionality must be 1-3." );}
611  }
612 
613  else
614  {
615  assert( ppath_step.np == 1 );
616  if( atmosphere_dim == 1 )
617  { get_refr_index_1d( ws, ppath_step.nreal[0], ppath_step.ngroup[0],
618  refr_index_air_agenda, p_grid, refellipsoid,
619  z_field, t_field, vmr_field,
620  f_grid, ppath_step.r[0] );
621  }
622  else if( atmosphere_dim == 2 )
623  { get_refr_index_2d( ws, ppath_step.nreal[0], ppath_step.ngroup[0],
624  refr_index_air_agenda, p_grid, lat_grid,
625  refellipsoid, z_field, t_field, vmr_field,
626  f_grid, ppath_step.r[0],
627  ppath_step.pos(0,1) );
628  }
629  else
630  { get_refr_index_3d( ws, ppath_step.nreal[0], ppath_step.ngroup[0],
631  refr_index_air_agenda, p_grid, lat_grid, lon_grid,
632  refellipsoid, z_field, t_field, vmr_field,
633  f_grid, ppath_step.r[0],
634  ppath_step.pos(0,1), ppath_step.pos(0,2) );
635  }
636  }
637 }
638 
639 
640 
641 
642 /* Workspace method: Doxygen documentation will be auto-generated */
644  Vector& rte_los,
645  const Index& atmosphere_dim,
646  const Numeric& za,
647  const Numeric& aa,
648  const Verbosity&)
649 {
650  // Check input
651  chk_if_in_range( "atmosphere_dim", atmosphere_dim, 1, 3 );
652 
653  if( atmosphere_dim == 1 )
654  { rte_los.resize(1); }
655  else
656  {
657  rte_los.resize(2);
658  rte_los[1] = aa;
659  }
660  rte_los[0] = za;
661 }
662 
663 
664 
665 
666 /* Workspace method: Doxygen documentation will be auto-generated */
668  Vector& rte_los,
669  const Index& atmosphere_dim,
670  const Vector& lat_grid,
671  const Vector& lon_grid,
672  const Vector& refellipsoid,
673  const Vector& rte_pos,
674  const Vector& rte_pos2,
675  const Verbosity& )
676 {
677  // Check input
678  chk_rte_pos( atmosphere_dim, rte_pos );
679  chk_rte_pos( atmosphere_dim, rte_pos2, true );
680 
681  // Radius of rte_pos and rte_pos2
682  const Numeric r1 = pos2refell_r( atmosphere_dim, refellipsoid, lat_grid,
683  lon_grid, rte_pos ) + rte_pos[0];
684  const Numeric r2 = pos2refell_r( atmosphere_dim, refellipsoid, lat_grid,
685  lon_grid, rte_pos2 ) + rte_pos2[0];
686 
687  // Remaining polar and cartesian coordinates of rte_pos
688  Numeric lat1, lon1=0, x1, y1=0, z1;
689  // Cartesian coordinates of rte_pos2
690  Numeric x2, y2=0, z2;
691  //
692  if( atmosphere_dim == 1 )
693  {
694  // Latitude distance implicitly checked by chk_rte_pos
695  lat1 = 0;
696  pol2cart( x1, z1, r1, lat1 );
697  pol2cart( x2, z2, r2, rte_pos2[1] );
698  }
699  else if( atmosphere_dim == 2 )
700  {
701  lat1 = rte_pos[1];
702  pol2cart( x1, z1, r1, lat1 );
703  pol2cart( x2, z2, r2, rte_pos2[1] );
704  }
705  else
706  {
707  lat1 = rte_pos[1];
708  lon1 = rte_pos[2];
709  sph2cart( x1, y1, z1, r1, lat1, lon1 );
710  sph2cart( x2, y2, z2, r2, rte_pos2[1], rte_pos2[2] );
711  }
712 
713  // Geometrical LOS to transmitter
714  Numeric za, aa;
715  //
716  los2xyz( za, aa, r1, lat1, lon1, x1, y1, z1, x2, y2, z2 );
717  //
718  if( atmosphere_dim == 3 )
719  {
720  rte_los.resize(2);
721  rte_los[0] = za;
722  rte_los[1] = aa;
723  }
724  else
725  {
726  rte_los.resize(1);
727  rte_los[0] = za;
728  if( atmosphere_dim == 2 && aa < 0 ) // Should 2D-za be negative?
729  { rte_los[0] = -za; }
730  }
731 }
732 
733 
734 
735 
736 /* Workspace method: Doxygen documentation will be auto-generated */
738  Vector& rte_pos,
739  const Index& atmosphere_dim,
740  const Numeric& z,
741  const Numeric& lat,
742  const Numeric& lon,
743  const Verbosity&)
744 {
745  // Check input
746  chk_if_in_range( "atmosphere_dim", atmosphere_dim, 1, 3 );
747 
748  rte_pos.resize(atmosphere_dim);
749  rte_pos[0] = z;
750  if( atmosphere_dim >= 2 )
751  { rte_pos[1] = lat; }
752  if( atmosphere_dim == 3 )
753  { rte_pos[2] = lon; }
754 }
755 
756 
757 
758 /* Workspace method: Doxygen documentation will be auto-generated */
760  Vector& rte_pos,
761  Vector& rte_los,
762  const Index& atmosphere_dim,
763  const Ppath& ppath,
764  const Verbosity&)
765 {
766  const Index np = ppath.np;
767 
768  // Check input
769  chk_if_in_range( "atmosphere_dim", atmosphere_dim, 1, 3 );
770  if( np == 0 )
771  throw runtime_error( "The input *ppath* is empty." );
772  if( ppath.pos.nrows() != np )
773  throw runtime_error( "Internal inconsistency in *ppath* (size of data "
774  "does not match np)." );
775 
776  rte_pos = ppath.pos(np-1,Range(0,atmosphere_dim));
777  if( atmosphere_dim < 3 )
778  { rte_los = ppath.los(np-1,Range(0,1)); }
779  else
780  { rte_los = ppath.los(np-1,Range(0,2)); }
781 }
782 
783 
784 
785 
786 /* Workspace method: Doxygen documentation will be auto-generated */
788  Vector& tan_pos,
789  const Ppath& ppath,
790  const Verbosity& )
791 {
792  Index it;
793  find_tanpoint( it, ppath );
794 
795  tan_pos.resize( ppath.pos.ncols() );
796 
797  if( it < 0 )
798  {
799  tan_pos = sqrt( -1 ); // = NaN
800  }
801  else
802  {
803  tan_pos[0] = ppath.pos(it,0);
804  tan_pos[1] = ppath.pos(it,1);
805  if( ppath.pos.ncols() == 3 )
806  { tan_pos[2] = ppath.pos(it,2); }
807  }
808 }
809 
810 
811 
812 
813 /* Workspace method: Doxygen documentation will be auto-generated */
815  const Ppath& ppath,
816  const Index& level,
817  const Verbosity& verbosity)
818 {
819  Index it;
820  find_tanpoint( it, ppath );
821 
822  ostringstream os;
823 
824  if( it < 0 )
825  {
826  os << "Lowest altitude found at the end of the propagation path.\n"
827  << "This indicates that the tangent point is either above the\n"
828  << "top-of-the-atmosphere or below the planet's surface.";
829  }
830  else
831  {
832  os << "Tangent point position:\n-----------------------\n"
833  << " z = " << ppath.pos(it,0)/1e3 << " km\n"
834  << " lat = " << ppath.pos(it,1) << " deg";
835  if( ppath.pos.ncols() == 3 )
836  os << "\n lon: " << ppath.pos(it,2) << " deg";
837  }
838 
839  CREATE_OUTS;
840  SWITCH_OUTPUT (level, os.str ());
841 }
842 
843 
844 
845 
846 /* Workspace method: Doxygen documentation will be auto-generated */
848  Workspace& ws,
849  Vector& za_vector,
850  const Agenda& refr_index_air_agenda,
851  const Matrix& sensor_pos,
852  const Vector& p_grid,
853  const Tensor3& t_field,
854  const Tensor3& z_field,
855  const Tensor4& vmr_field,
856  const Vector& refellipsoid,
857  const Index& atmosphere_dim,
858  const Vector& f_grid,
859  const Vector& ztan_vector,
860  const Verbosity&)
861 {
862  if( atmosphere_dim != 1 ) {
863  throw runtime_error( "The function can only be used for 1D atmospheres." );
864  }
865 
866  if( ztan_vector.nelem() != sensor_pos.nrows() ) {
867  ostringstream os;
868  os << "The number of altitudes in true tangent altitude vector must\n"
869  << "match the number of positions in *sensor_pos*.";
870  throw runtime_error( os.str() );
871  }
872 
873  // Set za_vector's size equal to ztan_vector
874  za_vector.resize( ztan_vector.nelem() );
875 
876  // Define refraction variables
877  Numeric refr_index_air, refr_index_air_group;
878 
879  // Calculate refractive index for the tangential altitudes
880  for( Index i=0; i<ztan_vector.nelem(); i++ )
881  {
882  if( ztan_vector[i] > sensor_pos(i,0) )
883  {
884  ostringstream os;
885  os << "Invalid observation geometry: sensor (at z=" << sensor_pos(i,0)
886  << "m) is located below the requested tangent altitude (tanh="
887  << ztan_vector[i] << "m)";
888  throw runtime_error( os.str() );
889  }
890  else
891  {
892  get_refr_index_1d( ws, refr_index_air, refr_index_air_group,
893  refr_index_air_agenda, p_grid, refellipsoid[0],
894  z_field, t_field, vmr_field, f_grid,
895  ztan_vector[i] + refellipsoid[0] );
896 
897  // Calculate zenith angle
898  za_vector[i] = 180 - RAD2DEG* asin( refr_index_air *
899  (refellipsoid[0] + ztan_vector[i]) /
900  (refellipsoid[0] + sensor_pos(i,0)) );
901  }
902  }
903 }
904 
905 
906 
907 
908 
909 /* Workspace method: Doxygen documentation will be auto-generated */
911  Vector& za_vector,
912  const Matrix& sensor_pos,
913  const Vector& refellipsoid,
914  const Index& atmosphere_dim,
915  const Vector& ztan_vector,
916  const Verbosity&)
917 {
918  if( atmosphere_dim != 1 ) {
919  throw runtime_error( "The function can only be used for 1D atmospheres." );
920  }
921 
922  const Index npos = sensor_pos.nrows();
923 
924  if( ztan_vector.nelem() != npos )
925  {
926  ostringstream os;
927  os << "The number of altitudes in the geometric tangent altitude vector\n"
928  << "must match the number of positions in *sensor_pos*.";
929  throw runtime_error( os.str() );
930  }
931 
932  za_vector.resize( npos );
933 
934  for( Index i=0; i<npos; i++ )
935  {
936  if( ztan_vector[i] > sensor_pos(i,0) )
937  {
938  ostringstream os;
939  os << "Invalid observation geometry: sensor (at z=" << sensor_pos(i,0)
940  << "m) is located below the requested tangent altitude (tanh="
941  << ztan_vector[i] << "m)";
942  throw runtime_error( os.str() );
943  }
944  else
945  {
946  za_vector[i] = geompath_za_at_r( refellipsoid[0] + ztan_vector[i], 100,
947  refellipsoid[0] + sensor_pos(i,0) );
948  }
949  }
950 }
951 
952 
953 /* Workspace method: Doxygen documentation will be auto-generated */
954 void ppathWriteXMLPartial (//WS Input:
955  const String& file_format,
956  const Ppath& ppath,
957  // WS Generic Input:
958  const String& f,
959  const Index& file_index,
960  const Verbosity& verbosity)
961 {
962  String filename = f;
963  Ppath ppath_partial = ppath;
964  ArrayOfGridPos empty_gp;
965  //Vector empty_v;
966 
967  ppath_partial.gp_p = empty_gp;
968  ppath_partial.gp_lat = empty_gp;
969  ppath_partial.gp_lon = empty_gp;
970  //ppath_partial.nreal = empty_v;
971  //ppath_partial.ngroup = empty_v;
972 
973  if (file_index >= 0)
974  {
975  // Create default filename if empty
976  filename_xml_with_index( filename, file_index, "ppath" );
977  }
978 
979  WriteXML( file_format, ppath_partial, filename, 0,
980  "ppath", "", "", verbosity );
981 }
982 
983 
Matrix
The Matrix class.
Definition: matpackI.h:788
sph2cart
void sph2cart(Numeric &x, Numeric &y, Numeric &z, const Numeric &r, const Numeric &lat, const Numeric &lon)
sph2cart
Definition: geodetic.cc:1312
ppath_init_structure
void ppath_init_structure(Ppath &ppath, const Index &atmosphere_dim, const Index &np)
ppath_init_structure
Definition: ppath.cc:1726
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 &)
WORKSPACE METHOD: ppath_stepRefractionBasic.
Definition: m_ppath.cc:559
auto_md.h
gridpos_copy
void gridpos_copy(GridPos &gp_new, const GridPos &gp_old)
gridpos_copy
Definition: interpolation.cc:517
Tensor3
The Tensor3 class.
Definition: matpackIII.h:348
TangentPointExtract
void TangentPointExtract(Vector &tan_pos, const Ppath &ppath, const Verbosity &)
WORKSPACE METHOD: TangentPointExtract.
Definition: m_ppath.cc:787
rte_posSet
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.
Definition: m_ppath.cc:737
linreg
void linreg(Vector &p, ConstVectorView x, ConstVectorView y)
Definition: lin_alg.cc:371
find_tanpoint
void find_tanpoint(Index &it, const Ppath ppath)
find_tanpoint
Definition: ppath.cc:705
joker
const Joker joker
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_air_agenda, const String &rtrace_method, const Numeric &lraytrace)
ppath_step_refr_1d
Definition: ppath.cc:3809
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 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_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_lraytrace, const Verbosity &verbosity)
WORKSPACE METHOD: ppathStepByStep.
Definition: m_ppath.cc:478
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)
ppath_step_geom_2d
Definition: ppath.cc:3136
ppath_step_geom_1d
void ppath_step_geom_1d(Ppath &ppath, ConstVectorView z_field, ConstVectorView refellipsoid, const Numeric &z_surface, const Numeric &lmax)
ppath_step_geom_1d
Definition: ppath.cc:2783
filename_xml_with_index
void filename_xml_with_index(String &filename, const Index &file_index, const String &varname)
Gives the default filename, with file index, for the XML formats.
Definition: xml_io.cc:370
Vector::resize
void resize(Index n)
Resize function.
Definition: matpackI.cc:798
Ppath::start_lstep
Numeric start_lstep
Definition: ppath.h:66
SWITCH_OUTPUT
#define SWITCH_OUTPUT(x, y)
Definition: m_general.h:45
get_refr_index_1d
void get_refr_index_1d(Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r)
get_refr_index_1d
Definition: refraction.cc:141
VectorZtanToZa1D
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.
Definition: m_ppath.cc:910
ConstMatrixView::nrows
Index nrows() const
Returns the number of rows.
Definition: matpackI.cc:832
line_sphere_intersect
void line_sphere_intersect(Numeric &x, Numeric &y, Numeric &z, const Numeric &xl, const Numeric &yl, const Numeric &zl, const Numeric &dx, const Numeric &dy, const Numeric &dz, const Numeric &xc, const Numeric &yc, const Numeric &zc, const Numeric &r)
geomtanpoint
Definition: geodetic.cc:865
CREATE_OUT2
#define CREATE_OUT2
Definition: messages.h:213
cart2sph
void cart2sph(Numeric &r, Numeric &lat, Numeric &lon, const Numeric &x, const Numeric &y, const Numeric &z, const Numeric &lat0, const Numeric &lon0, const Numeric &za0, const Numeric &aa0)
cart2sph
Definition: geodetic.cc:596
DEG2RAD
const Numeric DEG2RAD
get_refr_index_2d
void get_refr_index_2d(Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r, const Numeric &lat)
get_refr_index_2d
Definition: refraction.cc:221
Tensor4
The Tensor4 class.
Definition: matpackIV.h:383
TangentPointPrint
void TangentPointPrint(const Ppath &ppath, const Index &level, const Verbosity &verbosity)
WORKSPACE METHOD: TangentPointPrint.
Definition: m_ppath.cc:814
ppath_agendaExecute
void ppath_agendaExecute(Workspace &ws, Ppath &ppath, const Numeric ppath_lraytrace, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Index cloudbox_on, const Index ppath_inside_cloudbox_do, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const Vector &f_grid, const Agenda &input_agenda)
Definition: auto_md.cc:14625
Ppath
The structure to describe a propagation path and releated quantities.
Definition: ppath.h:59
Ppath::gp_p
ArrayOfGridPos gp_p
Definition: ppath.h:76
Agenda
The Agenda class.
Definition: agenda_class.h:44
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_air_agenda, const String &rtrace_method, const Numeric &lraytrace)
ppath_step_refr_3d
Definition: ppath.cc:4466
cart2poslos
void cart2poslos(Numeric &r, Numeric &lat, Numeric &za, const Numeric &x, const Numeric &z, const Numeric &dx, const Numeric &dz, const Numeric &ppc, const Numeric &lat0, const Numeric &za0)
cart2poslos
Definition: geodetic.cc:125
w
cmplx FADDEEVA() w(cmplx z, double relerr)
Definition: Faddeeva.cc:679
Array< Index >
rte_pos_losMoveToStartOfPpath
void rte_pos_losMoveToStartOfPpath(Vector &rte_pos, Vector &rte_los, const Index &atmosphere_dim, const Ppath &ppath, const Verbosity &)
WORKSPACE METHOD: rte_pos_losMoveToStartOfPpath.
Definition: m_ppath.cc:759
cart2pol
void cart2pol(Numeric &r, Numeric &lat, const Numeric &x, const Numeric &z, const Numeric &lat0, const Numeric &za0)
cart2pol
Definition: geodetic.cc:82
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 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_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_lraytrace, const bool &ppath_inside_cloudbox_do, const Verbosity &verbosity)
ppath_calc
Definition: ppath.cc:5344
CREATE_OUT3
#define CREATE_OUT3
Definition: messages.h:214
Ppath::gp_lat
ArrayOfGridPos gp_lat
Definition: ppath.h:77
messages.h
Declarations having to do with the four output streams.
Ppath::ngroup
Vector ngroup
Definition: ppath.h:75
pos2refell_r
Numeric pos2refell_r(const Index &atmosphere_dim, ConstVectorView refellipsoid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstVectorView rte_pos)
pos2refell_r
Definition: geodetic.cc:1139
ConstMatrixView::ncols
Index ncols() const
Returns the number of columns.
Definition: matpackI.cc:838
my_basic_string
The implementation for String, the ARTS string class.
Definition: mystring.h:64
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 &)
WORKSPACE METHOD: ppath_stepGeometric.
Definition: m_ppath.cc:510
rte_losSet
void rte_losSet(Vector &rte_los, const Index &atmosphere_dim, const Numeric &za, const Numeric &aa, const Verbosity &)
WORKSPACE METHOD: rte_losSet.
Definition: m_ppath.cc:643
abs
#define abs(x)
Definition: continua.cc:20458
Ppath::los
Matrix los
Definition: ppath.h:68
Ppath::start_pos
Vector start_pos
Definition: ppath.h:64
Ppath::gp_lon
ArrayOfGridPos gp_lon
Definition: ppath.h:78
line_circle_intersect
void line_circle_intersect(Numeric &x, Numeric &z, const Numeric &xl, const Numeric &zl, const Numeric &dx, const Numeric &dz, const Numeric &xc, const Numeric &zc, const Numeric &r)
geomtanpoint2d
Definition: geodetic.cc:302
geompath_za_at_r
Numeric geompath_za_at_r(const Numeric &ppc, const Numeric &a_za, const Numeric &r)
geompath_za_at_r
Definition: ppath.cc:147
Ppath::np
Index np
Definition: ppath.h:61
VectorZtanToZaRefr1D
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.
Definition: m_ppath.cc:847
ConstVectorView::nelem
Index nelem() const
Returns the number of elements.
Definition: matpackI.cc:180
ArrayOfIndex
Array< Index > ArrayOfIndex
An array of Index.
Definition: array.h:40
los2xyz
void los2xyz(Numeric &za, Numeric &aa, const Numeric &r1, const Numeric &lat1, const Numeric &lon1, const Numeric &x1, const Numeric &y1, const Numeric &z1, const Numeric &x2, const Numeric &y2, const Numeric &z2)
los2xyz
Definition: geodetic.cc:977
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:29
lin_alg.h
Linear algebra functions.
Verbosity
Definition: messages.h:50
math_funcs.h
Ppath::lstep
Vector lstep
Definition: ppath.h:70
geodetic.h
Ppath::start_los
Vector start_los
Definition: ppath.h:65
chk_rte_pos
void chk_rte_pos(const Index &atmosphere_dim, ConstVectorView rte_pos, const bool &is_rte_pos2)
chk_rte_pos
Definition: check_input.cc:1961
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_air_agenda, const String &rtrace_method, const Numeric &lraytrace)
ppath_step_refr_2d
Definition: ppath.cc:4121
m_xml.h
Workspace methods and template functions for supergeneric XML IO.
ppathWriteXMLPartial
void ppathWriteXMLPartial(const String &file_format, const Ppath &ppath, const String &f, const Index &file_index, const Verbosity &verbosity)
WORKSPACE METHOD: ppathWriteXMLPartial.
Definition: m_ppath.cc:954
max
#define max(a, b)
Definition: continua.cc:20461
Ppath::nreal
Vector nreal
Definition: ppath.h:74
Range
The range class.
Definition: matpackI.h:148
ppath_copy
void ppath_copy(Ppath &ppath1, const Ppath &ppath2, const Index &ncopy)
ppath_copy
Definition: ppath.cc:1876
GridPos
Structure to store a grid position.
Definition: interpolation.h:74
ppathCalc
void ppathCalc(Workspace &ws, Ppath &ppath, const Agenda &ppath_agenda, const Numeric &ppath_lraytrace, const Index &atmgeom_checked, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_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 Verbosity &)
WORKSPACE METHOD: ppathCalc.
Definition: m_ppath.cc:69
ppath.h
Propagation path structure and functions.
refraction.h
Refraction functions.
pol2cart
void pol2cart(Numeric &x, Numeric &z, const Numeric &r, const Numeric &lat)
pol2cart
Definition: geodetic.cc:356
min
#define min(a, b)
Definition: continua.cc:20460
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)
ppath_step_geom_3d
Definition: ppath.cc:3553
Workspace
Workspace class.
Definition: workspace_ng.h:47
Ppath::r
Vector r
Definition: ppath.h:69
special_interp.h
Header file for special_interp.cc.
get_refr_index_3d
void get_refr_index_3d(Workspace &ws, Numeric &refr_index_air, Numeric &refr_index_air_group, const Agenda &refr_index_air_agenda, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstVectorView refellipsoid, ConstTensor3View z_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView f_grid, const Numeric &r, const Numeric &lat, const Numeric &lon)
Definition: refraction.cc:315
RAD2DEG
const Numeric RAD2DEG
poslos2cart
void poslos2cart(Numeric &x, Numeric &z, Numeric &dx, Numeric &dz, const Numeric &r, const Numeric &lat, const Numeric &za)
poslos2cart
Definition: geodetic.cc:387
WriteXML
void WriteXML(Workspace &ws, const String &file_format, const Agenda &v, const String &f, const Index &no_clobber, const String &v_name, const String &f_name, const String &no_clobber_name, const Verbosity &verbosity)
Definition: m_xml.cc:67
rte_pos2gridpos
void rte_pos2gridpos(GridPos &gp_p, GridPos &gp_lat, GridPos &gp_lon, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView rte_pos)
rte_pos2gridpos
Definition: special_interp.cc:688
ppath_set_background
void ppath_set_background(Ppath &ppath, const Index &case_nr)
ppath_set_background
Definition: ppath.cc:1790
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:35
chk_if_in_range
void chk_if_in_range(const String &x_name, const Index &x, const Index &x_low, const Index &x_high)
chk_if_in_range
Definition: check_input.cc:101
check_input.h
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 &)
WORKSPACE METHOD: rte_losGeometricFromRtePosToRtePos2.
Definition: m_ppath.cc:667
ppath_what_background
Index ppath_what_background(const Ppath &ppath)
ppath_what_background
Definition: ppath.cc:1835
Vector
The Vector class.
Definition: matpackI.h:556
distance3D
void distance3D(Numeric &l, const Numeric &r1, const Numeric &lat1, const Numeric &lon1, const Numeric &r2, const Numeric &lat2, const Numeric &lon2)
distance3D
Definition: geodetic.cc:658
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 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const Vector &f_grid, const Vector &refellipsoid, const Matrix &z_surface, const Vector &rte_pos, const Vector &rte_pos2, const Numeric &za_accuracy, const Numeric &pplrt_factor, const Numeric &pplrt_lowest, const Verbosity &verbosity)
WORKSPACE METHOD: ppathFromRtePos2.
Definition: m_ppath.cc:104
Ppath::pos
Matrix pos
Definition: ppath.h:67
distance2D
void distance2D(Numeric &l, const Numeric &r1, const Numeric &lat1, const Numeric &r2, const Numeric &lat2)
distance2D
Definition: geodetic.cc:201
CREATE_OUTS
#define CREATE_OUTS
Definition: messages.h:216
arts.h
The global header file for ARTS.
ll
#define ll
Definition: continua.cc:21705
xml_io.h
This file contains basic functions to handle XML data files.
m_general.h
Template functions for general supergeneric ws methods.