#include "interpolation.h"
#include <string.h>
#include <stdio.h>
Functions | |
int | mifi_3d_array_position (int x, int y, int z, int ix, int iy, int iz) |
int | mifi_points2position (double *points, const int n, const double *axis, const int num, const int axis_type) |
find position in array of position in projection | |
int | mifi_interpolate_f (const int method, const char *proj_input, const float *infield, const double *in_x_axis, const double *in_y_axis, const int in_x_axis_type, const int in_y_axis_type, const int ix, const int iy, const int iz, const char *proj_output, float *outfield, const double *out_x_axis, const double *out_y_axis, const int out_x_axis_type, const int out_y_axis_type, const int ox, const int oy) |
int | mifi_get_vector_reproject_matrix (const char *proj_input, const char *proj_output, const double *out_x_axis, const double *out_y_axis, int out_x_axis_type, int out_y_axis_type, int ox, int oy, double *matrix) |
int | mifi_vector_reproject_values_by_matrix_f (int method, const double *matrix, float *u_out, float *v_out, int ox, int oy, int oz) |
int | mifi_vector_reproject_values_f (int method, const char *proj_input, const char *proj_output, float *u_out, float *v_out, const double *out_x_axis, const double *out_y_axis, int out_x_axis_type, int out_y_axis_type, int ox, int oy, int oz) |
interpolate the vector values | |
int | mifi_get_values_f (const float *infield, float *outvalues, const double x, const double y, const int ix, const int iy, const int iz) |
int | mifi_get_values_bilinear_f (const float *infield, float *outvalues, const double x, const double y, const int ix, const int iy, const int iz) |
int | mifi_get_values_bicubic_f (const float *infield, float *outvalues, const double x, const double y, const int ix, const int iy, const int iz) |
not implemented yet | |
int | mifi_project_axes (const char *proj_input, const char *proj_output, const double *in_x_axis, const double *in_y_axis, const int ix, const int iy, double *out_xproj_axis, double *out_yproj_axis) |
project axes so that the projetion (x,y) => (x_proj), (y_proj) can be expressed as x_proj(x,y), y_proj(x,y) | |
size_t | mifi_bad2nanf (float *posPtr, float *endPtr, float badVal) |
size_t | mifi_nanf2bad (float *posPtr, float *endPtr, float badVal) |
|
gives the position of an fortran like array of size ix, iy, iz
|
|
Convert bad-values to nan. The mifi_ functions don't handle bad values generally, but forward this work to the floating-point IEEE NaN's. This function converts a general bad value to a nan in a float array.
|
|
not implemented yet
|
|
Bilinear interpolation requires a neighborhood extending one pixel to the right and below the central sample. If the fractional subsample position is given by (xfrac, yfrac), the resampled pixel value will be:
(1 - yfrac) * [(1 - xfrac)*s00 + xfrac*s01] + yfrac * [(1 - xfrac)*s10 + xfrac*s11] This is documented by the following diagram: s00 s01 . < yfrac s10 s11 ^ xfrac
|
|
|
|
calculate the vector reprojection matrix used in mifi_vector_reproject_values_f
|
|
Interpolation between two projections. Missing values are set to MIFI_UNDEFINED_F which is implemented as C99 nanf. The coordinates of a cell give the midpoint of a cell, i.e. cell (10,20) spans ([9.5..10.5[,[19.5-20.5[)
|
|
Convert nan back to bad-values. See mifi_bad2nanf
|
|
find position in array of position in projection points2position uses linear splines to find the array-position of points in the given axis
|
|
project axes so that the projetion (x,y) => (x_proj), (y_proj) can be expressed as x_proj(x,y), y_proj(x,y) all axes must be given or will be returned in radians when converted from/to latlon
|
|
calculate the reprojected vectors with a known matrix for mifi_vector_reproject_values_f
|
|
interpolate the vector values When reprojecting a vector (i.e. wind (u, v)) from one projection to another, not only the base-position of the vector will change, but also the angle of the vector might change due to rotation and streching within the projection. Thus, the values of (u,v) have to be changed accordingly to projection. This function allows to only rotate the vector values (MIFI_VECTOR_KEEP_SIZE) which is useful to keep the windspeed constant, even if the projected plane has a different scale, or to completely reproject the vector (MIFI_VECTOR_RESIZE). This function is implemented by using a first order tailor expansion of the projection: (u', v') = A (u,v) with A a matrix defined at each point (x,y) through proj(x,y)_x' = a11*x+a21*y proj(x,y)_y' = a12*x+a22*y
|