DVscat_to_unif


Synopsis

interpolate scattered data into a uniform mesh


group DVscat_to_unif {
Mesh+Node_Data+Iparam &in { /* input field */
nnodes+req;
xform+nonotify;
};
int+Iparam rndim;
int+Iparam rdims[rndim];
float+Iparam min_xyz[rndim] => in.coordinates.min_vec[0:rndim-1];
float+Iparam max_xyz[rndim] => in.coordinates.max_vec[0:rndim-1];
float+Iparam search_cube[rndim] => 3*(max_xyz-min_xyz)/rdims;
int+Iparam interp_order = 2;
float+notify+IPort2 null_value => in.node_data[0].max+1;
Mesh_Unif+Node_Data+Oparam out { /* output field */
ndim => rndim;
dims => rdims;
nspace => rndim;
};
method+notify_val+notify_inst upd_scat_to_unif = "scat_to_unif";
} ;

Description

DVscat_to_unif converts a field with a scattered grid into a field with a uniform mesh. A "scattered grid" means that there is a mesh made up of disconnected nodes in space. An example would be seismic data where the coordinates are the latitude, longitude, (and perhaps elevation) of a sensing station, and the Node_Data was a set of observations. The grid is "scattered" because the data points are located at arbitrary points in space, not on any grid.

DVscat_to_unif lets you define a uniform mesh of any dimensionality and coordinate extents. It superimposes the input grid over this new grid that you have defined. Then, for each new node, it searches the input grid's neighboring original nodes (where search_cube controls the depth of the search) and creates data values for all the nodes in the new grid from interpolations on those neighboring actual data values. You can control the order of interpolation and what number to use as the NULL data value should the search around a node fail to find any data in the original input.

Input

&in

The input is a reference to a field with any mesh and Node_Data.

rndim

An integer. Sets the dimensionality of the uniform grid to 1, 2, or 3D.

rdims[rndim]

An integer array, rndim long. Sets the dimensions of the uniform grid. As this is a uniform grid, numbering always starts at 0. rdim specifies the upper dimension. For example rdim[0] = 100 means the X dimension is 100. rdim[1] = 50 means the Y dimension is 50, etc.

min_xyz[rndim]
max_xyz[rndim]

A float array, rndim long that sets the coordinate extents of the uniform grid (where the grid is located in space) for each dimension. They are initially set to the extents of the input Mesh.

search_cube[rndim]

A float array, rndim long that controls the depth of the search for nodes in the input mesh. The result of the default formula is 3 cells.

interp_order

An integer that controls the order of interpolation done on the adjacent nodes.

null_value

A float that specifies a null value to put in the output Node_Data for each node in the uniform grid that failed to find any input data within search_cube cells of the node. By default, it is set to one above the input's maximum.

Output

out

The output is a new Mesh_Unif with the dimensions specified by rndim and rdims, and a new Node_Data that has the interpolated values of each node, including null data values.

Algorithm

DVscat_to_unif uses a proprietary version of the Delauney tesselation algorithm.

Files

v/dv.v
modules/scat2unif.c

Utility DVM macros

DVMscat_2_unif_param, Scat2Unif

Example

Libraries.Main.Mappers.scat_to_unif

See also