ARTS  2.2.66
special_interp.cc
Go to the documentation of this file.
1 /* Copyright (C) 2002-2012 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 
302  VectorView itw,
303  GridPos& gp_p_out,
304  GridPos& gp_lat_out,
305  GridPos& gp_lon_out,
306  const GridPos& gp_p_in,
307  const GridPos& gp_lat_in,
308  const GridPos& gp_lon_in,
309  const Index& atmosphere_dim,
310  const ArrayOfIndex& cloudbox_limits )
311 {
312  // Shift grid positions to cloud box grids
313  if( atmosphere_dim == 1 )
314  {
315  gridpos_copy( gp_p_out, gp_p_in );
316  gp_p_out.idx -= cloudbox_limits[0];
317  gridpos_upperend_check( gp_p_out, cloudbox_limits[1]-cloudbox_limits[0] );
318  assert(itw.nelem() == 2 );
319  interpweights( itw, gp_p_out );
320  }
321  else if( atmosphere_dim == 2 )
322  {
323  gridpos_copy( gp_p_out, gp_p_in );
324  gridpos_copy( gp_lat_out, gp_lat_in );
325  gp_p_out.idx -= cloudbox_limits[0];
326  gp_lat_out.idx -= cloudbox_limits[2];
327  gridpos_upperend_check( gp_p_out, cloudbox_limits[1]-cloudbox_limits[0]);
328  gridpos_upperend_check( gp_lat_out,cloudbox_limits[3]-cloudbox_limits[2]);
329  assert(itw.nelem() == 4 );
330  interpweights( itw, gp_p_out, gp_lat_out );
331  }
332  else
333  {
334  gridpos_copy( gp_p_out, gp_p_in );
335  gridpos_copy( gp_lat_out, gp_lat_in );
336  gridpos_copy( gp_lon_out, gp_lon_in );
337  gp_p_out.idx -= cloudbox_limits[0];
338  gp_lat_out.idx -= cloudbox_limits[2];
339  gp_lon_out.idx -= cloudbox_limits[4];
340  gridpos_upperend_check( gp_p_out, cloudbox_limits[1]-cloudbox_limits[0]);
341  gridpos_upperend_check( gp_lat_out,cloudbox_limits[3]-cloudbox_limits[2]);
342  gridpos_upperend_check( gp_lon_out,cloudbox_limits[5]-cloudbox_limits[4]);
343  assert(itw.nelem() == 8 );
344  interpweights( itw, gp_p_out, gp_lat_out, gp_lon_out );
345  }
346 }
347 
348 
349 
351 
372  Matrix& itw,
373  const Index& atmosphere_dim,
374  const ArrayOfGridPos& gp_lat,
375  const ArrayOfGridPos& gp_lon )
376 {
377  if( atmosphere_dim == 1 )
378  {
379  itw.resize(1,1);
380  itw = 1;
381  }
382 
383  else if( atmosphere_dim == 2 )
384  {
385  const Index n = gp_lat.nelem();
386  itw.resize(n,2);
387  interpweights( itw, gp_lat );
388  }
389 
390  else if( atmosphere_dim == 3 )
391  {
392  const Index n = gp_lat.nelem();
393  assert( n == gp_lon.nelem() );
394  itw.resize(n,4);
395  interpweights( itw, gp_lat, gp_lon );
396  }
397 }
398 
399 
400 
402 
428  VectorView x,
429  const Index& atmosphere_dim,
430  ConstMatrixView x_surface,
431  const ArrayOfGridPos& gp_lat,
432  const ArrayOfGridPos& gp_lon,
433  ConstMatrixView itw )
434 {
435  if( atmosphere_dim == 1 )
436  {
437  assert( itw.ncols() == 1 );
438  x = x_surface(0,0);
439  }
440 
441  else if( atmosphere_dim == 2 )
442  {
443  assert( x.nelem() == gp_lat.nelem() );
444  assert( itw.ncols() == 2 );
445  interp( x, itw, x_surface(Range(joker),0), gp_lat );
446  }
447 
448  else if( atmosphere_dim == 3 )
449  {
450  assert( x.nelem() == gp_lat.nelem() );
451  assert( itw.ncols() == 4 );
452  interp( x, itw, x_surface, gp_lat, gp_lon );
453  }
454 }
455 
456 
457 
459 
482  VectorView x,
483  const Index& atmosphere_dim,
484  ConstMatrixView x_surface,
485  const ArrayOfGridPos& gp_lat,
486  const ArrayOfGridPos& gp_lon )
487 {
488  Matrix itw;
489 
490  interp_atmsurface_gp2itw( itw, atmosphere_dim, gp_lat, gp_lon );
491 
492  interp_atmsurface_by_itw( x, atmosphere_dim, x_surface, gp_lat, gp_lon, itw );
493 }
494 
495 
496 
498 
505  const Index& atmosphere_dim,
506  ConstMatrixView x_surface,
507  const GridPos& gp_lat,
508  const GridPos& gp_lon )
509 {
510  ArrayOfGridPos agp_lat(0), agp_lon(0);
511 
512  if( atmosphere_dim > 1 )
513  {
514  agp_lat.resize(1);
515  gridpos_copy( agp_lat[0], gp_lat );
516  }
517 
518  if( atmosphere_dim > 2 )
519  {
520  agp_lon.resize(1);
521  gridpos_copy( agp_lon[0], gp_lon );
522  }
523 
524  Vector x(1);
525 
526  interp_atmsurface_by_gp( x, atmosphere_dim, x_surface, agp_lat, agp_lon );
527 
528  return x[0];
529 }
530 
531 
532 
533 
534 
535 /*===========================================================================
536  === Conversion altitudes / pressure
537  ===========================================================================*/
538 
540 
561 void itw2p(
562  VectorView p_values,
563  ConstVectorView p_grid,
564  const ArrayOfGridPos& gp,
565  ConstMatrixView itw )
566 {
567  assert( itw.ncols() == 2 );
568  assert( p_values.nelem() == itw.nrows() );
569 
570  // Local variable to store log of the pressure grid:
571  Vector logpgrid( p_grid.nelem() );
572 
573  transform( logpgrid, log, p_grid );
574 
575  interp( p_values, itw, logpgrid, gp );
576 
577  transform( p_values, exp, p_values );
578 }
579 
580 
581 
583 
609  ConstVectorView old_pgrid,
610  ConstVectorView new_pgrid,
611  const Numeric& extpolfac )
612 {
613  // Local variable to store log of the pressure grids
614  Vector logold( old_pgrid.nelem() );
615  Vector lognew( new_pgrid.nelem() );
616 
617  transform( logold, log, old_pgrid );
618  transform( lognew, log, new_pgrid );
619 
620  gridpos( gp, logold, lognew, extpolfac );
621 }
622 
623 
624 
626 
644  ConstVectorView old_pgrid,
645  ConstVectorView new_pgrid,
646  const Index order,
647  const Numeric& extpolfac )
648 {
649  // Local variable to store log of the pressure grids
650  Vector logold( old_pgrid.nelem() );
651  Vector lognew( new_pgrid.nelem() );
652 
653  transform( logold, log, old_pgrid );
654  transform( lognew, log, new_pgrid );
655 
656  gridpos_poly( gp, logold, lognew, order, extpolfac );
657 }
658 
659 
660 
662 
689  GridPos& gp_p,
690  GridPos& gp_lat,
691  GridPos& gp_lon,
692  const Index& atmosphere_dim,
693  ConstVectorView p_grid,
694  ConstVectorView lat_grid,
695  ConstVectorView lon_grid,
696  ConstTensor3View z_field,
697  ConstVectorView rte_pos )
698 {
699  chk_rte_pos( atmosphere_dim, rte_pos );
700 
701  if( atmosphere_dim == 1 )
702  {
703  chk_interpolation_grids( "Altitude interpolation", z_field(joker,0,0),
704  rte_pos[0] );
705  gridpos( gp_p, z_field(joker,0,0), rte_pos[0] );
706  }
707  else
708  {
709  // Determine z at lat/lon (z_grid) by blue interpolation
710  const Index np = p_grid.nelem();
711  Vector z_grid( np );
712  ArrayOfGridPos agp_z, agp_lat(np);
713  //
714  gridpos_1to1( agp_z, p_grid );
715  //
716  chk_interpolation_grids( "Latitude interpolation", lat_grid, rte_pos[1] );
717  gridpos( gp_lat, lat_grid, rte_pos[1] );
718 
719  if( atmosphere_dim == 2 )
720  {
721  for( Index i=0; i<np; i++ )
722  { agp_lat[i] = gp_lat; }
723  Matrix itw( np, 4 );
724  interpweights( itw, agp_z, agp_lat );
725  interp( z_grid, itw, z_field(joker,joker,0), agp_z, agp_lat );
726  }
727  else
728  {
729  chk_interpolation_grids( "Longitude interpolation", lon_grid,
730  rte_pos[2] );
731  gridpos( gp_lon, lon_grid, rte_pos[2] );
732  ArrayOfGridPos agp_lon(np);
733  for( Index i=0; i<np; i++ )
734  {
735  agp_lat[i] = gp_lat;
736  agp_lon[i] = gp_lon;
737  }
738  Matrix itw( np, 8 );
739  interpweights( itw, agp_z, agp_lat, agp_lon );
740  interp( z_grid, itw, z_field, agp_z, agp_lat, agp_lon );
741 
742  }
743 
744  // And use z_grid to get gp_p (gp_al and gp_lon determined above)
745  chk_interpolation_grids( "Altitude interpolation", z_grid, rte_pos[0] );
746  gridpos( gp_p, z_grid, rte_pos[0] );
747  }
748 }
749 
750 
751 
753 
771  VectorView z,
772  ConstVectorView p_grid,
773 // FIXME only used in assertion
774 #ifndef NDEBUG
775  ConstVectorView lat_grid,
776 #else
778 #endif
779  ConstMatrixView z_field,
780  const GridPos& gp_lat )
781 {
782  const Index np = p_grid.nelem();
783 
784  assert( z.nelem() == np );
785  assert( z_field.nrows() == np );
786  assert( z_field.ncols() == lat_grid.nelem() );
787 
788  Matrix z_matrix(np,1);
789  ArrayOfGridPos gp_z(np), agp_lat(1);
790  Tensor3 itw(np,1,4);
791 
792  gridpos_copy( agp_lat[0], gp_lat );
793  gridpos( gp_z, p_grid, p_grid );
794  interpweights( itw, gp_z, agp_lat );
795  interp( z_matrix, itw, z_field, gp_z, agp_lat );
796 
797  z = z_matrix(Range(joker),0);
798 }
799 
800 
801 
803 
823  VectorView z,
824  ConstVectorView p_grid,
825 //FIXME only used in assertion
826 #ifndef NDEBUG
827  ConstVectorView lat_grid,
828  ConstVectorView lon_grid,
829 #else
832 #endif
833  ConstTensor3View z_field,
834  const GridPos& gp_lat,
835  const GridPos& gp_lon )
836 {
837  const Index np = p_grid.nelem();
838 
839  assert( z.nelem() == np );
840  assert( z_field.npages() == np );
841  assert( z_field.nrows() == lat_grid.nelem() );
842  assert( z_field.ncols() == lon_grid.nelem() );
843 
844  Tensor3 z_tensor(np,1,1);
845  ArrayOfGridPos agp_z(np), agp_lat(1), agp_lon(1);
846  Tensor4 itw(np,1,1,8);
847 
848  gridpos_copy( agp_lat[0], gp_lat );
849  gridpos_copy( agp_lon[0], gp_lon );
850  gridpos( agp_z, p_grid, p_grid );
851  interpweights( itw, agp_z, agp_lat, agp_lon );
852 
853  interp( z_tensor, itw, z_field, agp_z, agp_lat, agp_lon );
854 
855  z = z_tensor(Range(joker),0,0);
856 }
857 
858 
859 
860 /*===========================================================================
861  === Interpolation of GriddedFields
862  ===========================================================================*/
863 
865 
881  MatrixView n_real,
882  MatrixView n_imag,
883  const GriddedField3& complex_n,
884  const String& varname,
885  ConstVectorView f_grid,
886  ConstVectorView t_grid )
887 {
888  // Set expected order of grids
889  Index gfield_fID = 0;
890  Index gfield_tID = 1;
891  Index gfield_compID = 2;
892 
893  // Check of complex_n
894  //
895  complex_n.checksize_strict();
896  //
897  chk_griddedfield_gridname( complex_n, gfield_fID, "Frequency" );
898  chk_griddedfield_gridname( complex_n, gfield_tID, "Temperature" );
899  chk_griddedfield_gridname( complex_n, gfield_compID, "Complex" );
900  //
901  if( complex_n.data.ncols() != 2 )
902  {
903  ostringstream os;
904  os << "The data in *" << varname << "* must have exactly two pages. One page "
905  << "each\nfor the real and imaginary part of the complex refractive index.";
906  }
907 
908  // Frequency and temperature grid sizes
909  const Index nf_in = complex_n.data.npages();
910  const Index nt_in = complex_n.data.nrows();
911  const Index nf_out = f_grid.nelem();
912  const Index nt_out = t_grid.nelem();
913 
914  //Assert size of output variables
915  assert( n_real.nrows() == nf_out && n_real.ncols() == nt_out );
916  assert( n_imag.nrows() == nf_out && n_imag.ncols() == nt_out );
917 
918  const Vector& f_grid_in = complex_n.get_numeric_grid(gfield_fID);
919  const Vector& t_grid_in = complex_n.get_numeric_grid(gfield_tID);
920 
921  // Expand/interpolate in frequency dimension
922  //
923  Matrix nrf(nf_out,nt_in), nif(nf_out,nt_in);
924  //
925  if( nf_in == 1 )
926  {
927  for( Index i=0; i<nf_out; i++ )
928  {
929  nrf(i,joker) = complex_n.data(0,joker,0);
930  nif(i,joker) = complex_n.data(0,joker,1);
931  }
932  }
933  else
934  {
935  chk_interpolation_grids( "Frequency interpolation", f_grid_in, f_grid );
936  //
937  ArrayOfGridPos gp( nf_out );
938  Matrix itw( nf_out, 2 );
939  gridpos( gp, f_grid_in, f_grid );
940  interpweights( itw, gp );
941  for( Index i=0; i<nt_in; i++ )
942  {
943  interp( nrf(joker,i), itw, complex_n.data(joker,i,0), gp );
944  interp( nif(joker,i), itw, complex_n.data(joker,i,1), gp );
945  }
946  }
947 
948  // Expand/interpolate in temperature dimension
949  //
950  if( nt_in == 1 )
951  {
952  for( Index i=0; i<nt_out; i++ )
953  {
954  n_real(joker,i) = nrf(joker,0);
955  n_imag(joker,i) = nif(joker,0);
956  }
957  }
958  else
959  {
960  chk_interpolation_grids( "Temperature interpolation", t_grid_in, t_grid );
961  //
962  ArrayOfGridPos gp( nt_out );
963  Matrix itw( nt_out, 2 );
964  gridpos( gp, t_grid_in, t_grid );
965  interpweights( itw, gp );
966  for( Index i=0; i<nf_out; i++ )
967  {
968  interp( n_real(i,joker), itw, nrf(i,joker), gp );
969  interp( n_imag(i,joker), itw, nif(i,joker), gp );
970  }
971  }
972 }
gridpos_1to1
void gridpos_1to1(ArrayOfGridPos &gp, ConstVectorView grid)
gridpos_1to1
Definition: interpolation.cc:488
Matrix
The Matrix class.
Definition: matpackI.h:788
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:1838
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
MatrixView
The MatrixView class.
Definition: matpackI.h:679
auto_md.h
gridpos_copy
void gridpos_copy(GridPos &gp_new, const GridPos &gp_old)
gridpos_copy
Definition: interpolation.cc:517
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
Tensor3
The Tensor3 class.
Definition: matpackIII.h:348
GriddedField3::checksize_strict
virtual void checksize_strict() const
Strict consistency check.
Definition: gridded_fields.h:332
itw2p
void itw2p(VectorView p_values, ConstVectorView p_grid, const ArrayOfGridPos &gp, ConstMatrixView itw)
itw2p
Definition: special_interp.cc:561
p2gridpos
void p2gridpos(ArrayOfGridPos &gp, ConstVectorView old_pgrid, ConstVectorView new_pgrid, const Numeric &extpolfac)
p2gridpos
Definition: special_interp.cc:608
joker
const Joker joker
interp
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
Definition: interpolation.cc:1046
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:822
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
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
ConstMatrixView::nrows
Index nrows() const
Returns the number of rows.
Definition: matpackI.cc:832
GriddedField::get_numeric_grid
ConstVectorView get_numeric_grid(Index i) const
Get a numeric grid.
Definition: gridded_fields.cc:93
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:770
Tensor4
The Tensor4 class.
Definition: matpackIV.h:383
GriddedField3
Definition: gridded_fields.h:307
ConstTensor3View::npages
Index npages() const
Returns the number of pages.
Definition: matpackIII.h:143
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:371
Array< GridPos >
GriddedField3::data
Tensor3 data
Definition: gridded_fields.h:370
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
gridpos_upperend_check
void gridpos_upperend_check(GridPos &gp, const Index &ie)
gridpos_upperend_check
Definition: interpolation.cc:643
ConstMatrixView::ncols
Index ncols() const
Returns the number of columns.
Definition: matpackI.cc:838
my_basic_string
The implementation for String, the ARTS string class.
Definition: mystring.h:64
ConstVectorView::nelem
Index nelem() const
Returns the number of elements.
Definition: matpackI.cc:180
VectorView
The VectorView class.
Definition: matpackI.h:372
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:29
math_funcs.h
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
ConstMatrixView
A constant view of a Matrix.
Definition: matpackI.h:596
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:149
ConstTensor3View
A constant view of a Tensor3.
Definition: matpackIII.h:139
special_interp.h
Header file for special_interp.cc.
rte_pos2gridpos
void rte_pos2gridpos(GridPos &gp_p, GridPos &gp_lat, GridPos &gp_lon, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView rte_pos)
rte_pos2gridpos
Definition: special_interp.cc:688
GridPos::idx
Index idx
Definition: interpolation.h:75
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:643
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:35
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:427
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
Vector
The Vector class.
Definition: matpackI.h:556
interp_cloudfield_gp2itw
void interp_cloudfield_gp2itw(VectorView itw, GridPos &gp_p_out, GridPos &gp_lat_out, GridPos &gp_lon_out, const GridPos &gp_p_in, const GridPos &gp_lat_in, const GridPos &gp_lon_in, const Index &atmosphere_dim, const ArrayOfIndex &cloudbox_limits)
interp_cloudfield_gp2itw
Definition: special_interp.cc:301
ConstVectorView
A constant view of a Vector.
Definition: matpackI.h:292
Array::nelem
Index nelem() const
Number of elements.
Definition: array.h:176
interpweights
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
Definition: interpolation.cc:802