Module for defining transformations between rectangular georeferenced grids and between grids and sparse points and vice-versa.
Continua...
|
type(interval_info) function, public | interval_info_new (interv_gt, interv_ge, interv_lt, interv_le) |
|
subroutine | transform_init (this, trans_type, sub_type, ix, iy, fx, fy, ilon, ilat, flon, flat, npx, npy, boxdx, boxdy, radius, poly, percentile, interv_gt, interv_ge, interv_lt, interv_le, extrap, time_definition, input_levtype, input_coordvar, output_levtype, categoryappend) |
| Constructor for a transform_def object, defining an abstract transformation between gridded and/or sparse point data.
|
|
subroutine | transform_delete (this) |
| Destructor of tranform_def object.
|
|
subroutine | transform_get_val (this, time_definition, trans_type, sub_type, input_levtype, output_levtype) |
| Method for returning the contents of the object.
|
|
subroutine | grid_transform_levtype_levtype_init (this, trans, lev_in, lev_out, coord_3d_in, categoryappend) |
| Constructor for a grid_transform object, defining a particular vertical transformation.
|
|
subroutine | grid_transform_init (this, trans, in, out, maskgrid, maskbounds, categoryappend) |
| Constructor for a grid_transform object, defining a particular grid-to-grid transformation.
|
|
subroutine | grid_transform_grid_vol7d_init (this, trans, in, v7d_out, maskgrid, maskbounds, find_index, categoryappend) |
| Constructor for a grid_transform object, defining a particular grid-to-sparse points transformation.
|
|
subroutine | grid_transform_vol7d_grid_init (this, trans, v7d_in, out, categoryappend) |
| Constructor for a grid_transform object, defining a particular sparse points-to-grid transformation.
|
|
subroutine | grid_transform_vol7d_vol7d_init (this, trans, v7d_in, v7d_out, maskbounds, categoryappend) |
| Constructor for a grid_transform object, defining a particular sparse points-to-sparse points transformation.
|
|
subroutine | grid_transform_delete (this) |
| Destructor of grid_tranform object.
|
|
subroutine | grid_transform_get_val (this, output_level_auto, point_mask, point_index, output_point_index, levshift, levused) |
| Method for returning the contents of the object.
|
|
logical function | grid_transform_c_e (this) |
| Returns .TRUE.
|
|
recursive subroutine | grid_transform_compute (this, field_in, field_out, var, coord_3d_in) |
| Compute the output data array from input data array according to the defined transformation.
|
|
subroutine | grid_transform_v7d_grid_compute (this, field_in, field_out, var, coord_3d_in) |
| Compute the output data array from input data array according to the defined transformation.
|
|
Module for defining transformations between rectangular georeferenced grids and between grids and sparse points and vice-versa.
The module defines two classes: transform_def which describes an 'abstract' transformation between grids and/or sparse points, and grid_transform which includes a transform_def object and describes a transformation between specific grids and/or sets of sparse points, with precomputed coefficients specific to the grids/sparse points involved. A single transform_def object can be used for defining different grid_transform objects which apply the same transformation to different sets of grids/sparse points pairs. In the same manner, a single grid_transform object can be used for interpolating any number of fields lying on the same grids/sparse points pair, thus recycling the interpolation coefficients which are computed only once at the time of defining the grid_transform object.
This module performs tranformations at a relatively low-level, on 2d/3d sections of data, and it is meant primarily for use by higher level methods in volgrid6d_class, which operate on full volumes of physically determined quantities; however it is possible to use it in a stand-alone way as well.
Different abstract transformations are supported, defined by the parameter trans_type, and its corresponding sub_type:
- trans_type='zoom' a new grid is obtained by cutting or extending (with missing values) the input grid, adding or removing points on the four sides, without changing the geographical reference system (grid-to-grid)
- sub_type='coord' the corners of the zoomed/extended area are defined by geographical coordinates
- sub_type='coordbb' the bounds of the zoomed/extended area are computed so to contain all the input points which lie in the provided lon/lat bounding box
- sub_type='projcoord' the corners of the zoomed/extended area are defined by projected coordinates
- sub_type='index' the bounds of the zoomed/extended area are defined by grid indices.
- trans_type='boxregrid' regrids the input data grid on a new grid in which the value at every point is the result of a function computed over npx X npy points of the original grid, without changing the geographical reference system (grid-to-grid)
- sub_type='average' the function used is the average.
- sub_type='stddev' the function used is the standard deviation.
- sub_type='stddevnm1' the function used is the standard deviation computed with n-1.
- sub_type='max' the function used is the maximum
- sub_type='min' the function used is the minimum
- sub_type='percentile' the function used is a requested percentile of the input points distribution.
- trans_type='inter' interpolates the input data on a new set of specified points
- sub_type='near' the interpolated value is that of the nearest input point (grid-to-grid, grid-to-sparse point)
- sub_type='bilin' the interpolated value is computed as a bilinear interpolation of the 4 surrounding input points (grid-to-grid, grid-to-sparse point)
- sub_type='linear' the interpolated value is computed as a linear interpolation of the 3 surrounding input points individuated by means of a triangulation procedure (sparse points-to-grid, sparse points-to-sparse points).
- sub_type='shapiro_near' the interpolated value is that of sub_type=near after smoothing the input field with a shapiro filter of order 2.
- trans_type='boxinter' computes data on a new grid in which the value at every point is the result of a function computed over the input points lying inside the output point's grid box (grid-to-grid and sparse points-to-grid)
- sub_type='average' the function used is the average
- sub_type='stddev' the function used is the standard deviation
- sub_type='stddevnm1' the function used is the standard deviation computed with n-1
- sub_type='max' the function used is the maximum
- sub_type='min' the function used is the minimum
- sub_type='percentile' the function used is a requested percentile of the input points distribution
- sub_type='frequency' the function used is the fraction of points in the box having value included in a specified interval.
- trans_type='polyinter' output data are the result of a function computed over the input points lying inside a set of georeferenced polygons; polygons cannot overlap each other; for output on sparse points, the number of output points is equal to the number of polygons and output point coordinates are defined as the centroids of the polygons, for output on a grid, the output grid is equal to the input grid and the value of the field is repeated for all points within each polygon, while it is undefined outside all polygons (grid-to-grid, grid-to-sparse points and sparse points-to-sparse points)
- sub_type='average' the function used is the average
- sub_type='stddev' the function used is the standard deviation.
- sub_type='max' the function used is the maximum
- sub_type='min' the function used is the minimum
- sub_type='percentile' the function used is a requested percentile of the input points distribution.
- trans_type='stencilinter' computes data on a new set of specified points, for each of which the value is the result of a function computed over the input grid points forming a circular stencil centered on the nearest input grid point, with radius radius in input grid point units; stencils can overlap each other (grid-to-grid and grid-to-sparse points)
- sub_type='average' the function used is the average
- sub_type='stddev' the function used is the standard deviation.
- sub_type='stddevnm1' the function used is the standard deviation computed with n-1.
- sub_type='max' the function used is the maximum
- sub_type='min' the function used is the minimum
- sub_type='percentile' the function used is a requested percentile of the input points distribution.
- trans_type='maskinter' takes a 2D field on the same grid as the input points, it divides it in a number of subareas according to its values and and optional list of boundaries and every subarea is used as a mask for interpolation; data are thus computed on a new set of points, the number of which is equal to the number of subareas, and for each of which the value is the result of a function computed over those input points belonging to the corresponding subarea; the output point coordinates are defined as the centroids of the subareas (grid-to-sparse points)
- sub_type='average' the function used is the average
- sub_type='stddev' the function used is the standard deviation.
- sub_type='stddevnm1' the function used is the standard deviation computed with n-1.
- sub_type='max' the function used is the maximum
- sub_type='min' the function used is the minimum
- sub_type='percentile' the function used is a requested percentile of the input points distribution.
- trans_type='maskgen' generates a mask field, on the same grid as the input, suitable to be used for 'maskinter' interpolation (grid-to-grid)
- sub_type='poly' the output mask field contains, at each point, integer values from 1 to the number of polygons provided, computed according to the polygon in which every point lies
- sub_type='grid' the output mask field contains, at each point, integer values from 1 to the number of grid cells in the pseudo-output grid provided, depending on the index of the cell in which every point lies.
- trans_type='metamorphosis' the values of the output points are the same as the input ones, but something external in the data may change, e.g. only a subset of input data is kept in output or the underlying data structure changes, as from grid to sparse points (grid-to-grid, grid-to-sparse points, sparse points-to-sparse points)
- sub_type='all' all the input points are kept in the output (grid-to-sparse points)
- sub_type='coordbb' the input points which lie in the provided lon/lat bounding box are kept in the output (grid-to-sparse points or sparse points-to-sparse points).
- sub_type='poly' the input points which lie in any of the polygons provided are kept in the output; points are marked with the number of polygon they belong to (grid-to-sparse points or sparse points-to-sparse points).
- sub_type='mask' the input points which belong to any valid subarea defined by a mask field, as for trans_type='maskinter', are kept in the output; points are marked with the number of the subarea they belong to (grid-to-sparse points).
- sub_type='maskvalid' the input points corresponding to points having valid data and optionally having values within requested bounds in a 2-D mask field, are kept in the output; the other points are filled with missing values (grid-to-grid).
- sub_type='maskinvalid' the input points corresponding to points having non valid data in a 2-D mask field, are kept in the output; the other points are filled with missing values (grid-to-grid).
- sub_type='lemaskinvalid', 'ltmaskinvalid', 'gemaskinvalid', 'gtmaskinvalid' the input points having values <=, <, >=, > than values of a 2-D mask field respectively, are filled with missing values, the other points are kept as they are (grid-to-grid).
- sub_type='setinvalidto' the input points having non valid data are set to a user-specified constant value (grid-to-grid or sparse points-to-sparse points).
- sub_type='settoinvalid' the input points having values included in the requested bounds are set to an invalid value, the others are kept unchanged (grid-to-grid or sparse points-to-sparse points).