gridding rules for masks
[surfit gridding rules]


Functions

bool surfit::mask (const char *val, const char *mask_name_or_position="0")
bool surfit::mask_add (REAL val, REAL weight=1, const char *mask_name_or_position="0")
bool surfit::mask_leq (REAL value, const char *mask_name_or_position="0", REAL mult=0.001)
bool surfit::mask_geq (REAL value, const char *mask_name_or_position="0", REAL mult=0.001)
bool surfit::mask_surf (const char *surf_name_or_position="0", const char *mask_name_or_position="0")
bool surfit::mask_surf_add (const char *surf_name_or_position="0", REAL weight=1, const char *mask_name_or_position="0")
bool surfit::mask_surf_leq (const char *surf_name_or_position="0", const char *mask_name_or_position="0", REAL mult=0.001)
bool surfit::mask_surf_geq (const char *surf_name_or_position="0", const char *mask_name_or_position="0", REAL mult=0.001)
bool surfit::mask_mean (REAL mean, const char *mask_name_or_position="0", REAL mult=0.001)
bool surfit::mask_wmean (REAL mean, const char *mask_name_or_position="0", const char *surf_name_or_position="0", REAL mult=0.001)
bool surfit::mask_completer (const char *mask_name_or_position="0", REAL D1=1, REAL D2=2, REAL alpha=0, REAL w=1)
bool surfit::mask_completer_add (REAL weight=1, const char *mask_name_or_position="0", REAL D1=1, REAL D2=2, REAL alpha=0, REAL w=1)

Function Documentation

bool mask const char *  val,
const char *  mask_name_or_position = "0"
 

Tcl syntax:
mask val "surface_name_or_position"
Description:
Using this rule the resulting surface approximates cells where mask is true with constant real number. In case val is equal to word "undef", resulting surface would have "undefined values" for cells where mask is true.
Parameters:
val real number or word "undef" for approximation.
mask_name_or_position name of mask dataset, or mask 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 \right)^2, \]

where (i,j) - indices of the cells where mask is true, z - constant real number.

Examples:
mask.tcl.

bool mask_add REAL  val,
REAL  weight = 1,
const char *  mask_name_or_position = "0"
 

Tcl syntax:
mask_add val weight "surface_name_or_position"
Description:
This function modifies previous (modifiable) rule by adding the mask rule with some weight.
Parameters:
val real number for approximation.
weight informational weight for mask rule
mask_name_or_position name of mask dataset, or mask position number
Examples:
mask_add.tcl.

bool mask_completer const char *  mask_name_or_position = "0",
REAL  D1 = 1,
REAL  D2 = 2,
REAL  alpha = 0,
REAL  w = 1
 

Tcl syntax:
mask_completer "mask_name_or_position" D1 D2 alpha w
Description
This rule implements completer rule where mask is true
Parameters:
D1 weight coefficient for rule that the resulting surface should tend to constant surface
D2 weight coefficient for rule that the resulting surface should tend to plane surface
alpha anisotropy angle (degrees)
w anisotropy factor
Examples:
mask_completer.tcl.

bool mask_completer_add REAL  weight = 1,
const char *  mask_name_or_position = "0",
REAL  D1 = 1,
REAL  D2 = 2,
REAL  alpha = 0,
REAL  w = 1
 

Tcl syntax:
mask_completer_add weight "mask_name_or_position" D1 D2 alpha w inside
Description
This rule adds rule mask_completer with informational "weight" to the previous rule.
Parameters:
D1 weight coefficient for rule that the resulting surface should tend to constant surface
D2 weight coefficient for rule that the resulting surface should tend to plane surface
alpha anisotropy angle (degrees)
w anisotropy factor

bool mask_geq REAL  value,
const char *  mask_name_or_position = "0",
REAL  mult = 0.001
 

Tcl syntax:
mask_geq value "mask_name_or_position" mult
Description:
This rule adds the surface condition - "the resulting surface should be greater than or equal to value where mask is true". 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:
value resulting surface values should be greater than or equal to this real number
mask_name_or_position name of mask dataset, or mask position number.
mult multiplier parameter for penalty algorithm algorithm
Math:
This command adds the condition:

\[ u_{i,j} \geq z, \]

where (i,j) - indices of the cells where mask is true, z - constant value

See also:
mask_leq area_leq area_geq
Examples:
mask_ineq.tcl.

