ARTS  2.2.66
m_surface.cc
Go to the documentation of this file.
1 /* Copyright (C) 2012
2  Patrick Eriksson <Patrick.Eriksson@chalmers.se>
3  Stefan Buehler <sbuehler@ltu.se>
4 
5  This program is free software; you can redistribute it and/or modify it
6  under the terms of the GNU General Public License as published by the
7  Free Software Foundation; either version 2, or (at your option) any
8  later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18  USA. */
19 
20 
21 
22 /*===========================================================================
23  === File description
24  ===========================================================================*/
25 
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 "complex.h"
49 #include "geodetic.h"
50 #include "math_funcs.h"
51 #include "messages.h"
52 #include "special_interp.h"
53 #include "interpolation.h"
54 #include "physics_funcs.h"
55 #include "rte.h"
56 #include "surface.h"
57 
58 extern const Numeric DEG2RAD;
59 
60 
61 
62 
63 /*===========================================================================
64  === The functions (in alphabetical order)
65  ===========================================================================*/
66 
67 /* Workspace method: Doxygen documentation will be auto-generated */
69  Numeric& outvalue,
70  const Index& atmosphere_dim,
71  const Vector& lat_grid,
72  const Vector& lon_grid,
73  const Vector& rtp_pos,
74  const Matrix& z_surface,
75  const Matrix& field,
76  const Verbosity& verbosity)
77 {
78  // Input checks (dummy p_grid)
79  chk_atm_grids( atmosphere_dim, Vector(2,2,-1), lat_grid, lon_grid );
80  chk_atm_surface( "input argument *field*", field, atmosphere_dim, lat_grid,
81  lon_grid );
82  chk_rte_pos( atmosphere_dim, rtp_pos );
83  //
84  const Numeric zmax = max( z_surface );
85  const Numeric zmin = min( z_surface );
86  const Numeric dzok = 1;
87  if( rtp_pos[0] < zmin-dzok || rtp_pos[0] > zmax+dzok )
88  {
89  ostringstream os;
90  os << "The given position does not match *z_surface*.\nThe altitude in "
91  << "*rtp_pos* is " << rtp_pos[0]/1e3 << " km.\n"
92  << "The altitude range covered by *z_surface* is [" << zmin/1e3
93  << "," << zmax/1e3 << "] km.\n"
94  << "One possible mistake is to mix up *rtp_pos* and *rte_pos*.";
95  throw runtime_error( os.str() );
96  }
97 
98  if( atmosphere_dim == 1 )
99  { outvalue = field(0,0); }
100  else
101  {
102  chk_interpolation_grids( "Latitude interpolation", lat_grid, rtp_pos[1] );
103  GridPos gp_lat, gp_lon;
104  gridpos( gp_lat, lat_grid, rtp_pos[1] );
105  if( atmosphere_dim == 3 )
106  {
107  chk_interpolation_grids( "Longitude interpolation", lon_grid,
108  rtp_pos[2] );
109  gridpos( gp_lon, lon_grid, rtp_pos[2] );
110  }
111  //
112  outvalue = interp_atmsurface_by_gp( atmosphere_dim, field, gp_lat,
113  gp_lon );
114  }
115 
116  // Interpolate
117  CREATE_OUT3;
118  out3 << " Result = " << outvalue << "\n";
119 }
120 
121 
122 
123 /* Workspace method: Doxygen documentation will be auto-generated */
125  Workspace& ws,
126  Matrix& iy,
127  ArrayOfTensor3& diy_dx,
128  const Tensor3& iy_transmission,
129  const Index& jacobian_do,
130  const Index& atmosphere_dim,
131  const Tensor3& t_field,
132  const Tensor3& z_field,
133  const Tensor4& vmr_field,
134  const Index& cloudbox_on,
135  const Index& stokes_dim,
136  const Vector& f_grid,
137  const Vector& rtp_pos,
138  const Vector& rtp_los,
139  const Vector& rte_pos2,
140  const Agenda& iy_main_agenda,
141  const Agenda& surface_rtprop_agenda,
142  const Verbosity& )
143 {
144  // Input checks
145  chk_if_in_range( "atmosphere_dim", atmosphere_dim, 1, 3 );
146  chk_rte_pos( atmosphere_dim, rtp_pos );
147  chk_rte_los( atmosphere_dim, rtp_los );
148 
149  // Call *surface_rtprop_agenda*
150  Matrix surface_los;
151  Tensor4 surface_rmatrix;
152  Matrix surface_emission;
153  //
154  surface_rtprop_agendaExecute( ws, surface_emission, surface_los,
155  surface_rmatrix, f_grid, rtp_pos, rtp_los,
156  surface_rtprop_agenda );
157 
158  // Check output of *surface_rtprop_agenda*
159  const Index nlos = surface_los.nrows();
160  const Index nf = f_grid.nelem();
161  //
162  if( nlos ) // if 0, blackbody ground and not all checks are needed
163  {
164  if( surface_los.ncols() != rtp_los.nelem() )
165  throw runtime_error(
166  "Number of columns in *surface_los* is not correct." );
167  if( nlos != surface_rmatrix.nbooks() )
168  throw runtime_error(
169  "Mismatch in size of *surface_los* and *surface_rmatrix*." );
170  if( surface_rmatrix.npages() != nf )
171  throw runtime_error(
172  "Mismatch in size of *surface_rmatrix* and *f_grid*." );
173  if( surface_rmatrix.nrows() != stokes_dim ||
174  surface_rmatrix.ncols() != stokes_dim )
175  throw runtime_error(
176  "Mismatch between size of *surface_rmatrix* and *stokes_dim*." );
177  }
178  if( surface_emission.ncols() != stokes_dim )
179  throw runtime_error(
180  "Mismatch between size of *surface_emission* and *stokes_dim*." );
181  if( surface_emission.nrows() != nf )
182  throw runtime_error(
183  "Mismatch in size of *surface_emission* and f_grid*." );
184 
185  // Variable to hold down-welling radiation
186  Tensor3 I( nlos, nf, stokes_dim );
187 
188  // Loop *surface_los*-es. If no such LOS, we are ready.
189  if( nlos > 0 )
190  {
191  for( Index ilos=0; ilos<nlos; ilos++ )
192  {
193  Vector los = surface_los(ilos,joker);
194 
195  // Include surface reflection matrix in *iy_transmission*
196  // If iy_transmission is empty, this is interpreted as the
197  // variable is not needed.
198  //
199  Tensor3 iy_trans_new;
200  //
201  if( iy_transmission.npages() )
202  {
203  iy_transmission_mult( iy_trans_new, iy_transmission,
204  surface_rmatrix(ilos,joker,joker,joker) );
205  }
206 
207  // Calculate downwelling radiation for LOS ilos
208  //
209  {
210  ArrayOfTensor4 iy_aux;
211  Ppath ppath;
212  iy_main_agendaExecute( ws, iy, iy_aux, ppath, diy_dx, 0,
213  iy_trans_new, ArrayOfString(0),
214  cloudbox_on, jacobian_do, t_field,
215  z_field, vmr_field, f_grid, rtp_pos,
216  los, rte_pos2, iy_main_agenda );
217  }
218 
219  if( iy.ncols() != stokes_dim || iy.nrows() != nf )
220  {
221  ostringstream os;
222  os << "The size of *iy* returned from *"
223  << iy_main_agenda.name() << "* is\n"
224  << "not correct:\n"
225  << " expected size = [" << nf << "," << stokes_dim << "]\n"
226  << " size of iy = [" << iy.nrows() << "," << iy.ncols()
227  << "]\n";
228  throw runtime_error( os.str() );
229  }
230 
231  I(ilos,joker,joker) = iy;
232  }
233  }
234 
235  // Add up
236  surface_calc( iy, I, surface_los, surface_rmatrix, surface_emission );
237 }
238 
239 
240 
241 
242 /* Workspace method: Doxygen documentation will be auto-generated */
244  Vector& specular_los,
245  Vector& surface_normal,
246  const Vector& rtp_pos,
247  const Vector& rtp_los,
248  const Index& atmosphere_dim,
249  const Vector& lat_grid,
250  const Vector& lon_grid,
251  const Vector& refellipsoid,
252  const Matrix& z_surface,
253  const Verbosity&)
254 {
255  surface_normal.resize( max( Index(1), atmosphere_dim-1 ) );
256  specular_los.resize( max( Index(1), atmosphere_dim-1 ) );
257 
258  if( atmosphere_dim == 1 )
259  {
260  surface_normal[0] = 0;
261  specular_los[0] = 180 - rtp_los[0];
262  }
263 
264  else if( atmosphere_dim == 2 )
265  {
266  chk_interpolation_grids( "Latitude interpolation", lat_grid, rtp_pos[1] );
267  GridPos gp_lat;
268  gridpos( gp_lat, lat_grid, rtp_pos[1] );
269  Numeric c1; // Radial slope of the surface
270  plevel_slope_2d( c1, lat_grid, refellipsoid, z_surface(joker,0),
271  gp_lat, rtp_los[0] );
272  Vector itw(2); interpweights( itw, gp_lat );
273  const Numeric rv_surface = refell2d( refellipsoid, lat_grid, gp_lat )
274  + interp( itw, z_surface(joker,0), gp_lat );
275  surface_normal[0] = -plevel_angletilt( rv_surface, c1 );
276  specular_los[0] = sign( rtp_los[0] ) * 180 - rtp_los[0] +
277  2*surface_normal[0];
278  }
279 
280  else if( atmosphere_dim == 3 )
281  {
282  // Calculate surface normal in South-North direction
283  chk_interpolation_grids( "Latitude interpolation", lat_grid, rtp_pos[1] );
284  chk_interpolation_grids( "Longitude interpolation", lon_grid, rtp_pos[2]);
285  GridPos gp_lat, gp_lon;
286  gridpos( gp_lat, lat_grid, rtp_pos[1] );
287  gridpos( gp_lon, lon_grid, rtp_pos[2] );
288  Numeric c1, c2;
289  plevel_slope_3d( c1, c2, lat_grid, lon_grid, refellipsoid, z_surface,
290  gp_lat, gp_lon, 0 );
291  Vector itw(4); interpweights( itw, gp_lat, gp_lon );
292  const Numeric rv_surface = refell2d( refellipsoid, lat_grid, gp_lat )
293  + interp( itw, z_surface, gp_lat, gp_lon );
294  const Numeric zaSN = 90 - plevel_angletilt( rv_surface, c1 );
295  // The same for East-West
296  plevel_slope_3d( c1, c2, lat_grid, lon_grid, refellipsoid, z_surface,
297  gp_lat, gp_lon, 90 );
298  const Numeric zaEW = 90 - plevel_angletilt( rv_surface, c1 );
299  // Convert to Cartesian, and determine normal by cross-product
300  Vector tangentSN(3), tangentEW(3), normal(3);
301  zaaa2cart( tangentSN[0], tangentSN[1], tangentSN[2], zaSN, 0 );
302  zaaa2cart( tangentEW[0], tangentEW[1], tangentEW[2], zaEW, 90 );
303  cross3( normal, tangentSN, tangentEW );
304  // Convert rtp_los to cartesian and flip direction
305  Vector di(3);
306  zaaa2cart( di[0], di[1], di[2], rtp_los[0], rtp_los[1] );
307  di *= -1;
308  // Set LOS normal vector
309  cart2zaaa( surface_normal[0], surface_normal[1], normal[0], normal[1],
310  normal[2] );
311  // Specular direction is 2(dn*di)dn-di, where dn is the normal vector
312  Vector speccart(3);
313  const Numeric fac = 2 * (normal * di);
314  for( Index i=0; i<3; i++ )
315  { speccart[i] = fac*normal[i] - di[i]; }
316  cart2zaaa( specular_los[0], specular_los[1], speccart[0], speccart[1],
317  speccart[2] );
318  }
319 }
320 
321 
322 
323 /* Workspace method: Doxygen documentation will be auto-generated */
325  Workspace& ws,
326  Matrix& surface_los,
327  Tensor4& surface_rmatrix,
328  Matrix& surface_emission,
329  const Vector& f_grid,
330  const Index& stokes_dim,
331  const Numeric& surface_skin_t,
332  const Agenda& blackbody_radiation_agenda,
333  const Verbosity& verbosity)
334 {
335  chk_if_in_range( "stokes_dim", stokes_dim, 1, 4 );
336  chk_not_negative( "surface_skin_t", surface_skin_t );
337 
338  CREATE_OUT2;
339  out2 << " Sets variables to model a blackbody surface with a temperature "
340  << " of " << surface_skin_t << " K.\n";
341 
342  surface_los.resize(0,0);
343  surface_rmatrix.resize(0,0,0,0);
344 
345  Vector b;
346  blackbody_radiation_agendaExecute( ws, b, surface_skin_t, f_grid,
347  blackbody_radiation_agenda );
348 
349  const Index nf = f_grid.nelem();
350  surface_emission.resize( nf, stokes_dim );
351  surface_emission = 0.0;
352 
353  for( Index iv=0; iv<nf; iv++ )
354  {
355  surface_emission(iv,0) = b[iv];
356  for( Index is=1; is<stokes_dim; is++ )
357  { surface_emission(iv,is) = 0; }
358  }
359 }
360 
361 
362 
363 /* Workspace method: Doxygen documentation will be auto-generated */
365  Workspace& ws,
366  Matrix& surface_los,
367  Tensor4& surface_rmatrix,
368  Matrix& surface_emission,
369  const Vector& f_grid,
370  const Index& stokes_dim,
371  const Index& atmosphere_dim,
372  const Vector& rtp_los,
373  const Vector& specular_los,
374  const Numeric& surface_skin_t,
375  const GriddedField3& surface_complex_refr_index,
376  const Agenda& blackbody_radiation_agenda,
377  const Verbosity& verbosity)
378 {
379  CREATE_OUT2;
380  CREATE_OUT3;
381 
382  chk_if_in_range( "atmosphere_dim", atmosphere_dim, 1, 3 );
383  chk_if_in_range( "stokes_dim", stokes_dim, 1, 4 );
384  chk_not_negative( "surface_skin_t", surface_skin_t );
385 
386  // Interpolate *surface_complex_refr_index*
387  //
388  const Index nf = f_grid.nelem();
389  //
390  Matrix n_real(nf,1), n_imag(nf,1);
391  //
392  complex_n_interp( n_real, n_imag, surface_complex_refr_index,
393  "surface_complex_refr_index", f_grid,
394  Vector(1,surface_skin_t) );
395 
396  out2 << " Sets variables to model a flat surface\n";
397  out3 << " surface temperature: " << surface_skin_t << " K.\n";
398 
399  surface_los.resize( 1, specular_los.nelem() );
400  surface_los(0,joker) = specular_los;
401 
402  surface_emission.resize( nf, stokes_dim );
403  surface_rmatrix.resize( 1, nf, stokes_dim, stokes_dim );
404 
405  // Incidence angle
406  const Numeric incang = calc_incang( rtp_los, specular_los );
407  assert( incang <= 90 );
408 
409  // Complex (amplitude) reflection coefficients
410  Complex Rv, Rh;
411 
412  for( Index iv=0; iv<nf; iv++ )
413  {
414  // Set n2 (refractive index of surface medium)
415  Complex n2( n_real(iv,0), n_imag(iv,0) );
416 
417  // Amplitude reflection coefficients
418  fresnel( Rv, Rh, Numeric(1.0), n2, incang );
419 
420  // Fill reflection matrix and emission vector
421  surface_specular_R_and_b( ws, surface_rmatrix(0,iv,joker,joker),
422  surface_emission(iv,joker), Rv, Rh,
423  f_grid[iv], stokes_dim, surface_skin_t,
424  blackbody_radiation_agenda );
425  }
426 }
427 
428 
429 
430 /* Workspace method: Doxygen documentation will be auto-generated */
432  Workspace& ws,
433  Matrix& surface_los,
434  Tensor4& surface_rmatrix,
435  Matrix& surface_emission,
436  const Vector& f_grid,
437  const Index& stokes_dim,
438  const Index& atmosphere_dim,
439  const Vector& specular_los,
440  const Numeric& surface_skin_t,
441  const Tensor3& surface_reflectivity,
442  const Agenda& blackbody_radiation_agenda,
443  const Verbosity& verbosity)
444 {
445  CREATE_OUT2;
446 
447  chk_if_in_range( "atmosphere_dim", atmosphere_dim, 1, 3 );
448  chk_if_in_range( "stokes_dim", stokes_dim, 1, 4 );
449  chk_not_negative( "surface_skin_t", surface_skin_t );
450 
451  const Index nf = f_grid.nelem();
452 
453  if( surface_reflectivity.nrows() != stokes_dim &&
454  surface_reflectivity.ncols() != stokes_dim )
455  {
456  ostringstream os;
457  os << "The number of rows and columnss in *surface_reflectivity* must\n"
458  << "match *stokes_dim*."
459  << "\n stokes_dim : " << stokes_dim
460  << "\n number of rows in *surface_reflectivity* : "
461  << surface_reflectivity.nrows()
462  << "\n number of columns in *surface_reflectivity* : "
463  << surface_reflectivity.ncols()
464  << "\n";
465  throw runtime_error( os.str() );
466  }
467 
468  if( surface_reflectivity.npages() != nf &&
469  surface_reflectivity.npages() != 1 )
470  {
471  ostringstream os;
472  os << "The number of pages in *surface_reflectivity* should\n"
473  << "match length of *f_grid* or be 1."
474  << "\n length of *f_grid* : " << nf
475  << "\n dimension of *surface_reflectivity* : "
476  << surface_reflectivity.npages()
477  << "\n";
478  throw runtime_error( os.str() );
479  }
480 
481  out2 << " Sets variables to model a flat surface\n";
482 
483  surface_los.resize( 1, specular_los.nelem() );
484  surface_los(0,joker) = specular_los;
485 
486  surface_emission.resize( nf, stokes_dim );
487  surface_rmatrix.resize(1,nf,stokes_dim,stokes_dim);
488 
489  Matrix R, IR(stokes_dim,stokes_dim);
490 
491  Vector b;
492  blackbody_radiation_agendaExecute( ws, b, surface_skin_t, f_grid,
493  blackbody_radiation_agenda );
494  Vector B(stokes_dim,0);
495 
496  for( Index iv=0; iv<nf; iv++ )
497  {
498  if( iv == 0 || surface_reflectivity.npages() > 1 )
499  {
500  R = surface_reflectivity(iv,joker,joker);
501  for( Index i=0; i<stokes_dim; i++ )
502  {
503  for( Index j=0; j<stokes_dim; j++ )
504  {
505  if( i== j )
506  { IR(i,j) = 1 - R(i,j); }
507  else
508  { IR(i,j) = -R(i,j); }
509  }
510  }
511  }
512 
513  surface_rmatrix(0,iv,joker,joker) = R;
514 
515  B[0] = b[iv];
516  mult( surface_emission(iv,joker), IR, B );
517  }
518 }
519 
520 
521 
522 /* Workspace method: Doxygen documentation will be auto-generated */
524  Workspace& ws,
525  Matrix& surface_los,
526  Tensor4& surface_rmatrix,
527  Matrix& surface_emission,
528  const Vector& f_grid,
529  const Index& stokes_dim,
530  const Index& atmosphere_dim,
531  const Vector& specular_los,
532  const Numeric& surface_skin_t,
533  const Vector& surface_scalar_reflectivity,
534  const Agenda& blackbody_radiation_agenda,
535  const Verbosity& verbosity)
536 {
537  CREATE_OUT2;
538  CREATE_OUT3;
539 
540  chk_if_in_range( "atmosphere_dim", atmosphere_dim, 1, 3 );
541  chk_if_in_range( "stokes_dim", stokes_dim, 1, 1 );
542  chk_not_negative( "surface_skin_t", surface_skin_t );
543 
544  const Index nf = f_grid.nelem();
545 
546  if( surface_scalar_reflectivity.nelem() != nf &&
547  surface_scalar_reflectivity.nelem() != 1 )
548  {
549  ostringstream os;
550  os << "The number of elements in *surface_scalar_reflectivity* should\n"
551  << "match length of *f_grid* or be 1."
552  << "\n length of *f_grid* : " << nf
553  << "\n length of *surface_scalar_reflectivity* : "
554  << surface_scalar_reflectivity.nelem()
555  << "\n";
556  throw runtime_error( os.str() );
557  }
558 
559  if( min(surface_scalar_reflectivity) < 0 ||
560  max(surface_scalar_reflectivity) > 1 )
561  {
562  throw runtime_error(
563  "All values in *surface_scalar_reflectivity* must be inside [0,1]." );
564  }
565 
566  out2 << " Sets variables to model a flat surface\n";
567  out3 << " surface temperature: " << surface_skin_t << " K.\n";
568 
569  surface_los.resize( 1, specular_los.nelem() );
570  surface_los(0,joker) = specular_los;
571 
572  surface_emission.resize( nf, stokes_dim );
573  surface_rmatrix.resize( 1, nf, stokes_dim, stokes_dim );
574 
575  Vector b;
576  blackbody_radiation_agendaExecute( ws, b, surface_skin_t, f_grid,
577  blackbody_radiation_agenda );
578 
579  Numeric r = 0.0;
580 
581  for( Index iv=0; iv<nf; iv++ )
582  {
583  if( iv == 0 || surface_scalar_reflectivity.nelem() > 1 )
584  { r = surface_scalar_reflectivity[iv]; }
585 
586  surface_emission(iv,0) = (1.0-r) * b[iv];
587  surface_rmatrix(0,iv,0,0) = r;
588  }
589 }
590 
591 
592 
593 /* Workspace method: Doxygen documentation will be auto-generated */
595  Workspace& ws,
596  Matrix& surface_los,
597  Tensor4& surface_rmatrix,
598  Matrix& surface_emission,
599  const Vector& f_grid,
600  const Index& stokes_dim,
601  const Index& atmosphere_dim,
602  const Vector& rtp_los,
603  const Numeric& surface_skin_t,
604  const Vector& surface_scalar_reflectivity,
605  const Index& lambertian_nza,
606  const Agenda& blackbody_radiation_agenda,
607  const Numeric& za_pos,
608  const Verbosity&)
609 {
610  const Index nf = f_grid.nelem();
611 
612  chk_if_in_range( "atmosphere_dim", atmosphere_dim, 1, 1 );
613  chk_if_in_range( "stokes_dim", stokes_dim, 1, 4 );
614  chk_not_negative( "surface_skin_t", surface_skin_t );
615  chk_if_in_range( "za_pos", za_pos, 0, 1 );
616 
617  if( surface_scalar_reflectivity.nelem() != nf &&
618  surface_scalar_reflectivity.nelem() != 1 )
619  {
620  ostringstream os;
621  os << "The number of elements in *surface_scalar_reflectivity* should\n"
622  << "match length of *f_grid* or be 1."
623  << "\n length of *f_grid* : " << nf
624  << "\n length of *surface_scalar_reflectivity* : "
625  << surface_scalar_reflectivity.nelem()
626  << "\n";
627  throw runtime_error( os.str() );
628  }
629 
630  if( min(surface_scalar_reflectivity) < 0 ||
631  max(surface_scalar_reflectivity) > 1 )
632  {
633  throw runtime_error(
634  "All values in *surface_scalar_reflectivity* must be inside [0,1]." );
635  }
636 
637  // Allocate and init everything to zero
638  //
639  surface_los.resize( lambertian_nza, rtp_los.nelem() );
640  surface_rmatrix.resize( lambertian_nza, nf, stokes_dim, stokes_dim );
641  surface_emission.resize( nf, stokes_dim );
642  //
643  surface_los = 0.0;
644  surface_rmatrix = 0.0;
645  surface_emission = 0.0;
646 
647  // Help variables
648  //
649  const Numeric dza = 90.0 / (Numeric)lambertian_nza;
650  const Vector za_lims( 0.0, lambertian_nza+1, dza );
651 
652  // surface_los
653  for( Index ip=0; ip<lambertian_nza; ip++ )
654  { surface_los(ip,0) = za_lims[ip] + za_pos * dza; }
655 
656  Vector b;
657  blackbody_radiation_agendaExecute( ws, b, surface_skin_t, f_grid,
658  blackbody_radiation_agenda );
659 
660  // Loop frequencies and set remaining values
661  //
662  Numeric r = 0.0;
663  //
664  for( Index iv=0; iv<nf; iv++ )
665  {
666  // Get reflectivity
667  if( iv == 0 || surface_scalar_reflectivity.nelem() > 1 )
668  { r = surface_scalar_reflectivity[iv]; }
669 
670  // surface_rmatrix:
671  // Only element (0,0) is set to be non-zero. This follows VDISORT
672  // that refers to: K. L. Coulson, Polarization and Intensity of Light in
673  // the Atmosphere (1989), page 229
674  // (Thanks to Michael Kahnert for providing this information!)
675  // Update: Is the above for a later edition? We have not found a copy of
676  // that edition. In a 1988 version of the book, the relevant page seems
677  // to be 232.
678  for( Index ip=0; ip<lambertian_nza; ip++ )
679  {
680  const Numeric w = r * 0.5 * ( cos(2*DEG2RAD*za_lims[ip]) -
681  cos(2*DEG2RAD*za_lims[ip+1]) );
682  surface_rmatrix(ip,iv,0,0) = w;
683  }
684 
685  // surface_emission
686  surface_emission(iv,0) = (1-r) * b[iv];
687  }
688 }
689 
690 
691 
692 /* Workspace method: Doxygen documentation will be auto-generated */
694  GriddedField3& surface_complex_refr_index,
695  const Index& atmosphere_dim,
696  const Vector& lat_grid,
697  const Vector& lat_true,
698  const Vector& lon_true,
699  const Vector& rtp_pos,
700  const GriddedField5& complex_n_field,
701  const Verbosity&)
702 {
703  // Set expected order of grids
704  Index gfield_fID = 0;
705  Index gfield_tID = 1;
706  Index gfield_compID = 2;
707  Index gfield_latID = 3;
708  Index gfield_lonID = 4;
709 
710  // Basic checks and sizes
711  chk_if_in_range( "atmosphere_dim", atmosphere_dim, 1, 3 );
712  chk_latlon_true( atmosphere_dim, lat_grid, lat_true, lon_true );
713  chk_rte_pos( atmosphere_dim, rtp_pos );
714  complex_n_field.checksize_strict();
715  //
716  chk_griddedfield_gridname( complex_n_field, gfield_fID, "Frequency" );
717  chk_griddedfield_gridname( complex_n_field, gfield_tID, "Temperature" );
718  chk_griddedfield_gridname( complex_n_field, gfield_compID, "Complex" );
719  chk_griddedfield_gridname( complex_n_field, gfield_latID, "Latitude" );
720  chk_griddedfield_gridname( complex_n_field, gfield_lonID, "Longitude" );
721  //
722  const Index nf = complex_n_field.data.nshelves();
723  const Index nt = complex_n_field.data.nbooks();
724  const Index nn = complex_n_field.data.npages();
725  const Index nlat = complex_n_field.data.nrows();
726  const Index nlon = complex_n_field.data.ncols();
727  //
728  if( nlat < 2 || nlon < 2 )
729  {
730  ostringstream os;
731  os << "The data in *complex_refr_index_field* must span a geographical "
732  << "region. That is,\nthe latitude and longitude grids must have a "
733  << "length >= 2.";
734  }
735  //
736  if( nn != 2 )
737  {
738  ostringstream os;
739  os << "The data in *complex_refr_index_field* must have exactly two "
740  << "pages. One page each\nfor the real and imaginary part of the "
741  << "complex refractive index.";
742  }
743 
744  const Vector& GFlat = complex_n_field.get_numeric_grid(gfield_latID);
745  const Vector& GFlon = complex_n_field.get_numeric_grid(gfield_lonID);
746 
747  // Determine true geographical position
748  Vector lat(1), lon(1);
749  pos2true_latlon( lat[0], lon[0], atmosphere_dim, lat_grid, lat_true,
750  lon_true, rtp_pos );
751 
752  // Ensure correct coverage of lon grid
753  Vector lon_shifted;
754  lon_shiftgrid( lon_shifted, GFlon, lon[0] );
755 
756  // Check if lat/lon we need are actually covered
757  chk_if_in_range( "rtp_pos.lat", lat[0], GFlat[0], GFlat[nlat-1] );
758  chk_if_in_range( "rtp_pos.lon", lon[0], lon_shifted[0],
759  lon_shifted[nlon-1] );
760 
761  // Size and fills grids of *surface_complex_refr_index*
762  surface_complex_refr_index.resize( nf, nt, 2 );
763  surface_complex_refr_index.set_grid_name( 0, "Frequency" );
764  surface_complex_refr_index.set_grid( 0,
765  complex_n_field.get_numeric_grid(gfield_fID));
766  surface_complex_refr_index.set_grid_name( 1, "Temperature" );
767  surface_complex_refr_index.set_grid( 1,
768  complex_n_field.get_numeric_grid(gfield_tID));
769  surface_complex_refr_index.set_grid_name( 2, "Complex" );
770  surface_complex_refr_index.set_grid( 2,
771  MakeArray<String>("real", "imaginary"));
772 
773  // Interpolate in lat and lon
774  //
775  GridPos gp_lat, gp_lon;
776  gridpos( gp_lat, GFlat, lat[0] );
777  gridpos( gp_lon, lon_shifted, lon[0] );
778  Vector itw(4);
779  interpweights( itw, gp_lat, gp_lon );
780  //
781  for( Index iv=0; iv<nf; iv++ )
782  {
783  for( Index it=0; it<nt; it++ )
784  {
785  surface_complex_refr_index.data(iv,it,0) = interp( itw,
786  complex_n_field.data(iv,it,0,joker,joker), gp_lat, gp_lon );
787  surface_complex_refr_index.data(iv,it,1) = interp( itw,
788  complex_n_field.data(iv,it,1,joker,joker), gp_lat, gp_lon );
789  }
790  }
791 }
792 
793 
794 
795 /* Workspace method: Doxygen documentation will be auto-generated */
797  Tensor3& surface_reflectivity,
798  const Index& stokes_dim,
799  const Vector& f_grid,
800  const Index& atmosphere_dim,
801  const Vector& lat_grid,
802  const Vector& lat_true,
803  const Vector& lon_true,
804  const Vector& rtp_pos,
805  const Vector& rtp_los,
806  const GriddedField6& r_field,
807  const Verbosity&)
808 {
809  // Basic checks and sizes
810  chk_if_in_range( "atmosphere_dim", atmosphere_dim, 1, 3 );
811  chk_if_in_range( "stokes_dim", stokes_dim, 1, 4 );
812  chk_latlon_true( atmosphere_dim, lat_grid, lat_true, lon_true );
813  chk_rte_pos( atmosphere_dim, rtp_pos );
814  chk_rte_los( atmosphere_dim, rtp_los );
815  r_field.checksize_strict();
816  chk_griddedfield_gridname( r_field, 0, "Frequency" );
817  chk_griddedfield_gridname( r_field, 1, "Stokes element" );
818  chk_griddedfield_gridname( r_field, 2, "Stokes element" );
819  chk_griddedfield_gridname( r_field, 3, "Incidence angle" );
820  chk_griddedfield_gridname( r_field, 4, "Latitude" );
821  chk_griddedfield_gridname( r_field, 5, "Longitude" );
822  //
823  const Index nf_in = r_field.data.nvitrines();
824  const Index ns2 = r_field.data.nshelves();
825  const Index ns1 = r_field.data.nbooks();
826  const Index nza = r_field.data.npages();
827  const Index nlat = r_field.data.nrows();
828  const Index nlon = r_field.data.ncols();
829  //
830  if( nlat < 2 || nlon < 2 )
831  {
832  ostringstream os;
833  os << "The data in *r_field* must span a geographical region. That is,\n"
834  << "the latitude and longitude grids must have a length >= 2.";
835  throw runtime_error( os.str() );
836  }
837  //
838  if( nza < 2 )
839  {
840  ostringstream os;
841  os << "The data in *r_field* must span a range of zenith angles. That\n"
842  << "is the zenith angle grid must have a length >= 2.";
843  throw runtime_error( os.str() );
844 
845  }
846  if( ns1 < stokes_dim || ns2 < stokes_dim || ns1 > 4 || ns2 > 4 )
847  {
848  ostringstream os;
849  os << "The \"Stokes dimensions\" must have a size that is >= "
850  << "*stokes_dim* (but not exceeding 4).";
851  throw runtime_error( os.str() );
852  }
853 
854  // Determine true geographical position
855  Vector lat(1), lon(1);
856  pos2true_latlon( lat[0], lon[0], atmosphere_dim, lat_grid, lat_true,
857  lon_true, rtp_pos );
858 
859  // Ensure correct coverage of lon grid
860  Vector lon_shifted;
861  lon_shiftgrid( lon_shifted, r_field.get_numeric_grid(5), lon[0] );
862 
863  // Interpolate in lat and lon
864  Tensor4 r_f_za( nf_in, stokes_dim, stokes_dim, nza );
865  {
866  chk_interpolation_grids( "Latitude interpolation",
867  r_field.get_numeric_grid(4), lat[0] );
868  chk_interpolation_grids( "Longitude interpolation",
869  lon_shifted, lon[0] );
870  GridPos gp_lat, gp_lon;
871  gridpos( gp_lat, r_field.get_numeric_grid(4), lat[0] );
872  gridpos( gp_lon, lon_shifted, lon[0] );
873  Vector itw(4);
874  interpweights( itw, gp_lat, gp_lon );
875  for( Index iv=0; iv<nf_in; iv++ )
876  { for( Index iz=0; iz<nza; iz++ )
877  { for( Index is1=0; is1<stokes_dim; is1++ )
878  { for( Index is2=0; is2<stokes_dim; is2++ )
879  {
880  r_f_za(iv,is1,is2,iz) = interp( itw,
881  r_field.data(iv,is1,is2,iz,joker,joker), gp_lat, gp_lon );
882  } } } } }
883 
884  // Interpolate in incidence angle, cubic if possible
885  Tensor3 r_f( nf_in, stokes_dim, stokes_dim );
886  Index order = 3;
887  if( nza < 4 )
888  { order = 1; }
889  {
890  Vector incang( 1, 180-rtp_los[0] );
891  chk_interpolation_grids( "Incidence angle interpolation",
892  r_field.get_numeric_grid(3), incang );
893  ArrayOfGridPosPoly gp(1);
894  Matrix itw(1,order+1);
895  Vector tmp(1);
896  gridpos_poly( gp, r_field.get_numeric_grid(3), incang, order );
897  interpweights( itw, gp );
898  //
899  for( Index i=0; i<nf_in; i++ )
900  { for( Index is1=0; is1<stokes_dim; is1++ )
901  { for( Index is2=0; is2<stokes_dim; is2++ )
902  {
903  interp( tmp, itw, r_f_za(i,is1,is2,joker), gp );
904  r_f(i,is1,is2) = tmp[0];
905  } } } }
906 
907  // Extract or interpolate in frequency
908  //
909  if( nf_in == 1 )
910  { surface_reflectivity = r_f; }
911  else
912  {
913  chk_interpolation_grids( "Frequency interpolation",
914  r_field.get_numeric_grid(0), f_grid );
915  const Index nf_out = f_grid.nelem();
916  surface_reflectivity.resize( nf_out, stokes_dim, stokes_dim );
917  //
918  ArrayOfGridPos gp( nf_out );
919  Matrix itw( nf_out, 2 );
920  gridpos( gp, r_field.get_numeric_grid(0), f_grid );
921  interpweights( itw, gp );
922  for( Index is1=0; is1<stokes_dim; is1++ )
923  { for( Index is2=0; is2<stokes_dim; is2++ )
924  {
925  interp( surface_reflectivity(joker,is1,is2), itw,
926  r_f(joker,is1,is2), gp );
927  } } }
928 }
929 
930 
931 
932 /* Workspace method: Doxygen documentation will be auto-generated */
934  Vector& surface_scalar_reflectivity,
935  const Index& stokes_dim,
936  const Vector& f_grid,
937  const Index& atmosphere_dim,
938  const Vector& lat_grid,
939  const Vector& lat_true,
940  const Vector& lon_true,
941  const Vector& rtp_pos,
942  const Vector& rtp_los,
943  const GriddedField4& r_field,
944  const Verbosity&)
945 {
946  // Basic checks and sizes
947  chk_if_in_range( "atmosphere_dim", atmosphere_dim, 1, 3 );
948  chk_if_in_range( "stokes_dim", stokes_dim, 1, 1 );
949  chk_latlon_true( atmosphere_dim, lat_grid, lat_true, lon_true );
950  chk_rte_pos( atmosphere_dim, rtp_pos );
951  chk_rte_los( atmosphere_dim, rtp_los );
952  r_field.checksize_strict();
953  chk_griddedfield_gridname( r_field, 0, "Frequency" );
954  chk_griddedfield_gridname( r_field, 1, "Incidence angle" );
955  chk_griddedfield_gridname( r_field, 2, "Latitude" );
956  chk_griddedfield_gridname( r_field, 3, "Longitude" );
957  //
958  const Index nf_in = r_field.data.nbooks();
959  const Index nza = r_field.data.npages();
960  const Index nlat = r_field.data.nrows();
961  const Index nlon = r_field.data.ncols();
962  //
963  if( nlat < 2 || nlon < 2 )
964  {
965  ostringstream os;
966  os << "The data in *r_field* must span a geographical region. That is,\n"
967  << "the latitude and longitude grids must have a length >= 2.";
968  throw runtime_error( os.str() );
969 
970  }
971  //
972  if( nza < 2 )
973  {
974  ostringstream os;
975  os << "The data in *r_field* must span a range of zenith angles. That\n"
976  << "is the zenith angle grid must have a length >= 2.";
977  throw runtime_error( os.str() );
978  }
979 
980  // Determine true geographical position
981  Vector lat(1), lon(1);
982  pos2true_latlon( lat[0], lon[0], atmosphere_dim, lat_grid, lat_true,
983  lon_true, rtp_pos );
984 
985  // Ensure correct coverage of lon grid
986  Vector lon_shifted;
987  lon_shiftgrid( lon_shifted, r_field.get_numeric_grid(3), lon[0] );
988 
989  // Interpolate in lat and lon
990  Matrix r_f_za( nf_in, nza );
991  {
992  chk_interpolation_grids( "Latitude interpolation",
993  r_field.get_numeric_grid(2), lat[0] );
994  chk_interpolation_grids( "Longitude interpolation",
995  lon_shifted, lon[0] );
996  GridPos gp_lat, gp_lon;
997  gridpos( gp_lat, r_field.get_numeric_grid(2), lat[0] );
998  gridpos( gp_lon, lon_shifted, lon[0] );
999  Vector itw(4);
1000  interpweights( itw, gp_lat, gp_lon );
1001  for( Index iv=0; iv<nf_in; iv++ )
1002  {
1003  for( Index iz=0; iz<nza; iz++ )
1004  {
1005  r_f_za(iv,iz) = interp( itw, r_field.data(iv,iz,joker,joker),
1006  gp_lat, gp_lon );
1007  }
1008  }
1009 
1010  }
1011 
1012  // Interpolate in incidence angle, cubic if possible
1013  Vector r_f( nf_in );
1014  Index order = 3;
1015  if( nza < 4 )
1016  { order = 1; }
1017  {
1018  Vector incang( 1, 180-rtp_los[0] );
1019  chk_interpolation_grids( "Incidence angle interpolation",
1020  r_field.get_numeric_grid(1), incang );
1021  ArrayOfGridPosPoly gp(1);
1022  Matrix itw(1,order+1);
1023  Vector tmp(1);
1024  gridpos_poly( gp, r_field.get_numeric_grid(1), incang, order );
1025  interpweights( itw, gp );
1026  //
1027  for( Index i=0; i<nf_in; i++ )
1028  {
1029  interp( tmp, itw, r_f_za(i,joker), gp );
1030  r_f[i] = tmp[0];
1031  }
1032  }
1033 
1034  // Extract or interpolate in frequency
1035  //
1036  if( nf_in == 1 )
1037  {
1038  surface_scalar_reflectivity.resize( 1 );
1039  surface_scalar_reflectivity[0] = r_f[0];
1040  }
1041  else
1042  {
1043  chk_interpolation_grids( "Frequency interpolation",
1044  r_field.get_numeric_grid(0), f_grid );
1045  const Index nf_out = f_grid.nelem();
1046  surface_scalar_reflectivity.resize( nf_out );
1047  //
1048  ArrayOfGridPos gp( nf_out );
1049  Matrix itw( nf_out, 2 );
1050  gridpos( gp, r_field.get_numeric_grid(0), f_grid );
1051  interpweights( itw, gp );
1052  interp( surface_scalar_reflectivity, itw, r_f, gp );
1053  }
1054 }
1055 
Matrix
The Matrix class.
Definition: matpackI.h:788
interp_atmsurface_by_gp
void interp_atmsurface_by_gp(VectorView x, const Index &atmosphere_dim, ConstMatrixView x_surface, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
interp_atmsurface_by_gp
Definition: special_interp.cc:481
GriddedField::set_grid_name
void set_grid_name(Index i, const String &s)
Set grid name.
Definition: gridded_fields.h:166
Tensor4::resize
void resize(Index b, Index p, Index r, Index c)
Resize function.
Definition: matpackIV.cc:1403
ConstTensor6View::nshelves
Index nshelves() const
Returns the number of shelves.
Definition: matpackVI.cc:38
ConstTensor5View::nbooks
Index nbooks() const
Returns the number of books.
Definition: matpackV.cc:41
fac
Numeric fac(const Index n)
fac
Definition: math_funcs.cc:68
GriddedField4::checksize_strict
virtual void checksize_strict() const
Strict consistency check.
Definition: gridded_fields.h:394
auto_md.h
plevel_angletilt
Numeric plevel_angletilt(const Numeric &r, const Numeric &c1)
plevel_angletilt
Definition: ppath.cc:844
chk_atm_surface
void chk_atm_surface(const String &x_name, const Matrix &x, const Index &dim, ConstVectorView lat_grid, ConstVectorView lon_grid)
chk_atm_surface
Definition: check_input.cc:1862
complex_n_interp
void complex_n_interp(MatrixView n_real, MatrixView n_imag, const GriddedField3 &complex_n, const String &varname, ConstVectorView f_grid, ConstVectorView t_grid)
complex_n_interp
Definition: special_interp.cc:880
gridpos
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
Definition: interpolation.cc:167
calc_incang
Numeric calc_incang(ConstVectorView rte_los, ConstVectorView specular_los)
calc_incang
Definition: surface.cc:72
Tensor3
The Tensor3 class.
Definition: matpackIII.h:348
surface.h
sign
Numeric sign(const Numeric &x)
sign
Definition: math_funcs.cc:473
ConstTensor5View::ncols
Index ncols() const
Returns the number of columns.
Definition: matpackV.cc:59
ConstTensor6View::npages
Index npages() const
Returns the number of pages.
Definition: matpackVI.cc:50
GriddedField6
Definition: gridded_fields.h:505
surface_specular_R_and_b
void surface_specular_R_and_b(Workspace &ws, MatrixView surface_rmatrix, VectorView surface_emission, const Complex &Rv, const Complex &Rh, const Numeric &f, const Index &stokes_dim, const Numeric &surface_skin_t, const Agenda &blackbody_radiation_agenda)
surface_specular_R_and_b
Definition: surface.cc:106
joker
const Joker joker
interpolation.h
Header file for interpolation.cc.
refell2d
Numeric refell2d(ConstVectorView refellipsoid, ConstVectorView lat_grid, const GridPos gp)
refell2d
Definition: geodetic.cc:1244
interp
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
Definition: interpolation.cc:1046
chk_interpolation_grids
void chk_interpolation_grids(const String &which_interpolation, ConstVectorView old_grid, ConstVectorView new_grid, const Index order, const Numeric &extpolfac, const bool islog)
Check interpolation grids.
Definition: check_input.cc:1094
ConstTensor6View::nrows
Index nrows() const
Returns the number of rows.
Definition: matpackVI.cc:56
Vector::resize
void resize(Index n)
Resize function.
Definition: matpackI.cc:798
surface_rtprop_agendaExecute
void surface_rtprop_agendaExecute(Workspace &ws, Matrix &surface_emission, Matrix &surface_los, Tensor4 &surface_rmatrix, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
Definition: auto_md.cc:15046
ConstMatrixView::nrows
Index nrows() const
Returns the number of rows.
Definition: matpackI.cc:832
CREATE_OUT2
#define CREATE_OUT2
Definition: messages.h:213
chk_rte_los
void chk_rte_los(const Index &atmosphere_dim, ConstVectorView rte_los)
chk_rte_los
Definition: check_input.cc:2047
surfaceBlackbody
void surfaceBlackbody(Workspace &ws, Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Vector &f_grid, const Index &stokes_dim, const Numeric &surface_skin_t, const Agenda &blackbody_radiation_agenda, const Verbosity &verbosity)
WORKSPACE METHOD: surfaceBlackbody.
Definition: m_surface.cc:324
GriddedField::get_numeric_grid
ConstVectorView get_numeric_grid(Index i) const
Get a numeric grid.
Definition: gridded_fields.cc:93
GriddedField5::data
Tensor5 data
Definition: gridded_fields.h:501
Complex
std::complex< Numeric > Complex
Definition: complex.h:32
Tensor4
The Tensor4 class.
Definition: matpackIV.h:383
Ppath
The structure to describe a propagation path and releated quantities.
Definition: ppath.h:59
Tensor3::resize
void resize(Index p, Index r, Index c)
Resize function.
Definition: matpackIII.cc:862
Agenda
The Agenda class.
Definition: agenda_class.h:44
ConstTensor5View::npages
Index npages() const
Returns the number of pages.
Definition: matpackV.cc:47
GriddedField3
Definition: gridded_fields.h:307
ConstTensor3View::npages
Index npages() const
Returns the number of pages.
Definition: matpackIII.h:143
cross3
void cross3(VectorView c, const ConstVectorView &a, const ConstVectorView &b)
cross3
Definition: matpackI.cc:1743
complex.h
A class implementing complex numbers for ARTS.
w
cmplx FADDEEVA() w(cmplx z, double relerr)
Definition: Faddeeva.cc:679
Array
This can be used to make arrays out of anything.
Definition: array.h:107
chk_not_negative
void chk_not_negative(const String &x_name, const Numeric &x)
chk_not_negative
Definition: check_input.cc:166
GriddedField3::data
Tensor3 data
Definition: gridded_fields.h:370
GriddedField6::checksize_strict
virtual void checksize_strict() const
Strict consistency check.
Definition: gridded_fields.h:529
InterpSurfaceFieldToPosition
void InterpSurfaceFieldToPosition(Numeric &outvalue, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Vector &rtp_pos, const Matrix &z_surface, const Matrix &field, const Verbosity &verbosity)
WORKSPACE METHOD: InterpSurfaceFieldToPosition.
Definition: m_surface.cc:68
surface_complex_refr_indexFromGriddedField5
void surface_complex_refr_indexFromGriddedField5(GriddedField3 &surface_complex_refr_index, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lat_true, const Vector &lon_true, const Vector &rtp_pos, const GriddedField5 &complex_n_field, const Verbosity &)
WORKSPACE METHOD: surface_complex_refr_indexFromGriddedField5.
Definition: m_surface.cc:693
ConstTensor6View::nvitrines
Index nvitrines() const
Returns the number of vitrines.
Definition: matpackVI.cc:32
mult
void mult(VectorView y, const ConstMatrixView &M, const ConstVectorView &x)
Matrix Vector multiplication.
Definition: matpackI.cc:1648
CREATE_OUT3
#define CREATE_OUT3
Definition: messages.h:214
messages.h
Declarations having to do with the four output streams.
chk_griddedfield_gridname
void chk_griddedfield_gridname(const GriddedField &gf, const Index gridindex, const String &gridname)
Check name of grid in GriddedField.
Definition: check_input.cc:2096
ConstMatrixView::ncols
Index ncols() const
Returns the number of columns.
Definition: matpackI.cc:838
surfaceLambertianSimple
void surfaceLambertianSimple(Workspace &ws, Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Vector &f_grid, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &rtp_los, const Numeric &surface_skin_t, const Vector &surface_scalar_reflectivity, const Index &lambertian_nza, const Agenda &blackbody_radiation_agenda, const Numeric &za_pos, const Verbosity &)
WORKSPACE METHOD: surfaceLambertianSimple.
Definition: m_surface.cc:594
ArrayOfString
Array< String > ArrayOfString
An array of Strings.
Definition: mystring.h:321
ConstVectorView::nelem
Index nelem() const
Returns the number of elements.
Definition: matpackI.cc:180
GriddedField5::checksize_strict
virtual void checksize_strict() const
Strict consistency check.
Definition: gridded_fields.h:460
Agenda::name
String name() const
Agenda name.
Definition: agenda_class.cc:612
physics_funcs.h
chk_latlon_true
void chk_latlon_true(const Index &atmosphere_dim, ConstVectorView lat_grid, ConstVectorView lat_true, ConstVectorView lon_true)
chk_latlon_true
Definition: check_input.cc:1819
surface_reflectivityFromGriddedField6
void surface_reflectivityFromGriddedField6(Tensor3 &surface_reflectivity, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lat_true, const Vector &lon_true, const Vector &rtp_pos, const Vector &rtp_los, const GriddedField6 &r_field, const Verbosity &)
WORKSPACE METHOD: surface_reflectivityFromGriddedField6.
Definition: m_surface.cc:796
ConstTensor4View::ncols
Index ncols() const
Returns the number of columns.
Definition: matpackIV.cc:81
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:29
Verbosity
Definition: messages.h:50
surface_scalar_reflectivityFromGriddedField4
void surface_scalar_reflectivityFromGriddedField4(Vector &surface_scalar_reflectivity, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lat_true, const Vector &lon_true, const Vector &rtp_pos, const Vector &rtp_los, const GriddedField4 &r_field, const Verbosity &)
WORKSPACE METHOD: surface_scalar_reflectivityFromGriddedField4.
Definition: m_surface.cc:933
ConstTensor4View::npages
Index npages() const
Returns the number of pages.
Definition: matpackIV.cc:69
GriddedField4
Definition: gridded_fields.h:374
ConstTensor4View::nbooks
Index nbooks() const
Returns the number of books.
Definition: matpackIV.cc:63
math_funcs.h
lon_shiftgrid
void lon_shiftgrid(Vector &longrid_out, ConstVectorView longrid_in, const Numeric lon)
lon_shiftgrid
Definition: geodetic.cc:1358
geodetic.h
zaaa2cart
void zaaa2cart(Numeric &dx, Numeric &dy, Numeric &dz, const Numeric &za, const Numeric &aa)
zaaa2cart
Definition: ppath.cc:484
GriddedField3::resize
void resize(const GriddedField3 &gf)
Make this GriddedField3 the same size as the given one.
Definition: gridded_fields.h:354
Matrix::resize
void resize(Index r, Index c)
Resize function.
Definition: matpackI.cc:1580
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
ConstTensor3View::nrows
Index nrows() const
Returns the number of rows.
Definition: matpackIII.h:146
max
#define max(a, b)
Definition: continua.cc:20461
pos2true_latlon
void pos2true_latlon(Numeric &lat, Numeric &lon, const Index &atmosphere_dim, ConstVectorView lat_grid, ConstVectorView lat_true, ConstVectorView lon_true, ConstVectorView pos)
pos2true_latlon
Definition: rte.cc:2438
ConstTensor6View::nbooks
Index nbooks() const
Returns the number of books.
Definition: matpackVI.cc:44
ConstTensor4View::nrows
Index nrows() const
Returns the number of rows.
Definition: matpackIV.cc:75
GriddedField6::data
Tensor6 data
Definition: gridded_fields.h:571
iy_main_agendaExecute
void iy_main_agendaExecute(Workspace &ws, Matrix &iy, ArrayOfTensor4 &iy_aux, Ppath &ppath, ArrayOfTensor3 &diy_dx, const Index iy_agenda_call1, const Tensor3 &iy_transmission, const ArrayOfString &iy_aux_vars, const Index cloudbox_on, const Index jacobian_do, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const Vector &f_grid, const Vector &rte_pos, const Vector &rte_los, const Vector &rte_pos2, const Agenda &input_agenda)
Definition: auto_md.cc:13776
GridPos
Structure to store a grid position.
Definition: interpolation.h:74
DEG2RAD
const Numeric DEG2RAD
GriddedField::set_grid
void set_grid(Index i, const Vector &g)
Set a numeric grid.
Definition: gridded_fields.cc:225
ConstTensor5View::nrows
Index nrows() const
Returns the number of rows.
Definition: matpackV.cc:53
plevel_slope_3d
void plevel_slope_3d(Numeric &c1, Numeric &c2, const Numeric &lat1, const Numeric &lat3, const Numeric &lon5, const Numeric &lon6, const Numeric &r15, const Numeric &r35, const Numeric &r36, const Numeric &r16, const Numeric &lat, const Numeric &lon, const Numeric &aa)
plevel_slope_3d
Definition: ppath.cc:1354
ConstTensor5View::nshelves
Index nshelves() const
Returns the number of shelves.
Definition: matpackV.cc:35
ConstTensor3View::ncols
Index ncols() const
Returns the number of columns.
Definition: matpackIII.h:149
iy_transmission_mult
void iy_transmission_mult(Tensor3 &iy_trans_total, ConstTensor3View iy_trans_old, ConstTensor3View iy_trans_new)
iy_transmission_mult
Definition: rte.cc:2309
chk_atm_grids
void chk_atm_grids(const Index &dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid)
chk_atm_grids
Definition: check_input.cc:1305
iySurfaceRtpropAgenda
void iySurfaceRtpropAgenda(Workspace &ws, Matrix &iy, ArrayOfTensor3 &diy_dx, const Tensor3 &iy_transmission, const Index &jacobian_do, const Index &atmosphere_dim, const Tensor3 &t_field, const Tensor3 &z_field, const Tensor4 &vmr_field, const Index &cloudbox_on, const Index &stokes_dim, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Vector &rte_pos2, const Agenda &iy_main_agenda, const Agenda &surface_rtprop_agenda, const Verbosity &)
WORKSPACE METHOD: iySurfaceRtpropAgenda.
Definition: m_surface.cc:124
surface_calc
void surface_calc(Matrix &iy, ConstTensor3View I, ConstMatrixView surface_los, ConstTensor4View surface_rmatrix, ConstMatrixView surface_emission)
surface_calc
Definition: rte.cc:2496
min
#define min(a, b)
Definition: continua.cc:20460
rte.h
Declaration of functions in rte.cc.
surfaceFlatRefractiveIndex
void surfaceFlatRefractiveIndex(Workspace &ws, Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Vector &f_grid, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &rtp_los, const Vector &specular_los, const Numeric &surface_skin_t, const GriddedField3 &surface_complex_refr_index, const Agenda &blackbody_radiation_agenda, const Verbosity &verbosity)
WORKSPACE METHOD: surfaceFlatRefractiveIndex.
Definition: m_surface.cc:364
cart2zaaa
void cart2zaaa(Numeric &za, Numeric &aa, const Numeric &dx, const Numeric &dy, const Numeric &dz)
cart2zaaa
Definition: ppath.cc:443
Workspace
Workspace class.
Definition: workspace_ng.h:47
special_interp.h
Header file for special_interp.cc.
fresnel
void fresnel(Complex &Rv, Complex &Rh, const Complex &n1, const Complex &n2, const Numeric &theta)
fresnel
Definition: physics_funcs.cc:148
MakeArray
Explicit construction of Arrays.
Definition: make_array.h:52
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:35
surfaceFlatReflectivity
void surfaceFlatReflectivity(Workspace &ws, Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Vector &f_grid, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &specular_los, const Numeric &surface_skin_t, const Tensor3 &surface_reflectivity, const Agenda &blackbody_radiation_agenda, const Verbosity &verbosity)
WORKSPACE METHOD: surfaceFlatReflectivity.
Definition: m_surface.cc:431
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
gridpos_poly
void gridpos_poly(ArrayOfGridPosPoly &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Index order, const Numeric &extpolfac)
Set up grid positions for higher order interpolation.
Definition: interpolation_poly.cc:127
GriddedField4::data
Tensor4 data
Definition: gridded_fields.h:434
Vector
The Vector class.
Definition: matpackI.h:556
blackbody_radiation_agendaExecute
void blackbody_radiation_agendaExecute(Workspace &ws, Vector &blackbody_radiation, const Numeric rtp_temperature, const Vector &f_grid, const Agenda &input_agenda)
Definition: auto_md.cc:13205
GriddedField5
Definition: gridded_fields.h:438
surfaceFlatScalarReflectivity
void surfaceFlatScalarReflectivity(Workspace &ws, Matrix &surface_los, Tensor4 &surface_rmatrix, Matrix &surface_emission, const Vector &f_grid, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &specular_los, const Numeric &surface_skin_t, const Vector &surface_scalar_reflectivity, const Agenda &blackbody_radiation_agenda, const Verbosity &verbosity)
WORKSPACE METHOD: surfaceFlatScalarReflectivity.
Definition: m_surface.cc:523
plevel_slope_2d
void plevel_slope_2d(Numeric &c1, ConstVectorView lat_grid, ConstVectorView refellipsoid, ConstVectorView z_surf, const GridPos &gp, const Numeric &za)
plevel_slope_2d
Definition: ppath.cc:782
ConstTensor6View::ncols
Index ncols() const
Returns the number of columns.
Definition: matpackVI.cc:62
specular_losCalc
void specular_losCalc(Vector &specular_los, Vector &surface_normal, const Vector &rtp_pos, const Vector &rtp_los, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Vector &refellipsoid, const Matrix &z_surface, const Verbosity &)
WORKSPACE METHOD: specular_losCalc.
Definition: m_surface.cc:243
interpweights
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
Definition: interpolation.cc:802
arts.h
The global header file for ARTS.