foresight_dgrid3d
foresight_dgrid3d, gnuplot's dgrid3d: scattered 3D data gridded for surfaces, pm3d and contours.
A port of gnuplot 6.0's grid_nongrid_data (plot3d.c): a grid of cols iso-curves of x, rows points along y each, over the bounding box of the defined points (the steps accumulated, as gnuplot's), each value a weighted mean of the points: inverse distance to the power q (qnorm q, a point on the node its value), a kernel of the distance scaled by dx, dy (gauss, cauchy, exp, box, hann; with kdensity the weighted sum, a density), or the thin plate splines through them (splines, gnuplot's LU solution).
Source: src/lib/foresight_dgrid3d.F90
Dependencies
Contents
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
DGRID_QNORM | integer(kind=I4P) | parameter | qnorm q (gnuplot's default, q 1). |
DGRID_SPLINES | integer(kind=I4P) | parameter | splines. |
DGRID_GAUSS | integer(kind=I4P) | parameter | gauss. |
DGRID_CAUCHY | integer(kind=I4P) | parameter | cauchy. |
DGRID_EXP | integer(kind=I4P) | parameter | exp. |
DGRID_BOX | integer(kind=I4P) | parameter | box. |
DGRID_HANN | integer(kind=I4P) | parameter | hann. |
Derived Types
dgrid3d_object
dgrid3d settings of a panel (gnuplot set dgrid3d).
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
on | logical | Data gridded. | |
rows | integer(kind=I4P) | Points along y of each iso-curve. | |
cols | integer(kind=I4P) | Iso-curves of x. | |
mode | integer(kind=I4P) | Weighting. | |
norm | integer(kind=I4P) | The q of qnorm. | |
scale | real(kind=R8P) | Kernel scales along x and y. | |
kdensity | logical | Weighted sums, not means (kdensity). |
Subroutines
dgrid3d_grid
The grid of the points (px, py, pz, colors pc) where defined: gx, gy, gz, gc (point along y, iso-curve of x), the curves in gnuplot's making order (x growing); ok false if no point is defined.
Attributes: pure
subroutine dgrid3d_grid(px, py, pz, pc, defined, settings, gx, gy, gz, gc, ok)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
px | real(kind=R8P) | in | Abscissae. | |
py | real(kind=R8P) | in | Ordinates. | |
pz | real(kind=R8P) | in | Heights. | |
pc | real(kind=R8P) | in | Color values. | |
defined | logical | in | Points defined. | |
settings | type(dgrid3d_object) | in | Settings. | |
gx | real(kind=R8P) | out | allocatable | Grid abscissae. |
gy | real(kind=R8P) | out | allocatable | Grid ordinates. |
gz | real(kind=R8P) | out | allocatable | Grid heights. |
gc | real(kind=R8P) | out | allocatable | Grid color values. |
ok | logical | out | Gridded. |
Call graph
thin_plate_splines
gnuplot's thin_plate_splines_setup: the coefficients b of the thin plate splines through the points (n weights, then the affine part), the system solved by gnuplot's LU decomposition.
Attributes: pure
subroutine thin_plate_splines(xx, yy, zz, b)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
xx | real(kind=R8P) | in | Points. | |
yy | real(kind=R8P) | in | Points. | |
zz | real(kind=R8P) | in | Points. | |
b | real(kind=R8P) | out | allocatable | Coefficients (n + 3). |
Call graph
lu_decomp
gnuplot's lu_decomp (Crout with implicit pivoting, matrix.c): a overwritten by its LU decomposition, indx the row permutation.
Attributes: pure
subroutine lu_decomp(a, indx)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
a | real(kind=R8P) | inout | Matrix (row, column). | |
indx | integer(kind=I4P) | out | Pivot rows. |
Call graph
lu_backsubst
gnuplot's lu_backsubst: b overwritten by the solution of the decomposed system.
Attributes: pure
subroutine lu_backsubst(a, indx, b)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
a | real(kind=R8P) | in | Decomposed matrix. | |
indx | integer(kind=I4P) | in | Pivot rows. | |
b | real(kind=R8P) | inout | Right side, solution. |
Call graph
grid_series
The points of a 3D series replaced by their grid (foresight_dgrid3d, gnuplot's set dgrid3d): its iso-curves of x as its scans (gnuplot keeps them last first), its color values (palette z) gridded with its heights; the per point colors, sizes and texts dropped.
subroutine grid_series(series, settings)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
series | type(series_object) | inout | Series. | |
settings | type(dgrid3d_object) | in | Gridding. |
Call graph
Functions
kernel
gnuplot's splines_kernel: h^2 log h.
Attributes: pure
Returns: real(kind=R8P)
function kernel(h) result(k)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
h | real(kind=R8P) | in | Distance. |
Call graph
pythag
gnuplot's pythag (Numerical Recipes): the length of (dx, dy) without overflow.
Attributes: pure
Returns: real(kind=R8P)
function pythag(dx, dy) result(d)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
dx | real(kind=R8P) | in | Components. | |
dy | real(kind=R8P) | in | Components. |
Call graph
qnorm
gnuplot's qnorm: the distance (q 1), its square (q 2), its q-th power.
Attributes: pure
Returns: real(kind=R8P)
function qnorm(dist_x, dist_y, q) result(dist)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
dist_x | real(kind=R8P) | in | Components. | |
dist_y | real(kind=R8P) | in | Components. | |
q | integer(kind=I4P) | in | Power. |
Call graph