bool mask_leq REAL  value,
const char *  mask_name_or_position = "0",
REAL  mult = 0.001
 

Tcl syntax:
mask_leq value "mask_name_or_position" mult
Description:
This rule adds the surface condition - "the resulting surface should be lower than or equal to value where mask is true". 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:
value resulting surface values should be lower than or equal to this real number
mask_name_or_position name of mask dataset, or mask position number.
mult multiplier parameter for penalty algorithm algorithm
Math:
This command adds the condition:

\[ u_{i,j} \leq z, \]

where (i,j) - indices of the cells where mask is true, z - constant value

bool mask_mean REAL  mean,
const char *  mask_name_or_position = "0",
REAL  mult = 0.001
 

Tcl syntax:
mask_mean mean_value "mask_name_or_position" mult
Description:
This rule adds the surface condition - "the resulting surface mean value should be equal to real number where mask is true". 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.
Math:
This command adds the condition:

\[ \frac {\sum\limits_{i,j} u_{i,j}} {Q} = m \]

where (i,j) - indices of the cells where mask is true, Q - number of cells in mask, m - desired mean value

Examples:
mask_mean.tcl.

bool mask_surf const char *  surf_name_or_position = "0",
const char *  mask_name_or_position = "0"
 

Tcl syntax:
mask_surf "surf_name_or_position" mult
Description:
Using this rule the resulting surface approximates values taken from the other surface in least squares meaning where mask is "true".
Parameters:
surf_name_or_position name of surface, or surface position number.
mask_name_or_position name of mask dataset, or mask position number.
Math:
This command adds the following functional to the functional sequence:

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

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

Examples:
mask_surf.tcl.

bool mask_surf_add const char *  surf_name_or_position = "0",
REAL  weight = 1,
const char *  mask_name_or_position = "0"
 

Tcl syntax:
mask_surf_add "surf_name_or_position" weight "mask_name_or_position"
Description:
This function modifies previous (modifiable) rule by adding the mask_surf rule with some weight. Using this rule the resulting surface approximates other surface "values" where mask is "true", taking into account a previous (modifiable) rule.
Parameters:
surf_name_or_position name of surface, or surface position number.
weight informational weight for this rule
mask_name_or_position name of mask dataset, or mask 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_{p=1}^P \left( u_{i,j} - z(x_i, y_j) \right)^2, \]

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

Examples:
mask_surf_add.tcl.

bool mask_surf_geq const char *  surf_name_or_position = "0",
const char *  mask_name_or_position = "0",
REAL  mult = 0.001
 

Tcl syntax:
mask_surf_geq "surf_name_or_position_or_position" "mask_name_or_position" mult
Description:
This rule adds the surface condition - "the resulting surface should be greater than or equal to other surface values where mask is true". 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.
Math:
This command adds the condition:

\[ u_{i,j} \geq f(x_{u_i},y_{u_j}) \]

where (i,j) - indices of the cells where mask is true, $f(x_{u_i},y_{u_j})$ - surface value in the center of the cell.

bool mask_surf_leq const char *  surf_name_or_position = "0",
const char *  mask_name_or_position = "0",
REAL  mult = 0.001
 

Tcl syntax:
mask_surf_leq "surf_name_or_position_or_position" "mask_name_or_position" mult
Description:
This rule adds the surface condition - "the resulting surface should be lower than or equal to other surface values where mask is true". 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.
Math:
This command adds the condition:

\[ u_{i,j} \leq f(x_{u_i},y_{u_j}) \]

where (i,j) - indices of the cells where mask is true, $f(x_{u_i},y_{u_j})$ - surface value in the center of the cell.

Examples:
mask_surf_ineq.tcl.

bool mask_wmean REAL  mean,
const char *  mask_name_or_position = "0",
const char *  surf_name_or_position = "0",
REAL  mult = 0.001
 

Tcl syntax:
mask_wmean weighted_mean_value "mask_name_or_position" "surf_name_or_position_or_position" mult
Description:
This rule adds the surface condition - "the resulting surface weighted mean value should be equal to real number where mask is true". 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.
Math:
This command adds the condition:

\[ \frac {\sum\limits_{i,j} z(x_i,y_j) u_{i,j}} {z(x_i,y_j)} = m \]

where (i,j) - indices of the cells where mask is true, $z(x_i,y_j)$ - weighted surface value for the (i,j) cell, m - desired weighted mean value

Examples:
mask_wmean.tcl.



surfit: open source gridding and contouring software.