gridding rules for surfaces
[surfit gridding rules]


Functions

bool surfit::trend_add (REAL weight, REAL D1=1, REAL D2=0, const char *surface_name_or_position="0")
bool surfit::surface (const char *surface_name_or_position="0")
bool surfit::surface_add (REAL weight, const char *surface_name_or_position="0")
bool surfit::surface_leq (const char *surface_name_or_position="0", REAL mult=0.001)
bool surfit::surface_geq (const char *surface_name_or_position="0", REAL mult=0.001)
bool surfit::trend (REAL D1=1, REAL D2=2, const char *surface_name_or_position="0")

Function Documentation

bool surface const char *  surface_name_or_position = "0"  ) 
 

Tcl syntax:
surface "surface_name_or_position"
Description:
Using this rule the resulting surface approximates other surface in least squares meaning.
Parameters:
surface_name_or_position name of surface dataset, or surface position number
Math:
This command adds the following functional to the functional sequence:

\[ \Phi(u_{1,1},\ldots,u_{N,M}) = \sum_{i,j} \left( u_{i,j} - z(x_i, y_j) \right)^2, \]

where (i,j) - indices of the cells, $z(x_i, y_j)$ - surface value for the (i,j) cell.

Examples:
canyon_trend.tcl, mask.tcl, mask_add.tcl, mask_ineq.tcl, and surface.tcl.

bool surface_add REAL  weight,
const char *  surface_name_or_position = "0"
 

Tcl syntax:
surface_add weight "surface_name_or_position"
Description:
This function modifies previous (modifiable) rule by adding the surface rule with some weight.
Parameters:
weight informational weight for this rule
surface_name_or_position name of surface dataset, or surface position number
Math:
This command modifies previous functional $ \Phi_0 $ by adding $ \Phi_1 $:

\[ \Phi(u_{1,1},\ldots,u_{N,M}) = \Phi_0(u_{1,1},\ldots,u_{N,M}) + w\Phi_1(u_{1,1},\ldots,u_{N,M}), \]

where $ w $ - informational weight,

\[ \Phi_1(u_{1,1},\ldots,u_{N,M}) = \sum_{i,j} \left( u_{i,j} - z(x_i, y_j) \right)^2, \]

where (i,j) - indices of the cells, $z(x_i, y_j)$ - surface value for the (i,j) cell.

Examples:
surface_add.tcl.

bool surface_geq const char *  surface_name_or_position = "0",
REAL  mult = 0.001
 

Tcl syntax:
surface_geq "surface_name_or_position" mult
Description:
This rule adds the surface condition - "the surface should be greater than equal to other surface". In case of the penalty algorithm algorithm bad convergence or unexpected (wrong) result, you should carefully review your conditions and if they are correct, try to change "mult" parameter
Parameters:
surface_name_or_position name of surface dataset, or surface position number
mult multiplier parameter for penalty algorithm algorithm
Math:
This command adds the condition:

\[ u_{i,j} \geq z(x_i, y_j) \quad i=1,\ldots,N, \quad j=1,\ldots,M \]

where (i,j) - indices of the cells, $z(x_i, y_j)$ - surface value for the (i,j) cell.

Examples:
surface_ineq.tcl.

bool surface_leq const char *  surface_name_or_position = "0",
REAL  mult = 0.001
 

Tcl syntax:
surface_leq "surface_name_or_position" mult
Description:
This rule adds the surface condition - "the surface should be lower than equal to other surface". In case of the penalty algorithm algorithm bad convergence or unexpected (wrong) result, you should carefully review your conditions and if they are correct, try to change "mult" parameter
Parameters:
surface_name_or_position name of surface dataset, or surface position number
mult multiplier parameter for penalty algorithm algorithm
Math:
This command adds the condition:

\[ u_{i,j} \leq z(x_i, y_j) \quad i=1,\ldots,N, \quad j=1,\ldots,M \]

where (i,j) - indices of the cells, $z(x_i, y_j)$ - surface value for the (i,j) cell.

bool trend REAL  D1 = 1,
REAL  D2 = 2,
const char *  surface_name_or_position = "0"
 

Tcl syntax:
trend D1 D2 "surface_name_or_position"
Description:
This rule determines resulting surface behaviour in regions out low information density. This rule tells, that in these regions resulting surface should be similar to other surface (which is called trend).
Parameters:
D1 informational weight for rule that sounds "resulting surface should have the same gradients as trend surface"
D2 informational weight for rule that sounds "resulting surface should have the same curvature as trend surface"
surface_name_or_position name of surface dataset, or surface position number. This is a trend surface.
Math:
This command adds the following functional to the functional sequence:

