ARTS  2.0.49
special_interp.cc
Go to the documentation of this file.
1 /* Copyright (C) 2002-2008 Stefan Buehler <sbuehler@ltu.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 
61 #include <cmath>
62 #include <iostream>
63 #include <stdexcept>
64 #include "auto_md.h"
65 #include "check_input.h"
66 #include "math_funcs.h"
67 #include "messages.h"
68 #include "special_interp.h"
69 
70 
71 
72 
73 /*===========================================================================
74  === Interpolation functions for atmospheric grids and fields
75  ===========================================================================*/
76 
78 
100  Matrix& itw,
101  const Index& atmosphere_dim,
102  const ArrayOfGridPos& gp_p,
103  const ArrayOfGridPos& gp_lat,
104  const ArrayOfGridPos& gp_lon )
105 {
106  const Index n = gp_p.nelem();
107 
108  if( atmosphere_dim == 1 )
109  {
110  itw.resize(n,2);
111  interpweights( itw, gp_p );
112  }
113 
114  else if( atmosphere_dim == 2 )
115  {
116  assert( gp_lat.nelem() == n );
117  itw.resize(n,4);
118  interpweights( itw, gp_p, gp_lat );
119  }
120 
121  else if( atmosphere_dim == 3 )
122  {
123  assert( gp_lat.nelem() == n );
124  assert( gp_lon.nelem() == n );
125  itw.resize(n,8);
126  interpweights( itw, gp_p, gp_lat, gp_lon );
127  }
128 }
129 
130 
131 
133 
160  VectorView x,
161  const Index& atmosphere_dim,
162  ConstTensor3View x_field,
163  const ArrayOfGridPos& gp_p,
164  const ArrayOfGridPos& gp_lat,
165  const ArrayOfGridPos& gp_lon,
166  ConstMatrixView itw )
167 {
168  assert( x.nelem() == gp_p.nelem() );
169 
170  if( atmosphere_dim == 1 )
171  {
172  assert( itw.ncols() == 2 );
173  interp( x, itw, x_field(Range(joker),0,0), gp_p );
174  }
175 
176  else if( atmosphere_dim == 2 )
177  {
178  assert( itw.ncols() == 4 );
179  interp( x, itw, x_field(Range(joker),Range(joker),0), gp_p, gp_lat );
180  }
181 
182  else if( atmosphere_dim == 3 )
183  {
184  assert( itw.ncols() == 8 );
185  interp( x, itw, x_field, gp_p, gp_lat, gp_lon );
186  }
187 }
188 
189 
190 
192 
216  VectorView x,
217  const Index& atmosphere_dim,
218  ConstTensor3View x_field,
219  const ArrayOfGridPos& gp_p,
220  const ArrayOfGridPos& gp_lat,
221  const ArrayOfGridPos& gp_lon )
222 {
223  Matrix itw;
224 
225  interp_atmfield_gp2itw( itw, atmosphere_dim, gp_p, gp_lat, gp_lon );
226 
227  interp_atmfield_by_itw( x, atmosphere_dim, x_field, gp_p, gp_lat, gp_lon,
228  itw );
229 }
230 
231 
232 
234 
241  const Index& atmosphere_dim,
242  ConstTensor3View x_field,
243  const GridPos& gp_p,
244  const GridPos& gp_lat,
245  const GridPos& gp_lon )
246 {
247  ArrayOfGridPos agp_p(1), agp_lat(0), agp_lon(0);
248 
249  gridpos_copy( agp_p[0], gp_p );
250 
251  if( atmosphere_dim > 1 )
252  {
253  agp_lat.resize(1);
254  gridpos_copy( agp_lat[0], gp_lat );
255  }
256 
257  if( atmosphere_dim > 2 )
258  {
259  agp_lon.resize(1);
260  gridpos_copy( agp_lon[0], gp_lon );
261  }
262 
263  Vector x(1);
264 
265  interp_atmfield_by_gp( x, atmosphere_dim, x_field, agp_p, agp_lat, agp_lon );
266 
267  return x[0];
268 }
269 
270 
271 
273 
301  Matrix& itw,
302  ArrayOfGridPos& gp_p_out,
303  ArrayOfGridPos& gp_lat_out,
304  ArrayOfGridPos& gp_lon_out,
305  const ArrayOfGridPos& gp_p_in,
306  const ArrayOfGridPos& gp_lat_in,
307  const ArrayOfGridPos& gp_lon_in,
308  const Index& atmosphere_dim,
309  const ArrayOfIndex& cloudbox_limits )
310 {
311  const Index n = gp_p_in.nelem();
312 
313  // Shift grid positions to cloud box grids
314  if( atmosphere_dim == 1 )
315  {
316  gp_p_out.resize(n);
317  for (Index i = 0; i < n; i++ )
318  {
319  gridpos_copy( gp_p_out[i], gp_p_in[i] );
320  gp_p_out[i].idx -= cloudbox_limits[0];
321  }
322  const Index n1 = cloudbox_limits[1] - cloudbox_limits[0];
323  gridpos_upperend_check( gp_p_out, n1 );
324  //
325  itw.resize(n,2);
326  interpweights( itw, gp_p_out );
327  }
328  else if( atmosphere_dim == 2 )
329  {
330  gp_p_out.resize(n);
331  gp_lat_out.resize(n);
332  for (Index i = 0; i < n; i++ )
333  {
334  gridpos_copy( gp_p_out[i], gp_p_in[i] );
335  gridpos_copy( gp_lat_out[i], gp_lat_in[i] );
336  gp_p_out[i].idx -= cloudbox_limits[0];
337  gp_lat_out[i].idx -= cloudbox_limits[2];
338  }
339  const Index n1 = cloudbox_limits[1] - cloudbox_limits[0];
340  const Index n2 = cloudbox_limits[3] - cloudbox_limits[2];
341  gridpos_upperend_check( gp_p_out, n1 );
342  gridpos_upperend_check( gp_lat_out, n2 );
343  //
344  itw.resize(n,4);
345  interpweights( itw, gp_p_out, gp_lat_out );
346  }
347  else
348  {
349  gp_p_out.resize(n);
350  gp_lat_out.resize(n);
351  gp_lon_out.resize(n);
352  for (Index i = 0; i < n; i++ )
353  {
354  gridpos_copy( gp_p_out[i], gp_p_in[i] );
355  gridpos_copy( gp_lat_out[i], gp_lat_in[i] );
356  gridpos_copy( gp_lon_out[i], gp_lon_in[i] );
357  gp_p_out[i].idx -= cloudbox_limits[0];
358  gp_lat_out[i].idx -= cloudbox_limits[2];
359  gp_lon_out[i].idx -= cloudbox_limits[4];
360  }
361  const Index n1 = cloudbox_limits[1] - cloudbox_limits[0];
362  const Index n2 = cloudbox_limits[3] - cloudbox_limits[2];
363  const Index n3 = cloudbox_limits[5] - cloudbox_limits[4];
364  gridpos_upperend_check( gp_p_out, n1 );
365  gridpos_upperend_check( gp_lat_out, n2 );
366  gridpos_upperend_check( gp_lon_out, n3 );
367  //
368  itw.resize(n,8);
369  interpweights( itw, gp_p_out, gp_lat_out, gp_lon_out );
370  }
371 }
372 
373 
374 
376 
397  Matrix& itw,
398  const Index& atmosphere_dim,
399  const ArrayOfGridPos& gp_lat,
400  const ArrayOfGridPos& gp_lon )
401 {
402  if( atmosphere_dim == 1 )
403  {
404  itw.resize(1,1);
405  itw = 1;
406  }
407 
408  else if( atmosphere_dim == 2 )
409  {
410  const Index n = gp_lat.nelem();
411  itw.resize(n,2);
412  interpweights( itw, gp_lat );
413  }
414 
415  else if( atmosphere_dim == 3 )
416  {
417  const Index n = gp_lat.nelem();
418  assert( n == gp_lon.nelem() );
419  itw.resize(n,4);
420  interpweights( itw, gp_lat, gp_lon );
421  }
422 }
423 
424 
425 
427 
453  VectorView x,
454  const Index& atmosphere_dim,
455  ConstMatrixView x_surface,
456  const ArrayOfGridPos& gp_lat,
457  const ArrayOfGridPos& gp_lon,
458  ConstMatrixView itw )
459 {
460  if( atmosphere_dim == 1 )
461  {
462  assert( itw.ncols() == 1 );
463  x = x_surface(0,0);
464  }
465 
466  else if( atmosphere_dim == 2 )
467  {
468  assert( x.nelem() == gp_lat.nelem() );
469  assert( itw.ncols() == 2 );
470  interp( x, itw, x_surface(Range(joker),0), gp_lat );
471  }
472 
473  else if( atmosphere_dim == 3 )
474  {
475  assert( x.nelem() == gp_lat.nelem() );
476  assert( itw.ncols() == 4 );
477  interp( x, itw, x_surface, gp_lat, gp_lon );
478  }
479 }
480 
481 
482 
484 
507  VectorView x,
508  const Index& atmosphere_dim,
509  ConstMatrixView x_surface,
510  const ArrayOfGridPos& gp_lat,
511  const ArrayOfGridPos& gp_lon )
512 {
513  Matrix itw;
514 
515  interp_atmsurface_gp2itw( itw, atmosphere_dim, gp_lat, gp_lon );
516 
517  interp_atmsurface_by_itw( x, atmosphere_dim, x_surface, gp_lat, gp_lon, itw );
518 }
519 
520 
521 
523 
530  const Index& atmosphere_dim,
531  ConstMatrixView x_surface,
532  const GridPos& gp_lat,
533  const GridPos& gp_lon )
534 {
535  ArrayOfGridPos agp_lat(0), agp_lon(0);
536 
537  if( atmosphere_dim > 1 )
538  {
539  agp_lat.resize(1);
540  gridpos_copy( agp_lat[0], gp_lat );
541  }
542 
543  if( atmosphere_dim > 2 )
544  {
545  agp_lon.resize(1);
546  gridpos_copy( agp_lon[0], gp_lon );
547  }
548 
549  Vector x(1);
550 
551  interp_atmsurface_by_gp( x, atmosphere_dim, x_surface, agp_lat, agp_lon );
552 
553  return x[0];
554 }
555 
556 
557 
559 
582  Numeric& value,
583  const GriddedField3& gfield3,
584  const Index& effective_dim,
585  const Numeric& x,
586  const Numeric& y,
587  const Numeric& z,
588  const String& dim0,
589  const String& dim1,
590  const String& dim2 )
591 {
592  chk_if_in_range( "effective_dim", effective_dim, 1, 3 );
593 
594  ArrayOfGridPos gp0(1), gp1(1), gp2(1);
595 
596  // Check and grid position, dimension 0
597  //
598  {
599  const String gridname = gfield3.get_grid_name(0);
600  const ConstVectorView grid = gfield3.get_numeric_grid(0);
601  //
602  if( dim0 != gridname )
603  {
604  ostringstream os;
605  os << "Wrong quantity found for grid of first dimension:\n"
606  << " expected quantity : " << dim0 << "\n"
607  << " quantity in gfield : " << gridname << "\n";
608  throw runtime_error( os.str() );
609  }
610  //
611  chk_if_increasing( "first grid of gfield3", grid );
612  //
613  if( x < grid[0] || x > last(grid) )
614  {
615  ostringstream os;
616  os << "Interpolation outside covered range for first dimension:\n"
617  << " interpolation point : " << x << "\n"
618  << " gfield grid range : [" << grid[0] << "," << last(grid)
619  << "]\n";
620  throw runtime_error( os.str() );
621  }
622  //
623  gridpos( gp0, grid, Vector(1,x) );
624  }
625 
626  // Check and grid position, dimension 2
627  //
628  if( effective_dim >= 2 )
629  {
630  const String gridname = gfield3.get_grid_name(1);
631  const ConstVectorView grid = gfield3.get_numeric_grid(1);
632  //
633  if( dim1 != gridname )
634  {
635  ostringstream os;
636  os << "Wrong quantity found for grid of second dimension:\n"
637  << " expected quantity : " << dim1 << "\n"
638  << " quantity in gfield : " << gridname << "\n";
639  throw runtime_error( os.str() );
640  }
641  //
642  chk_if_increasing( "second grid of gfield3", grid );
643  //
644  if( y < grid[0] || y > last(grid) )
645  {
646  ostringstream os;
647  os << "Interpolation outside covered range for second dimension:\n"
648  << " interpolation point : " << y << "\n"
649  << " gfield grid range : [" << grid[0] << "," << last(grid)
650  << "]\n";
651  throw runtime_error( os.str() );
652  }
653  //
654  gridpos( gp1, grid, Vector(1,y) );
655  }
656 
657  // Check and grid position, dimension 2
658  //
659  if( effective_dim >= 3 )
660  {
661  const String gridname = gfield3.get_grid_name(2);
662  const ConstVectorView grid = gfield3.get_numeric_grid(2);
663  //
664  if( dim2 != gridname )
665  {
666  ostringstream os;
667  os << "Wrong quantity found for grid of third dimension:\n"
668  << " expected quantity : " << dim2 << "\n"
669  << " quantity in gfield : " << gridname << "\n";
670  throw runtime_error( os.str() );
671  }
672  //
673  chk_if_increasing( "third grid of gfield3", grid );
674  //
675  if( z < grid[0] || z > last(grid) )
676  {
677  ostringstream os;
678  os << "Interpolation outside covered range for second dimension:\n"
679  << " interpolation point : " << z << "\n"
680  << " gfield grid range : [" << grid[0] << "," << last(grid)
681  << "]\n";
682  throw runtime_error( os.str() );
683  }
684  //
685  gridpos( gp2, grid, Vector(1,z) );
686  }
687 
688  // Perform interpolation
689  //
690  Vector result( 1 );
691  //
692  if( effective_dim == 1 )
693  {
694  if( gfield3.data.nrows() > 1 || gfield3.data.ncols() > 1 )
695  {
696  ostringstream os;
697  os << "A 1D interpolation requested, but the provided gridded field "
698  << "has an effective dimension of 2D or 3D.";
699  throw runtime_error( os.str() );
700  }
701 
702  Matrix itw(1,2);
703  interpweights( itw, gp0 );
704  interp( result, itw, gfield3.data(joker,0,0), gp0 );
705  }
706  //
707  else if( effective_dim == 2 )
708  {
709  if( gfield3.data.ncols() > 1 )
710  {
711  ostringstream os;
712  os << "A 2D interpolation requested, but the provided gridded field "
713  << "has an effective dimension of 3D.";
714  throw runtime_error( os.str() );
715  }
716 
717  Matrix itw(1,4);
718  interpweights( itw, gp0, gp1 );
719  interp( result, itw, gfield3.data(joker,joker,0), gp0, gp1 );
720  }
721  //
722  else if( effective_dim == 3 )
723  {
724  Matrix itw(1,8);
725  interpweights( itw, gp0, gp1, gp2 );
726  interp( result, itw, gfield3.data, gp0, gp1, gp2 );
727  }
728 
729  value = result[0];
730 }
731 
732 
733 
734 
735 
736 
737 /*===========================================================================
738  === Conversion altitudes / pressure
739  ===========================================================================*/
740 
742 
763 void itw2p(
764  VectorView p_values,
765  ConstVectorView p_grid,
766  const ArrayOfGridPos& gp,
767  ConstMatrixView itw )
768 {
769  assert( itw.ncols() == 2 );
770  assert( p_values.nelem() == itw.nrows() );
771 
772  // Local variable to store log of the pressure grid:
773  Vector logpgrid( p_grid.nelem() );
774 
775  transform( logpgrid, log, p_grid );
776 
777  interp( p_values, itw, logpgrid, gp );
778 
779  transform( p_values, exp, p_values );
780 }
781 
782 
783 
785 
811  ConstVectorView old_pgrid,
812  ConstVectorView new_pgrid,
813  const Numeric& extpolfac )
814 {
815  // Local variable to store log of the pressure grids
816  Vector logold( old_pgrid.nelem() );
817  Vector lognew( new_pgrid.nelem() );
818 
819  transform( logold, log, old_pgrid );
820  transform( lognew, log, new_pgrid );
821 
822  gridpos( gp, logold, lognew, extpolfac );
823 }
824 
826 
844  ConstVectorView old_pgrid,
845  ConstVectorView new_pgrid,
846  const Index order,
847  const Numeric& extpolfac )
848 {
849  // Local variable to store log of the pressure grids
850  Vector logold( old_pgrid.nelem() );
851  Vector lognew( new_pgrid.nelem() );
852 
853  transform( logold, log, old_pgrid );
854  transform( lognew, log, new_pgrid );
855 
856  gridpos_poly( gp, logold, lognew, order, extpolfac );
857 }
858 
859 
860 /*===========================================================================
861  === Various functions connected to the atmospheric fields
862  ===========================================================================*/
863 
865 
883  VectorView z,
884  ConstVectorView p_grid,
885 // FIXME only used in assertion
886 #ifndef NDEBUG
887  ConstVectorView lat_grid,
888 #else
890 #endif
891  ConstMatrixView z_field,
892  const GridPos& gp_lat )
893 {
894  const Index np = p_grid.nelem();
895 
896  assert( z.nelem() == np );
897  assert( z_field.nrows() == np );
898  assert( z_field.ncols() == lat_grid.nelem() );
899 
900  Matrix z_matrix(np,1);
901  ArrayOfGridPos gp_z(np), agp_lat(1);
902  Tensor3 itw(np,1,4);
903 
904  gridpos_copy( agp_lat[0], gp_lat );
905  gridpos( gp_z, p_grid, p_grid );
906  interpweights( itw, gp_z, agp_lat );
907  interp( z_matrix, itw, z_field, gp_z, agp_lat );
908 
909  z = z_matrix(Range(joker),0);
910 }
911 
912 
913 
915 
935  VectorView z,
936  ConstVectorView p_grid,
937 //FIXME only used in assertion
938 #ifndef NDEBUG
939  ConstVectorView lat_grid,
940  ConstVectorView lon_grid,
941 #else
944 #endif
945  ConstTensor3View z_field,
946  const GridPos& gp_lat,
947  const GridPos& gp_lon )
948 {
949  const Index np = p_grid.nelem();
950 
951  assert( z.nelem() == np );
952  assert( z_field.npages() == np );
953  assert( z_field.nrows() == lat_grid.nelem() );
954  assert( z_field.ncols() == lon_grid.nelem() );
955 
956  Tensor3 z_tensor(np,1,1);
957  ArrayOfGridPos agp_z(np), agp_lat(1), agp_lon(1);
958  Tensor4 itw(np,1,1,8);
959 
960  gridpos_copy( agp_lat[0], gp_lat );
961  gridpos_copy( agp_lon[0], gp_lon );
962  gridpos( agp_z, p_grid, p_grid );
963  interpweights( itw, agp_z, agp_lat, agp_lon );
964 
965  interp( z_tensor, itw, z_field, agp_z, agp_lat, agp_lon );
966 
967  z = z_tensor(Range(joker),0,0);
968 }
Matrix
The Matrix class.
Definition: matpackI.h:767
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.cc:1728
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:506
auto_md.h
gridpos_copy
void gridpos_copy(GridPos &gp_new, const GridPos &gp_old)
gridpos_copy
Definition: interpolation.cc:482
chk_if_increasing
void chk_if_increasing(const String &x_name, const ArrayOfIndex &x)
chk_if_increasing
Definition: check_input.cc:126
gridpos
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
Definition: interpolation.cc:167
Tensor3
The Tensor3 class.
Definition: matpackIII.h:340
itw2p
void itw2p(VectorView p_values, ConstVectorView p_grid, const ArrayOfGridPos &gp, ConstMatrixView itw)
itw2p
Definition: special_interp.cc:763
p2gridpos
void p2gridpos(ArrayOfGridPos &gp, ConstVectorView old_pgrid, ConstVectorView new_pgrid, const Numeric &extpolfac)
p2gridpos
Definition: special_interp.cc:810
joker
const Joker joker
last
Numeric last(ConstVectorView x)
last
Definition: math_funcs.cc:183
interp
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
Definition: interpolation.cc:1000
z_at_latlon
void z_at_latlon(VectorView z, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, const GridPos &gp_lat, const GridPos &gp_lon)
z_at_latlon
Definition: special_interp.cc:934
interp_atmfield_by_itw
void interp_atmfield_by_itw(VectorView x, const Index &atmosphere_dim, ConstTensor3View x_field, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon, ConstMatrixView itw)
interp_atmfield_by_itw
Definition: special_interp.cc:159
interp_cloudfield_gp2itw
void interp_cloudfield_gp2itw(Matrix &itw, ArrayOfGridPos &gp_p_out, ArrayOfGridPos &gp_lat_out, ArrayOfGridPos &gp_lon_out, const ArrayOfGridPos &gp_p_in, const ArrayOfGridPos &gp_lat_in, const ArrayOfGridPos &gp_lon_in, const Index &atmosphere_dim, const ArrayOfIndex &cloudbox_limits)
interp_cloudfield_gp2itw
Definition: special_interp.cc:300
ConstMatrixView::nrows
Index nrows() const
Returns the number of rows.
Definition: matpackI.cc:796
GriddedField::get_numeric_grid
ConstVectorView get_numeric_grid(Index i) const
Get a numeric grid.
Definition: gridded_fields.cc:91
z_at_lat_2d
void z_at_lat_2d(VectorView z, ConstVectorView p_grid, ConstVectorView lat_grid, ConstMatrixView z_field, const GridPos &gp_lat)
z_at_lat_2d
Definition: special_interp.cc:882
Tensor4
The Tensor4 class.
Definition: matpackIV.h:375
GriddedField3
Definition: gridded_fields.h:274
interp_atmsurface_gp2itw
void interp_atmsurface_gp2itw(Matrix &itw, const Index &atmosphere_dim, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
interp_atmsurface_gp2itw
Definition: special_interp.cc:396
Array< GridPos >
GriddedField3::data
Tensor3 data
Definition: gridded_fields.h:323
messages.h
Declarations having to do with the four output streams.
gridpos_upperend_check
void gridpos_upperend_check(GridPos &gp, const Index &ie)
gridpos_upperend_check
Definition: interpolation.cc:608
ConstMatrixView::ncols
Index ncols() const
Returns the number of columns.
Definition: matpackI.cc:802
my_basic_string
The implementation for String, the ARTS string class.
Definition: mystring.h:62
ConstVectorView::nelem
Index nelem() const
Returns the number of elements.
Definition: matpackI.cc:175
VectorView
The VectorView class.
Definition: matpackI.h:373
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
math_funcs.h
Matrix::resize
void resize(Index r, Index c)
Resize function.
Definition: matpackI.cc:1549
ConstTensor3View::nrows
Index nrows() const
Returns the number of rows.
Definition: matpackIII.h:154
ConstMatrixView
A constant view of a Matrix.
Definition: matpackI.h:591
Range
The range class.
Definition: matpackI.h:148
GridPos
Structure to store a grid position.
Definition: interpolation.h:74
interp_atmfield_gp2itw
void interp_atmfield_gp2itw(Matrix &itw, const Index &atmosphere_dim, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
interp_atmfield_gp2itw
Definition: special_interp.cc:99
interp_atmfield_by_gp
void interp_atmfield_by_gp(VectorView x, const Index &atmosphere_dim, ConstTensor3View x_field, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
interp_atmfield_by_gp
Definition: special_interp.cc:215
ConstTensor3View::ncols
Index ncols() const
Returns the number of columns.
Definition: matpackIII.h:157
ConstTensor3View
A constant view of a Tensor3.
Definition: matpackIII.h:147
special_interp.h
Header file for special_interp.cc.
interp_gfield3
void interp_gfield3(Numeric &value, const GriddedField3 &gfield3, const Index &effective_dim, const Numeric &x, const Numeric &y, const Numeric &z, const String &dim0, const String &dim1, const String &dim2)
interp_gfield3
Definition: special_interp.cc:581
p2gridpos_poly
void p2gridpos_poly(ArrayOfGridPosPoly &gp, ConstVectorView old_pgrid, ConstVectorView new_pgrid, const Index order, const Numeric &extpolfac)
p2gridpos_poly
Definition: special_interp.cc:843
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
GriddedField::get_grid_name
const String & get_grid_name(Index i) const
Get grid name.
Definition: gridded_fields.h:107
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:95
interp_atmsurface_by_itw
void interp_atmsurface_by_itw(VectorView x, const Index &atmosphere_dim, ConstMatrixView x_surface, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon, ConstMatrixView itw)
interp_atmsurface_by_itw
Definition: special_interp.cc:452
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:124
Vector
The Vector class.
Definition: matpackI.h:555
ConstVectorView
A constant view of a Vector.
Definition: matpackI.h:300
Array::nelem
Index nelem() const
Number of elements.
Definition: array.h:172
interpweights
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
Definition: interpolation.cc:756