Functions

Functions

bool completer (REAL D1=1, REAL D2=2, REAL alpha=0, REAL w=1)
 
bool completer_add (REAL weight=1, REAL D1=1, REAL D2=2, REAL alpha=0, REAL w=1)
 
bool value (const char *val="undef")
 
bool value_add (REAL weight=1, REAL val=0)
 
bool mean (REAL value, REAL penalty_factor=-2)
 
boolvec * wmean (REAL value, const char *surface_name="*", REAL penalty_factor=-2)
 
bool leq (REAL value, REAL penalty_factor=0)
 
bool geq (REAL value, REAL penalty_factor=0)
 
boolvec * hist (const char *histogram_name="*", REAL penalty_factor=-1, size_t treshold=5)
 

Detailed Description

Function Documentation

bool surfit::completer ( REAL  D1 = 1,
REAL  D2 = 2,
REAL  alpha = 0,
REAL  w = 1 
)
Tcl syntax:
completer D1 D2
Description:
This rule describes the resulting surface behavior in the areas of low data density. This rule applies to whole resulting surface. Here is simple example of "completer" D1 and D2 variables influence:
surface_and_points.jpg
completer 0 1
surface_and_points2.jpg
completer 1 5
surface_and_points3.jpg
completer 1 0
Parameters
D1weight coefficient for rule that the resulting surface should tend to constant surface
D2weight coefficient for rule that the resulting surface should tend to plane surface
alphaanisotropy angle (degrees)
wanisotropy factor
Math:
This command adds the following functional to the functional sequence:

\[ \Phi(u_{1,1},\ldots,u_{N,M}) = D_1 \Phi_1(u_{1,1},\ldots,u_{N,M}) + D_2 \Phi_2(u_{1,1},\ldots,u_{N,M}), \]

where

\[ \Phi_1(u_{1,1},\ldots,u_{N,M}) = \left[ \sum\limits_{j=0}^{M-1} \sum\limits_{i=0}^{N-2} \left( \frac{ u_{i+1,j} - u_{i,j} } { h_x } \right)^2 + \sum\limits_{i=0}^{N-1} \sum\limits_{j=0}^{M-2} \left( \frac{ u_{i,j+1} - u_{i,j} } { h_y } \right)^2 \right] \]

\[ \Phi_2 = \left[ \sum\limits_{j=0}^{M-1} \sum\limits_{i=0}^{N-3} \left( \frac{ u_{i+2,j} - 2u_{i+1,j} + u_{i,j} } {h_x^2} \right)^2 + \right. \]

\[ 2\sum\limits_{j=0}^{M-2} \sum\limits_{i=0}^{N-2} \left( \frac{ (u_{i+1,j+1} - u_{i,j+1}) - (u_{i+1,j} - u_{i,j}) } { h_x h_y } \right)^2 + \]

\[ \left. \sum\limits_{i=0}^{N-1} \sum\limits_{j=0}^{M-3} \left( \frac{ u_{i,j+2} - 2u_{i,j+1} + u_{i,j} } { h_y^2 } \right)^2 \right]. \]

bool surfit::completer_add ( REAL  weight = 1,
REAL  D1 = 1,
REAL  D2 = 2,
REAL  alpha = 0,
REAL  w = 1 
)
Tcl syntax:
completer_add weight D1 D2
Description:
This function modifies previous (modifiable) rule by adding the completer rule with some weight. This rule applies to whole resulting surface.
Parameters
weightinformational weight for this rule
D1weight coefficient for rule that the resulting surface should tend to constant surface
D2weight coefficient for rule that the resulting surface should tend to plane surface
alphaanisotropy angle (degrees)
wanisotropy factor
bool surfit::geq ( REAL  value,
REAL  penalty_factor = 0 
)
Tcl syntax:
geq value penalty_factor
Description:
This rule adds the surface condition - "the resulting surface should be greater than or equal to value".
Parameters
valueresulting surface values should be lower than or equal to this real number
penalty_factorparameter for penalty algorithm
Math:
This command adds the condition:

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

where (i,j) - indices of the cells, z - constant value
boolvec* surfit::hist ( const char *  histogram_name = "*",
REAL  penalty_factor = -1,
size_t  treshold = 5 
)
Tcl syntax:
hist "histogram_name" penalty_factor threshold
Description:
This rule adds the surface condition - "the resulting surface histogram should be equal to given histogram".
Parameters
histogram_namedesired histogram
penalty_factorparameter for penalty algorithm
tresholdanother parameter for changing if something going wrong :)
Math:
This command adds the condition:

\[ u_{i,j} = histeq( u_{i,j} ), \]

where histeq is the histogram equalization algorithm described in the book R. Gonzalez and R. Woods Digital Image Processing, Addison-Wesley Publishing Company, 1992, Chap. 4.
bool surfit::leq ( REAL  value,
REAL  penalty_factor = 0 
)
Tcl syntax:
leq value penalty_factor
Description:
This rule adds the surface condition - "the resulting surface should be lower than or equal to value".
Parameters
valueresulting surface values should be lower than or equal to this real number
penalty_factorparameter for penalty algorithm
Math:
This command adds the condition:

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

where (i,j) - indices of the cells, z - constant value
bool surfit::mean ( REAL  value,
REAL  penalty_factor = -2 
)
Tcl syntax:
mean value penalty_factor
Description:
This rule adds the surface condition - "the resulting surface mean value should be equal to real number".
Math:
This command adds the condition:

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

where (i,j) - indices of the cells, Q - total number of cells, m - desired mean value
bool surfit::value ( const char *  val = "undef")
Tcl syntax:
value val
Descrpition:
Using this rule the resulting surface approximates constant value. This rule applies to whole resulting surface.
Parameters
valreal number for surface approximation. Also you may set val to "undef" string to fill surface with undef_value values.
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, \]

bool surfit::value_add ( REAL  weight = 1,
REAL  val = 0 
)
Tcl syntax:
value_add weight val
Description:
This function modifies previous (modifiable) rule by adding the value rule with some weight. This rule applies to whole resulting surface.
Parameters
weightinformational weight for this rule
valreal number for surface approximation
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 \right)^2, \]

boolvec* surfit::wmean ( REAL  value,
const char *  surface_name = "*",
REAL  penalty_factor = -2 
)
Tcl syntax:
wmean value "surface_name" penalty_factor
Description:
This rule adds the surface condition - "the resulting surface weighted mean value should be equal to real number".
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, $z(x_i,y_j)$ - weighted surface value for the (i,j) cell, m - desired weighted mean value



surfit: gridding and contouring software.