\[ \Phi(u_{1,1},\ldots,u_{N,M}) = \mathbf{D_1} \frac{h_y}{h_x} \left[ \left( \left( u_{i+1,j}-u_{i,j} \right) - \left( t(x_{i+1,},y_j)-t(x_i,y_j) \right) \right)^2 + \left( (u_{i,j} - u_{i-1,j})-(t(x_i,y_j) - t(x_{i-1},y_j)) \right)^2 \right] + \]

\[ \mathbf{D_1} \frac{h_x}{h_y} \left[ \left( \left( u_{i,j+1}-u_{i,j} \right) - \left( t(x_i,y_{j+1})-t(x_i,y_j) \right) \right)^2 + \left( \left( u_{i,j-1} - u_{i,j} \right) - \left( t(x_i,y_{j-1}) - t(x_i,y_j) \right) \right)^2 \right] + \]

\[ + \mathbf{D_2} \frac{h_y^2}{h_x^2} \left[ \left( (u_{i+2,j} - 2u_{i+1,j} + u_{i,j}) - (t(x_{i+2},y_j) - 2t(x_{i+1},y_j) + t(x_i,y_j)) \right)^2 + \right. \]

\[ \left( (u_{i+1,j} - 2u_{i,j} + u_{i-1,j}) - (t(x_{i+1},y_j) - 2t(x_i,y_j) + t(x_{i-1},y_j)) \right)^2 + \]

\[ \left. \left( (u_{i,j} - 2u_{i-1,j} + u_{i-2,j}) - (t(x_i,y_j) - 2t(x_{i-1},y_j) + t(x_{i-2},y_j)) \right)^2 \right] + \]

\[ + 2 \mathbf{D_2} \left( \left[ \left( (u_{i+1,j+1} - u_{i,j+1} - u_{i+1,j} + u_{i,j}) - (t(x_{i+1},y_{j+1}) - t(x_i,y_{j+1}) - t(x_{i+1},y_j) + t(x_i,y_j) ) \right) \right] + \right. \]

\[ \left. \left[ \left( (u_{i,j+1} - u_{i-1,j+1} - u_{i,j} + u_{i-1,j}) - (t(x_i,y_{j+1}) - t(x_{i-1},y_{j+1}) - t(x_i,y_j) + t(x_{i-1},y_j)) \right) \right] \right) + \]

\[ + \mathbf{D_2} \frac{h_x^2}{h_y^2} \left[ \left( (u_{i,j+2} - 2u_{i,j+1} + u_{i,j}) - (t(x_i,y_{j+2}) - 2t(x_i,y_{j+1}) + t(x_i,y_j)) \right)^2 + \right. \]

\[ \left( (u_{i,j+1} - 2u_{i,j} + u_{i,j-1}) - (t(x_i,y_{j+1}) - 2t(x_i,y_j) + t(x_i,y_{j-1})) \right)^2 + \]

\[ \left. \left( (u_{i,j} - 2u_{i,j-1} + u_{i,j-2}) - (t(x_i,y_j) - 2t(x_i,y_{j-1}) + t(x_i,y_{j-2})) \right)^2 \right] + \]

\[ + 2 \mathbf{D_2} \left( \left[ \left( (u_{i+1,j+1} - u_{i+1,j} - u_{i,j+1} + u_{i,j}) - (t(x_{i+1},y_{j+1}) - t(x_{i+1},y_j) - t(x_i,y_{j+1}) + t(x_i,y_j)) \right) \right] + \right. \]

\[ \left. \left[ \left( (u_{i+1,j} - u_{i+1,j-1} - u_{i,j} + u_{i,j-1}) - (t(x_{i+1},y_j) - t(x_{i+1},y_{j-1}) - t(x_i,y_j) + t(x_i,y_{j-1})) \right) \right] \right) = \min. \]

Examples:
canyon_map.tcl, and trend.tcl.

bool surfit::trend_add REAL  weight,
REAL  D1 = 1,
REAL  D2 = 0,
const char *  surface_name_or_position = "0"
 

bool trend_add(REAL weight, REAL D1 = 1, REAL D2 = 2, const char * surface_name_or_position = "0");

Tcl syntax:
trend_add weight D1 D2 "surface_name_or_position"
Description:
This function modifies previous (modifiable) rule by adding the trend rule with some weight.
Parameters:
weight informational weight for trend rule
D1 informational weight for rule that sounds "resulting surface should have the same gradients as trend surface"
D2 informational weight for rule that sounds "resulting surface should have the same curvature as trend surface"
surface_name_or_position name of surface dataset, or surface position number. This is a trend surface.



surfit: open source gridding and contouring software.