9#ifndef special_interp_h
10#define special_interp_h
41 const Index& atmosphere_dim,
72 const Index& atmosphere_dim,
73 ConstTensor3View x_field,
104 const Index& atmosphere_dim,
105 ConstTensor3View x_field,
136 ConstTensor3View x_field,
137 const GridPos& gp_p = {0, {0, 1}},
138 const GridPos& gp_lat = {0, {0, 1}},
139 const GridPos& gp_lon = {0, {0, 1}});
175 const Index& atmosphere_dim,
198 const Index& atmosphere_dim,
227 const Index& atmosphere_dim,
228 ConstMatrixView x_surface,
231 ConstMatrixView itw);
257 const Index& atmosphere_dim,
258 ConstMatrixView x_field,
287 ConstMatrixView x_field,
307 const Index& atmosphere_dim,
308 ConstTensor3View field_old,
328 const Index& atmosphere_dim,
329 ConstMatrixView field_old,
357 const Index& atmosphere_dim,
358 const Vector& p_grid,
359 const Vector& lat_grid,
360 const Vector& lon_grid);
383 const Index& atmosphere_dim,
384 const Vector& lat_grid,
385 const Vector& lon_grid);
421 const ArrayOfVector& ret_grids,
422 const Index& atmosphere_dim,
423 const Vector& p_grid,
424 const Vector& lat_grid,
425 const Vector& lon_grid);
455 const ArrayOfVector& ret_grids,
456 const Index& atmosphere_dim,
457 const Vector& lat_grid,
458 const Vector& lon_grid);
477 const Index& atmosphere_dim,
478 ConstTensor3View field_old,
498 const Index& atmosphere_dim,
499 ConstMatrixView field_old,
523void itw2p(VectorView p_values,
524 ConstVectorView p_grid,
526 ConstMatrixView itw);
553 ConstVectorView old_pgrid,
554 ConstVectorView new_pgrid,
555 const Numeric& extpolfac = 0.5);
585 const Index& atmosphere_dim,
586 ConstVectorView p_grid,
587 ConstVectorView lat_grid,
588 ConstVectorView lon_grid,
589 ConstTensor3View z_field,
590 ConstVectorView rte_pos);
612 const Index& atmosphere_dim,
613 ConstVectorView lat_grid,
614 ConstVectorView lon_grid,
615 ConstVectorView rte_pos);
634 ConstVectorView p_grid,
635 ConstVectorView lat_grid,
636 ConstMatrixView z_field,
658 ConstVectorView p_grid,
659 ConstVectorView lat_grid,
660 ConstVectorView lon_grid,
661 ConstTensor3View z_field,
683 ConstVectorView f_grid,
684 ConstVectorView t_grid);
Deals with internal derivatives, Jacobian definition, and OEM calculations.
Implementation of gridded fields.
Header file for interpolation.cc.
Routines for setting up the jacobian.
void complex_n_interp(MatrixView n_real, MatrixView n_imag, const GriddedField3 &complex_n, const String &varname, ConstVectorView f_grid, ConstVectorView t_grid)
General function for interpolating data of complex n type.
void regrid_atmfield_by_gp(Tensor3 &field_new, const Index &atmosphere_dim, ConstTensor3View field_old, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Regrids an atmospheric field, for precalculated grid positions.
void interp_atmsurface_gp2itw(Matrix &itw, const Index &atmosphere_dim, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Converts atmospheric grid positions to weights for interpolation of a surface-type variable.
void regrid_atmfield_by_gp_oem(Tensor3 &field_new, const Index &atmosphere_dim, ConstTensor3View field_old, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Regridding of atmospheric field OEM-type.
void get_gp_atmsurf_to_rq(ArrayOfGridPos &gp_lat, ArrayOfGridPos &gp_lon, const RetrievalQuantity &rq, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid)
Determines grid positions for regridding of atmospheric surfaces to retrieval grids.
void regrid_atmsurf_by_gp(Matrix &field_new, const Index &atmosphere_dim, ConstMatrixView field_old, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Regrids an atmospheric surface, for precalculated grid positions.
void interp_atmfield_gp2itw(Matrix &itw, const Index &atmosphere_dim, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Converts atmospheric grid positions to weights for interpolation of an atmospheric field.
void p2gridpos(ArrayOfGridPos &gp, ConstVectorView old_pgrid, ConstVectorView new_pgrid, const Numeric &extpolfac=0.5)
Calculates grid positions for pressure values.
void itw2p(VectorView p_values, ConstVectorView p_grid, const ArrayOfGridPos &gp, ConstMatrixView itw)
Converts interpolation weights to pressures.
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)
Returns the geomtrical altitudes of p_grid for one latitude and one longitude.
void interp_atmsurface_by_gp(VectorView x, const Index &atmosphere_dim, ConstMatrixView x_field, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Interpolates a surface-type variable given the grid positions.
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)
Converts atmospheric a grid position to weights for interpolation of a field defined ONLY inside the ...
void get_gp_rq_to_atmgrids(ArrayOfGridPos &gp_p, ArrayOfGridPos &gp_lat, ArrayOfGridPos &gp_lon, Index &n_p, Index &n_lat, Index &n_lon, const ArrayOfVector &ret_grids, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid)
Determines grid positions for regridding of atmospheric fields to retrieval grids.
void regrid_atmsurf_by_gp_oem(Matrix &field_new, const Index &atmosphere_dim, ConstMatrixView field_old, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Regridding of surface field OEM-type.
void get_gp_atmgrids_to_rq(ArrayOfGridPos &gp_p, ArrayOfGridPos &gp_lat, ArrayOfGridPos &gp_lon, const RetrievalQuantity &rq, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid)
Determines grid positions for regridding of atmospheric fields to retrieval grids.
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)
Interpolates an atmospheric field given the grid positions.
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)
Converts a geographical position (rte_pos) to grid positions for p, lat and lon.
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)
Interpolates an atmospheric field with pre-calculated weights by interp_atmfield_gp2itw.
void z_at_lat_2d(VectorView z, ConstVectorView p_grid, ConstVectorView lat_grid, ConstMatrixView z_field, const GridPos &gp_lat)
Returns the geomtrical altitudes of p_grid for one latitude.
void interp_atmsurface_by_itw(VectorView x, const Index &atmosphere_dim, ConstMatrixView x_surface, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon, ConstMatrixView itw)
Interpolates a surface-type variable with pre-calculated weights by interp_atmsurface_gp2itw.
Structure to store a grid position.