ARTS  1.0.222
atm_funcs.cc
Go to the documentation of this file.
1 /* Copyright (C) 2000, 2001 Patrick Eriksson <patrick@rss.chalmers.se>
2  Stefan Buehler <sbuehler@uni-bremen.de>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License as published by the
6  Free Software Foundation; either version 2, or (at your option) any
7  later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17  USA. */
18 
19 
20 
21 
23 // File description
25 
37 // External declarations
40 
41 #include <math.h>
42 #include <stdexcept>
43 #include "arts.h"
44 #include "matpackI.h"
45 #include "messages.h"
46 #include "math_funcs.h"
47 #include "make_vector.h"
48 
49 extern const Numeric DEG2RAD;
50 extern const Numeric RAD2DEG;
51 extern const Numeric PLANCK_CONST;
52 extern const Numeric SPEED_OF_LIGHT;
53 extern const Numeric BOLTZMAN_CONST;
54 
55 
56 
58 // Physical functions
60 
62 //
75 void planck (
76  MatrixView B,
78  ConstVectorView t )
79 {
80  // Double must be used here (if not, a becomes 0 when using float)
81  static const double a = 2.0*PLANCK_CONST/(SPEED_OF_LIGHT*SPEED_OF_LIGHT);
82  static const double b = PLANCK_CONST/BOLTZMAN_CONST;
83 
84  const Index n_f = f.nelem();
85  const Index n_t = t.nelem();
86  Index i_f, i_t;
87  Numeric c, d;
88 
89  assert( n_f==B.nrows() );
90  assert( n_t==B.ncols() );
91 
92  for ( i_f=0; i_f<n_f; i_f++ )
93  {
94  c = a * f[i_f]*f[i_f]*f[i_f];
95  d = b * f[i_f];
96  for ( i_t=0; i_t<n_t; i_t++ )
97  B(i_f,i_t) = c / (exp(d/t[i_t]) - 1.0);
98  }
99 }
100 
101 
102 
104 //
114 void planck (
115  VectorView B,
116  ConstVectorView f,
117  Numeric t )
118 {
119  // Double must be used here (if not, a becomes 0 when using float)
120  static const double a = 2.0*PLANCK_CONST/(SPEED_OF_LIGHT*SPEED_OF_LIGHT);
121  static const double b = PLANCK_CONST/BOLTZMAN_CONST;
122  const double c = b/t;
123 
124  assert( B.nelem()==f.nelem() );
125 
126  for ( Index i=0; i<f.nelem(); i++ )
127  {
128  B[i] = a * f[i]*f[i]*f[i] / ( exp( f[i]*c ) - 1.0 );
129  }
130 }
131 
132 
133 
135 //
145 void invplanck (
146  VectorView y,
147  ConstVectorView f,
148  ConstVectorView za )
149 {
150  const Index nf = f.nelem();
151  const Index nza = za.nelem();
152  const Index ny = y.nelem();
153  Index i0;
154 
155  // Use always double to avoid numerical problem (see invrayjean)
156  const double a = PLANCK_CONST/BOLTZMAN_CONST;
157  const double b = 2*PLANCK_CONST/(SPEED_OF_LIGHT*SPEED_OF_LIGHT);
158  double c,d;
159 
160  // Check input
161  if ( max(y) > 1e-4 )
162  throw runtime_error("The spectrum cannot be in expected intensity unit "
163  "(impossible value detected).");
164  //
165  if ( nf*nza != ny )
166  {
167  ostringstream os;
168  os << "The length of *y* does not match *f_mono* and *za_pencil*.\n"
169  << "y.nelem(): " << y.nelem() << "\n"
170  << "Should be f_mono.nelem()*za_pencil.nelem(): "
171  << f.nelem() * za.nelem() << "\n"
172  << "f_mono.nelem(): " << f.nelem() << "\n"
173  << "za_pencil.nelem(): " << za.nelem();
174  throw runtime_error(os.str());
175  }
176 
177  for ( Index i=0; i<nf; i++ )
178  {
179  c = a*f[i];
180  d = b*f[i]*f[i]*f[i];
181  for ( Index j=0; j<nza; j++ )
182  {
183  i0 = j*nf + i;
184  y[i0] = c / ( log(d/y[i0]+1) );
185  }
186  }
187 }
188 
189 
190 
192 //
203  VectorView y,
204  ConstVectorView f,
205  ConstVectorView za )
206 {
207  const Index nf = f.nelem();
208  const Index nza = za.nelem();
209  const Index ny = y.nelem();
210  Index i0;
211 
212  // The function returned NaNs when a and b were set to be Numeric (PE 010404)
213  // Integrated this calculation into the for-loop to avoid numerical overflow
214  // (OLE)
215  //const double a = SPEED_OF_LIGHT*SPEED_OF_LIGHT/(2*BOLTZMAN_CONST);
216  double b;
217 
218 
219  // Commenting out the check of the input. This check is not any
220  // longer true when the weighting functions are converted to
221  // brightness temperature units. This occurs, e.g., when the line
222  // intensity weighting functions are converted to temperature
223  // units.
224 
225  // Check input
226  //if ( max(y) > 1e-4 )
227  // throw runtime_error("The spectrum is not in expected intensity unit "
228  // "(impossible value detected).");
229  //
230  if ( nf*nza != ny )
231  {
232  ostringstream os;
233  os << "The length of *y* does not match *f_mono* and *za_pencil*.\n"
234  << "y.nelem(): " << y.nelem() << "\n"
235  << "Should be f_mono.nelem()*za_pencil.nelem(): "
236  << f.nelem() * za.nelem() << "\n"
237  << "f_mono.nelem(): " << f.nelem() << "\n"
238  << "za_pencil.nelem(): " << za.nelem();
239  throw runtime_error(os.str());
240  }
241 
242  for ( Index i=0; i<nf; i++ )
243  {
244  //b = a/(f[i]*f[i]);
245  // a splitted and changed order of calculation to avoid
246  // numerical instabilities. (OLE 2002-08-26)
247  b = SPEED_OF_LIGHT / ((double)f[i] * (double)f[i])
248  * SPEED_OF_LIGHT / (2 * BOLTZMAN_CONST);
249  for ( Index j=0; j<nza; j++ )
250  {
251  i0 = j*nf + i;
252  y[i0] = b * (double)y[i0];
253  }
254  }
255 }
256 
257 
258 
260 //
271  Numeric p,
272  Numeric t )
273 {
274  assert( 0!=t );
275  return p/t/BOLTZMAN_CONST;
276 }
277 
278 
279 
281 //
292  ConstVectorView p,
293  ConstVectorView t )
294 {
295  assert( p.nelem()==t.nelem() );
296 
297  // Calculate p / (t*BOLTZMAN_CONST):
298 
299  Vector dummy(p); // Matpack can initialize a
300  // new Vector from another
301  // Vector.
302  dummy /= t; // Element-vise divide by t.
303  dummy /= BOLTZMAN_CONST; // Divide all elements by BOLTZMAN_CONST.
304 
305  return dummy;
306 }
307 
308 
309 
311 //
323  Numeric r_geoid,
324  Numeric g0,
325  Numeric z )
326 {
327  return g0 * pow( r_geoid/(r_geoid+z), 2 );
328 }
329 
331 //
341 {
342  extern const Numeric EARTH_EQUATORIAL_RADIUS;
343  extern const Numeric EARTH_POLAR_RADIUS;
344  extern const Numeric DEG2RAD;
345 
346  /* check latitude range */
347  check_if_in_range( -90, 90, latitude, "latitude" );
348 
349  /* convert from geocentric to geographic */
351  (EARTH_POLAR_RADIUS*EARTH_POLAR_RADIUS) * tan(latitude*DEG2RAD));
352 
353  /* calculate in geographic coordinates */
354  return 9.7803267714 * ( ( 1.0 + 0.0019318514 * sin(latG) * sin(latG) ) /
355  sqrt( 1.0 - 0.00669438 * sin(latG) * sin(latG) ) );
356 }
357 
358 
359 
360 
361 
363 // Core functions for RTE and BL
365 
367 //
387  VectorView y,
388  const Index start_index,
389  const Index stop_index,
390  ConstMatrixView tr,
391  ConstMatrixView s,
392  const Index n_f )
393 {
394  Index i_f; // frequency index
395  Index i_z; // LOS index
396  Index i_step; // step order, -1 or 1
397 
398  if ( start_index >= stop_index )
399  i_step = -1;
400 
401  else
402  i_step = 1;
403 
404  for ( i_z=start_index; i_z!=(stop_index+i_step); i_z+=i_step )
405  {
406  for ( i_f=0; i_f<n_f; i_f++ )
407  y[i_f] = y[i_f]*tr(i_f,i_z) + s(i_f,i_z) * ( 1.0-tr(i_f,i_z) );
408  }
409 }
410 
411 
412 
414 //
433 void rte (
434  VectorView y,
435  const Index start_index,
436  const Index stop_index,
437  ConstMatrixView tr,
438  ConstMatrixView s,
439  ConstVectorView y_space,
440  const Index ground,
441  ConstVectorView e_ground,
442  ConstVectorView y_ground )
443 {
444  const Index n_f = tr.nrows(); // number of frequencies
445  Index i_f; // frequency index
446  Index i_break; // break index for looping
447  Index i_start; // variable for second loop
448 
449  // Init Y with Y_SPACE
450  y = y_space; // Matpack can copy the contents of
451  // vectors like this. The dimensions
452  // must be the same!
453 
454  // Check if LOS inside the atmosphere (if START_Index=0 -> Y=Y_SPACE)
455  if ( start_index > 0 )
456  {
457  // Determine break index for looping, either 1 or the ground
458  if ( ground > 0 )
459  i_break = ground-1;
460  else
461  i_break = 0;
462 
463  // Make first loop
464  rte_iterate( y, start_index-1, i_break, tr, s, n_f );
465 
466  // We are now at the sensor, the ground or the tangent point
467  // We are ready only if we are at the sensor.
468  // If at sensor, we have that STOP_Index=0 and GROUND=0
469  if ( !(stop_index==0 && ground==0) )
470  {
471  // Set most common values for I_START and I_BREAK
472  i_start = 0;
473  i_break = stop_index - 1;
474 
475  // If at the ground, include ground reflection.
476  // The loop can continue both downwards or upwards
477  if ( ground > 0 )
478  {
479  for ( i_f=0; i_f<n_f; i_f++ )
480  y[i_f] = y[i_f]*(1.0-e_ground[i_f]) + y_ground[i_f]*e_ground[i_f];
481 
482  if ( ground > 1 ) // 2D case, loop downwards
483  {
484  i_start = ground - 2;
485  i_break = 0;
486  }
487  }
488 
489  // Make second loop
490  rte_iterate( y, i_start, i_break, tr, s, n_f );
491 
492  } // second part
493  } // if any values
494 }
495 
496 
497 
499 //
519  VectorView y,
520  const Index start_index,
521  const Index stop_index,
522  ConstMatrixView tr,
523  const Index n_f )
524 {
525  Index i_f; // frequency index
526  Index i_z; // LOS index
527  Index i_step; // step order, -1 or 1
528 
529  if ( start_index >= stop_index )
530  i_step = -1;
531  else
532  i_step = 1;
533 
534  for ( i_z=start_index; i_z!=(stop_index+i_step); i_z+=i_step )
535  {
536  for ( i_f=0; i_f<n_f; i_f++ )
537  y[i_f] *= tr(i_f,i_z);
538  }
539 }
540 
541 
542 
544 //
560 void bl (
561  Vector& y,
562  const Index start_index,
563  const Index stop_index,
564  ConstMatrixView tr,
565  const Index ground,
566  ConstVectorView e_ground )
567 {
568  if ( start_index < stop_index )
569  throw runtime_error("The start index cannot be "
570  "smaller than the stop index." );
571 
572  const Index nf = tr.nrows(); // number of frequencies
573  Index iy; // frequency index
574 
575  // Init Y
576  y.resize( nf );
577  y = 1.0;
578 
579  // Loop steps passed twice
580  if ( stop_index > 0 )
581  {
582  bl_iterate( y, 0, stop_index-1, tr, nf );
583  y *= y; // Calculate the square of y element-vise.
584  }
585 
586  // Loop remaining steps
587  if ( start_index != stop_index )
588  bl_iterate( y, stop_index, start_index-1, tr, nf );
589 
590  // Include effect of ground reflection
591  if ( ground > 0 )
592  {
593  for ( iy=0; iy<nf; iy++ )
594  y[iy] *= ( 1.0 - e_ground[iy] );
595  }
596 }
597 
598 
599 
601 // Conversion and interpolation of pressure and altitude grids.
603 
605 //
621 void z2p(
622  VectorView p,
623  ConstVectorView z0,
624  ConstVectorView p0,
625  ConstVectorView z )
626 {
627  assert( p.nelem()==z.nelem() );
628  if ( z.nelem() > 0 )
629  {
630  // Local variable to store log pressure grid:
631  Vector logp0(p0.nelem());
632  transform( logp0, log, p0 ); // This calculates logp0 = log(p0).
633 
634  interp_lin_vector( p, z0, logp0, z );
635  transform( p, exp, p ); // This calculates p = exp(p).
636  }
637 }
638 
639 
640 
642 //
658 void interpp(
659  VectorView x,
660  ConstVectorView p0,
661  ConstVectorView x0,
662  ConstVectorView p )
663 {
664  assert( x.nelem()==p.nelem() );
665 
666  // Local variables to store log pressure grids:
667  Vector logp0(p0.nelem());
668  Vector logp(p.nelem());
669  transform( logp0, log, p0 ); // This calculates logp0 = log(p0).
670  transform( logp, log, p ); // This calculates logp = log(p).
671 
672  interp_lin_vector( x, logp0, x0, logp );
673 }
674 
676  VectorView x,
677  ConstVectorView p0,
678  ConstVectorView x0,
679  ConstVectorView p )
680 {
681  assert( x.nelem()==p.nelem() );
682 
683  interp_lin_vector( x, p0, x0, p );
684 }
685 
686 
688 //
705 void interpp(
706  MatrixView A,
707  ConstVectorView p0,
708  ConstMatrixView A0,
709  ConstVectorView p )
710 {
711  assert( A.nrows() == A0.nrows() );
712  assert( A.ncols() == p.nelem() );
713 
714  // Local variables to store log pressure grids:
715  Vector logp0(p0.nelem());
716  Vector logp(p.nelem());
717  transform( logp0, log, p0 ); // This calculates logp0 = log(p0).
718  transform( logp, log, p ); // This calculates logp0 = log(p0).
719 
720  interp_lin_matrix( A, logp0, A0, logp );
721 }
722 
723 
724 
726 //
740  ConstVectorView p0,
741  ConstVectorView x0,
742  const Numeric p )
743 {
744  // Local variable to store log pressure grid:
745  Vector logp0(p0.nelem());
746  transform( logp0, log, p0 ); // This calculates logp0 = log(p0).
747 
748  return interp_lin( logp0, x0, log(p) );
749 }
750 
751 
752 
754 //
774 void interpz(
775  VectorView x,
776  ConstVectorView p0,
777  ConstVectorView z0,
778  ConstVectorView x0,
779  ConstVectorView z )
780 {
781  assert( x.nelem()==z.nelem() );
782  Vector p(z.nelem());
783  z2p( p, z0, p0, z );
784  interpp( x, p0, x0, p );
785 }
786 
787 
788 
790 //
811  ConstVectorView p0,
812  ConstVectorView z0,
813  ConstVectorView x0,
814  const Numeric z )
815 {
816  Vector x(1);
817  MakeVector Z(z);
818  interpz( x, p0, z0, x0, Z );
819  return x[0];
820 }
821 
822 
823 
825 // Tangent altitudes.
827 
829 //
840  const Numeric za,
841  const Numeric z_plat,
842  const Numeric r_geoid )
843 {
844  Numeric z_tan;
845  if ( za >= 90 )
846  z_tan = (r_geoid+z_plat)*sin(DEG2RAD*za) - r_geoid;
847  else
848  z_tan = 999e3;
849  return z_tan;
850 }
851 
852 
853 
855 
872  const Numeric z,
873  ConstVectorView p_abs,
874  ConstVectorView z_abs,
875  ConstVectorView refr_index,
876  const Numeric atm_limit )
877 
878 {
879  if ( z > atm_limit )
880  return 1.0;
881  else
882  return interpz( p_abs, z_abs, refr_index, z );
883 }
884 
885 
887 
909  const Numeric r_geoid,
910  const Numeric za,
911  const Numeric z_plat,
912  ConstVectorView p_abs,
913  ConstVectorView z_abs,
914  const Numeric atm_limit,
915  ConstVectorView refr_index )
916 {
917  Numeric n_plat = n_for_z( z_plat, p_abs, z_abs, refr_index, atm_limit );
918 
919  return (r_geoid + z_plat) * sin(DEG2RAD*za) * n_plat;
920 }
921 
922 
923 
925 //
941  const Numeric c,
942  const Numeric za,
943  const Numeric z_plat,
944  const Numeric z_ground,
945  ConstVectorView p_abs,
946  ConstVectorView z_abs,
947  ConstVectorView refr_index,
948  const Numeric r_geoid )
949 {
950  const Numeric atm_limit = last(z_abs);
951  if ( za < 90 ) //=== Upward ==========================================
952  return ztan_geom( za, z_plat, r_geoid );
953  else
954  {
955  const Index n = z_abs.nelem();
956  Index i;
957 
958  for ( i=(n-1); (i>=0) && (r_geoid+z_abs[i])*refr_index[i]>c; i-- )
959  {
960  if ( z_abs[i] <= z_ground ) //=== Ground intersection ==============
961  {
962  Numeric n_ground = n_for_z(z_ground,p_abs,z_abs,refr_index,atm_limit);
963  Numeric theta = RAD2DEG*asin(c/n_ground/(r_geoid+z_ground));
964  return ztan_geom( 180-theta, z_ground, r_geoid );
965  }
966  }
967  if ( i == (n-1) ) //=== outside the atmosphere ======================
968  return ztan_geom( za, z_plat, r_geoid );
969  else //=== z_tan inside the atmosphere =================
970  {
971  Vector zs(2), cs(2);
972  zs[0] = z_abs[i];
973  zs[1] = z_abs[i+1];
974  cs[0] = (r_geoid+z_abs[i])*refr_index[i];
975  cs[1] = (r_geoid+z_abs[i+1])*refr_index[i+1];
976  return interp_lin( cs, zs, c );
977  }
978  }
979 }
980 
982 //
999  ConstVectorView t )
1000 {
1001  Index cur_elem;
1002  double a, b, c, d, e, t_cur;
1003 
1004  // make sure e_eq and t has the same length
1005  assert( e_eq.nelem() == t.nelem() );
1006 
1007  // Coefficients for Sontag's formula
1008  a = -6096.9385;
1009  b = 21.2409642;
1010  c = -2.711193e-2;
1011  d = 1.673952e-5;
1012  e = 2.433502;
1013 
1014  for ( cur_elem = 0; cur_elem < t.nelem(); cur_elem++ )
1015  {
1016  t_cur = t[cur_elem];
1017  e_eq[cur_elem] = exp( a / t_cur + b + c * t_cur + d * t_cur * t_cur + e * log( t_cur ) );
1018  }
1019 }
1020 
1022 //
1039  ConstVectorView t )
1040 {
1041  Index cur_elem;
1042  double a, b, c, d, e, t_cur;
1043 
1044  // make sure e_eq and t has the same length
1045  assert( e_eq.nelem() == t.nelem() );
1046 
1047  // Coefficients for Sontag's formula
1048  a = -6024.5282;
1049  b = 29.32707;
1050  c = 1.0613868e-2;
1051  d = -1.3198825e-5;
1052  e = -0.49382577;
1053 
1054  for ( cur_elem = 0; cur_elem < t.nelem(); cur_elem++ )
1055  {
1056  t_cur = t[cur_elem];
1057  e_eq[cur_elem] = exp( a / t_cur + b + c * t_cur + d * t_cur * t_cur + e * log( t_cur ) );
1058  }
1059 }
transform
void transform(VectorView y, double(&my_func)(double), ConstVectorView x)
A generic transform function for vectors, which can be used to implement mathematical functions opera...
Definition: matpackI.h:2405
MatrixView
The MatrixView class.
Definition: matpackI.h:476
PLANCK_CONST
const Numeric PLANCK_CONST
EARTH_POLAR_RADIUS
const Numeric EARTH_POLAR_RADIUS
Global constant, the polar radius of the Earth [m], from WGS84.
last
Numeric last(ConstVectorView x)
Gives the last value of a vector.
Definition: math_funcs.cc:83
DEG2RAD
const Numeric DEG2RAD
Vector::resize
void resize(Index n)
Resize function.
Definition: matpackI.h:1467
invplanck
void invplanck(VectorView y, ConstVectorView f, ConstVectorView za)
Converts a vector with radiances to Plack brightness temperatures.
Definition: atm_funcs.cc:145
interpp_cloud
void interpp_cloud(VectorView x, ConstVectorView p0, ConstVectorView x0, ConstVectorView p)
Definition: atm_funcs.cc:675
ConstMatrixView::nrows
Index nrows() const
Returns the number of rows.
Definition: matpackI.h:1491
EARTH_EQUATORIAL_RADIUS
const Numeric EARTH_EQUATORIAL_RADIUS
Global constant, the equatorial radius of the Earth [m], from WGS84.
number_density
Numeric number_density(Numeric p, Numeric t)
Calculates the number density (scalar version).
Definition: atm_funcs.cc:270
rte_iterate
void rte_iterate(VectorView y, const Index start_index, const Index stop_index, ConstMatrixView tr, ConstMatrixView s, const Index n_f)
Performs a single iteration for RTE calculations (one zenith angle).
Definition: atm_funcs.cc:386
bl
void bl(Vector &y, const Index start_index, const Index stop_index, ConstMatrixView tr, const Index ground, ConstVectorView e_ground)
Performs the BL (transmission) calculations for one zenith angle.
Definition: atm_funcs.cc:560
matpackI.h
SPEED_OF_LIGHT
const Numeric SPEED_OF_LIGHT
bl_iterate
void bl_iterate(VectorView y, const Index start_index, const Index stop_index, ConstMatrixView tr, const Index n_f)
Performs a single iteration for BL calculations (one zenith angle).
Definition: atm_funcs.cc:518
messages.h
Declarations having to do with the four output streams.
planck
void planck(MatrixView B, ConstVectorView f, ConstVectorView t)
Calculates a blackbody radiation (the Planck function) matrix.
Definition: atm_funcs.cc:75
invrayjean
void invrayjean(VectorView y, ConstVectorView f, ConstVectorView za)
Converts a vector with radiances to Rayleigh-Jean brightness temperatures.
Definition: atm_funcs.cc:202
ConstMatrixView::ncols
Index ncols() const
Returns the number of columns.
Definition: matpackI.h:1497
g_of_lat
Numeric g_of_lat(Numeric latitude)
Calculates the gravitational accelaration for a geocentric latitude.
Definition: atm_funcs.cc:340
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: arts.h:147
ConstVectorView::nelem
Index nelem() const
Returns the number of elements.
Definition: matpackI.h:937
VectorView
The VectorView class.
Definition: matpackI.h:281
interp_lin
Numeric interp_lin(ConstVectorView x, ConstVectorView y, const Numeric xi)
Single linear interpolation of a vector (return version).
Definition: math_funcs.cc:435
e_eq_water
void e_eq_water(VectorView e_eq, ConstVectorView t)
Calculates the equilibrium water vapor pressure over liquid water.
Definition: atm_funcs.cc:998
e_eq_ice
void e_eq_ice(VectorView e_eq, ConstVectorView t)
Calculates the equilibrium water vapor pressure over ice.
Definition: atm_funcs.cc:1038
math_funcs.h
Contains declerations of basic mathematical and vector/matrix functions.
interpz
void interpz(VectorView x, ConstVectorView p0, ConstVectorView z0, ConstVectorView x0, ConstVectorView z)
Interpolates a vertical profile at a new set of vertical altitudes.
Definition: atm_funcs.cc:774
make_vector.h
The class MakeVector is a special kind of Vector that can be initialized explicitly from one or more ...
max
#define max(a, b)
Definition: continua.cc:12949
ConstMatrixView
A constant view of a Matrix.
Definition: matpackI.h:426
MakeVector
Definition: make_vector.h:42
interp_lin_vector
void interp_lin_vector(VectorView yi, ConstVectorView x, ConstVectorView y, ConstVectorView xi)
Multiple linear interpolation of a vector.
Definition: math_funcs.cc:329
g_of_z
Numeric g_of_z(Numeric r_geoid, Numeric g0, Numeric z)
Calculates the gravitational accelaration for a geometrical altitude.
Definition: atm_funcs.cc:322
ztan_geom
Numeric ztan_geom(const Numeric za, const Numeric z_plat, const Numeric r_geoid)
Calculates the geometrical tangent altitude (no refraction).
Definition: atm_funcs.cc:839
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: arts.h:153
RAD2DEG
const Numeric RAD2DEG
ztan_refr
Numeric ztan_refr(const Numeric c, const Numeric za, const Numeric z_plat, const Numeric z_ground, ConstVectorView p_abs, ConstVectorView z_abs, ConstVectorView refr_index, const Numeric r_geoid)
Calculates the tangent altitude with refraction.
Definition: atm_funcs.cc:940
interpp
void interpp(VectorView x, ConstVectorView p0, ConstVectorView x0, ConstVectorView p)
Interpolates a vertical profile at a new set of pressures.
Definition: atm_funcs.cc:658
interp_lin_matrix
void interp_lin_matrix(MatrixView Yi, ConstVectorView x, ConstMatrixView Y, ConstVectorView xi)
Multiple linear interpolation of matrix rows.
Definition: math_funcs.cc:383
BOLTZMAN_CONST
const Numeric BOLTZMAN_CONST
n_for_z
Numeric n_for_z(const Numeric z, ConstVectorView p_abs, ConstVectorView z_abs, ConstVectorView refr_index, const Numeric atm_limit)
Returns the refractive index for a vertical altitude.
Definition: atm_funcs.cc:871
refr_constant
Numeric refr_constant(const Numeric r_geoid, const Numeric za, const Numeric z_plat, ConstVectorView p_abs, ConstVectorView z_abs, const Numeric atm_limit, ConstVectorView refr_index)
Determines the constant for a refractive LOS.
Definition: atm_funcs.cc:908
Vector
The Vector class.
Definition: matpackI.h:389
ConstVectorView
A constant view of a Vector.
Definition: matpackI.h:232
z2p
void z2p(VectorView p, ConstVectorView z0, ConstVectorView p0, ConstVectorView z)
Converts an altitude vector to pressures.
Definition: atm_funcs.cc:621
check_if_in_range
void check_if_in_range(const Numeric &x_low, const Numeric &x_high, const Numeric &x, const String &x_name)
Checks if a numeric variable is inside a specified range.
Definition: math_funcs.cc:495
arts.h
The global header file for ARTS.
rte
void rte(VectorView y, const Index start_index, const Index stop_index, ConstMatrixView tr, ConstMatrixView s, ConstVectorView y_space, const Index ground, ConstVectorView e_ground, ConstVectorView y_ground)
Performs the RTE calculations for one zenith angle.
Definition: atm_funcs.cc:433