• No results found

Function Definition

In document Spatial Modeler (Page 55-72)

Function Definition

This dialog lets you compose afunction definition using the appropriate input objects and available Spatial Modeler functions. The result is an expression that will define your output.

This dialog is opened when you double-click afunction graphic that has been placed on the Model Maker page or when you select Edit | Properties from the Model Maker menu bar with a function graphic selected.

Available Inputs:

Allobjects that areconnected as inputs to this function will be listed.

Each layer of any raster layersets will be listed separately, as well as the name of the entire layerset.

Click on any input in this list to add it to the function definition that is opened at the bottom of the dialog.

If <none defined> is opened, then no inputs have been defined for this function definition.

(calculator)

Click numeric values and operators as needed in the function definition.

Items selected will be inserted in the function definition area at the bottom of the dialog.

Functions:

Click on the popup list button to select a function category. The functions in that category will then appear in the scrolling list. Select a function from the scrolling list, and it will appear in the function definition, below.

Anyprototype arguments that are needed for the selected function appear in < > brackets.

Be sure to replace these with input objects or values.

Each function is described briefly below. These functions are described in detail in the On-LineSpatial Modeler Language Manual.

Analysis

Includes convolution filtering, histogram matching, contrast stretch, principal components, and more.

CLUMP Clump - Contiguity Analysis: performs a contiguity analysis on<raster>, a single layerRASTER.

Function Definition

COVARIANCE Covariance Matrix: returns the covariance matrix of<raster>.

DELROWS Delete Rows from Sieved Descriptor Column: outputs a table where the rows corresponding to the “sieved” values have been deleted.

DIRECT LOOKUP Map Integer Values Through Lookup Table: maps integer values in<arg1> through the lookup table<table>.

EIGENMATRIX Compute Matrix of Eigenvectors: outputs the matrix of eigenvectors derived from the input matrix.

EIGENVALUES Compute Table of Eigenvalues: outputs the eigenvalues of the matrix returned as a table.

HISTMATCH Histogram Matching: determines a lookup table that will convert the histogram of one object to resemble the histogram of another object.

HISTOEQ Histogram Equalization: computes a histogram equalization of<raster>

using<bincount> bins.

HISTOGRAM Histogram: returns the histogram of<arg1>.

LINEARCOMB Linear Combination: computes the linear combination of<raster>

using<arg2> as a transformation matrix.

LOOKUP Map Input Values Through Lookup Table Using Bin Function: if<table>

has an associated bin function, the values in<arg1> will be converted to bin numbers, then the bin number will be used as an index into the lookup table<table>.

PRINCIPAL COMPONENTS Principal Components: computes the first<count>

principal components of<raster>.

RASTERMATCH Raster Matching: maps<raster1> through a lookup table so that the histogram of each layer of the returnedRASTER will have approximately the same shape as the histogram of the corresponding layer of<raster2>.

SIEVETABLE Get Sieve Lookup Table: produces a lookup table which can be used to filter out small clumps from a layer which is the output ofCLUMP.

STRETCH Stretch: performs a linear scale and shift on the input<raster>.

Arithmetic

Perform basic arithmetic functions including addition, subtraction, multiplication, division, factorial, and modulus.

+ (Addition): adds<arg1> and<arg2>.

- (Subtraction): subtracts<arg2> from<arg1>.

Function Definition

- (Negation): negative of<arg1>.

* (Multiplication): multiplies<arg1> by<arg2>.

/ (Division): divides<arg1> by <arg2>.

MOD Modulus: returns the remainder (modulus) when<arg1> is divided by

<arg2>.

! (Factorial): computes<arg1> factorial.

Bitwise

Use bitwise and, or, exclusive or, and not.

& (Bitwise And): computes the bitwise and of<arg1> and<arg2>.

| (Bitwise Or): computes the bitwise or of<arg1> and<arg2>.

^ (Bitwise Exclusive Or): computes the bitwise exclusive or of<arg1> and

<arg2>.

~ (Bitwise Not): reverses the bits of<arg1>.

Boolean

Perform logical functions including and, or, and not.

AND Logical And: true if<arg1> and<arg2> are both non-zero, false otherwise.

&& (Logical And): true if<arg1> and<arg2> are both non-zero, false otherwise.

OR Logical Or: true if either<arg1> or<arg2> is non-zero, false otherwise.

|| (Logical Or): true if either<arg1> or<arg2> is non-zero, false otherwise.

NOT Logical Not: true if<arg1> is zero, false otherwise.

Color

Manipulate colors to and from RGB and IHS.

COLOR Create Color Scalar: converts either the color name string constant in

<colorname>, or the red, green, and blue values input into aCOLOR SCALAR.

HUE Get Hue from RGB: computes hue from red, green, and blue values.

Function Definition

IHSTORGB Get Red, Green, and Blue from Intensity, Hue, and Saturation: computes red, green, and blue from intensity, hue, and saturation values contained in<ihs>.

INTENS Get Intensity from RGB: computes intensity from red, green, and blue values.

RGBTOIHS Get Intensity, Hue, and Saturation from Red, Green, and Blue: computes intensity, hue, and saturation from red, green, and blue values contained in<rgb>.

SATUR Get Saturation from RGB: computes saturation from red, green, and blue values.

STACK Convert FLOAT TABLE to COLOR TABLE: converts the RGB values from a float table to a color scalar.

UNSTACK Convert COLOR SCALAR to FLOAT TABLE: outputs aFLOAT TABLE with 3 rows.

Conditional

Run logical tests using conditional statements and either...if...or...otherwise.

CONDITIONAL Conditional:<test1> is converted toBINARY. If true,<arg1> is returned. Otherwise,<test2> is converted toBINARY. If true,<arg2> is returned, etc.

EITHER... IF... OR... OTHERWISE Select on Binary Test: <test> is converted to BINARY. If true,<arg1> is returned. Otherwise,<arg2> is returned.

INDEX Index - Find Matching Item on List: if<test> equals<arg1>, 1 is returned.

If<test> equals<arg2>, 2 is returned, etc. If<test> is not equal to any of the arguments on the right, 0 is returned.

PICK Pick - Get nth Item on List: if<number> is 1,<arg1> is returned. If<number>

is 2,<arg2> is returned, etc.

Data Generation

Create raster layers from map coordinates, column numbers, or row numbers. Create a matrix or table from a list of scalars.

MAPX Create Raster Containing X Map Coordinates: returns a raster in which each pixel contains the x map coordinate corresponding to its position.

MAPY Create Raster Containing Y Map Coordinates: returns a raster in which each pixel contains the y map coordinate corresponding to its position.

MATRIX Create Matrix from List of Scalars: returns a matrix<rows> rows by

<columns> columns containing the scalar arguments in the order listed across successive rows.

Function Definition

MATRIX Read Matrix from Kernel Library: returns a matrix read from a kernel library.

MATRIX SERIES Create Matrix Containing 2-D Series: returns a matrix having

<rows> rows and<columns> columns.

PI Pi: returns the value of pi (3.14159...).

PIXELX Create Raster Containing Column Number: returns a raster in which each pixel contains its column position in the Working Window.

PIXELY Create Raster Containing Row Number: returns a raster in which each pixel contains its row position in the Working Window.

STACKLAYERS Stack Raster Layers: outputsRASTER which includes all the layers from<arg1>,<arg2>,<arg3>, etc.

TABLE Create Table from List of Scalars: creates a table containing the scalar arguments input in the order listed.

TABLE SERIES Create Table Containing Series: creates a table containing

<count> elements.

Descriptor

Read descriptor information and map a raster through a descriptor column.

. (Map Raster Through Descriptor Column): maps the single layerRASTER

<raster> through the descriptor column<name> from the descriptor table for the file layer associated with<raster>.

:: (Read Descriptor Column or Color Table): reads and returns a descriptor column or the color table from the descriptor table for the file layer associated with

<raster>.

Distance

Perform distance functions including proximity analysis.

CIRC Test if Inside Unit Circle: returns true if inside unit circle, false otherwise.

DIST Distance: computes distance from origin.

Function Definition

Exponential

Use exponential operators including natural and common logarithms, power, and square root.

EXP Exponential: computese raised to the<arg1> power.

LOG Natural Logarithm: computes the natural logarithm of<arg1>.

LOG10 Common Logarithm: computes the common logarithm (base 10) of<arg1>.

POWER Raise to Power: raise<arg1> to<arg2> power.

** (Raise to Power): raise<arg1> to<arg2> power.

SQRT Square Root: computes the square root of<arg1>.

Focal (Scan)

Several neighborhood analysis functions are available including boundary, density, diversity, majority, mean, minority, rank, standard deviation, sum, and others.

BOUNDARY Boundary: returns 0(FALSE) if all pixels in the focal window<focus>

have the same value. Returns 1(TRUE) if there is more than one value in the focal window.

FOCAL DENSITY Focal Density: returns the number of occurrences of the center pixel value in the focal window<focus> around each pixel of<raster>.

FOCAL DIVERSITY Focal Diversity: returns the number of different values in the focal window<focus> around each pixel of<raster>.

FOCAL MAJORITY Focal Majority: returns the most commonly occurring value in the focal window<focus> around pixel of<raster>.

FOCAL MAX Focal Maximum: returns the maximum of the data file values in the focal window<focus> around each pixel of<raster>.

FOCAL MEAN Focal Mean: returns the mean of the pixels in focal window<focus>

around each pixel of<raster>.

FOCAL MEDIAN Focal Median: returns the median of the values in the focal window

<focus> around each pixel of<raster>.

FOCAL MIN Focal Minimum: returns the minimum of the values in focal window

<focus> around each pixel of<raster>.

FOCAL MINORITY Focal Minority: returns the least commonly occurring value in the focal window<focus> around each pixel of<raster>.

Function Definition

FOCAL RANK Focal Rank: returns the number of pixels in the focal window

<focus> whose value is less than the center pixel for each pixel of<raster>.

FOCAL SD Focal Standard Deviation: returns the standard deviation of the pixels in the focal window<focus> around each pixel of<raster>.

FOCAL STANDARD DEVIATION Focal Standard Deviation: returns the standard deviation of the pixels in the focal window<focus> around each pixel of<raster>.

FOCAL SUM Focal Sum: returns the sum of the pixels in the focal window<focus>

around each pixel of<raster>.

Focal Use Opts

These functions are used with the Focal operations above and can be inserted into these functions in place of the<use_option> argument.

The On-Line Help for these functions is included with the Help for the Focal functions.

IGNORE_VALUE Specify a value(s) to ignore in the calculation of the selected Focal function.

USE_VALUE Specify a value(s) to include in the calculation of the selected Focal function.

USE_LOOKUP_TABLE Use a lookup table to determine which values should be used in the calculation of the selected Focal function.

Focal Apply Opts

These functions are used with the Focal operations above and can be inserted into these functions in place of the<apply_option> argument.

The On-Line Help for these functions is included with the Help for the Focal functions.

NO_APPLY_AT_VALUE Specify a value(s) to which the selected Focal function will not be applied.

APPLY_AT_VALUE Specify a value(s) to which the selected Focal function will be applied.

APPLY_LOOKUP_TABLE Use a lookup table to determine to which values the selected Focal function should be applied.

Function Definition

GLOBAL MAX Global Maximum: computes the maximum value of each layer of

<arg1>.

GLOBAL MEAN Global Mean: computes the mean of all elements in each layer of

<arg1>.

GLOBAL MEDIAN Global Median: computes the median of each layer of<arg1>.

GLOBAL MIN Global Minimum: computes the minimum value of each layer of

<arg1>.

GLOBAL MINORITY Global Minority: computes the least commonly occurring value in each layer of<arg1>.

GLOBAL SD Global Standard Deviation: computes the standard deviation of all elements in each layer of<arg1>.

GLOBAL STANDARD DEVIATION Global Standard Deviation: computes the standard deviation of all elements in each layer of<arg1>.

GLOBAL SUM Global Sum: computes the total of all elements in each layer of

<arg1>.

Matrix

Matrix functions allow you to multiply, divide, and transpose matrices, as well as convert a matrix to table and vice versa.

MATDIV Matrix Division: divides<matrix1> by<matrix2> using standard matrix division.

MATINV Matrix Inverse: returns the inverse of<matrix1>.

MATMUL Matrix Multiplication: multiplies<matrix1> by<matrix2> using standard matrix multiplication.

MATRIXTOTABLE Convert Matrix to Table: converts the 1 column matrix

<matrix1> to a table.

MATTRANS Matrix Transpose: returns the transpose of<matrix1>.

TABLETOMATRIX Convert Table to Matrix: converts the table<table1> to a 1 column matrix.

Other

A host of miscellaneous functions provide data type conversion, various tests, and other utilities.

ABS Absolute Value: computes the absolute value of<arg1>.

ANGLE Angle: returns the angle for complex numbers and zero for other types.

Function Definition

BINARY Convert to Binary: returns true if non-zero, false if zero.

CEIL Ceiling: computes the least integer greater than or equal to<arg1>.

COMPLEX Convert to Complex: converts toCOMPLEX type.

CONJ Complex Conjugate: returns the conjugate of a complex number. For example:

CONJ ((a,b)) returns (a,-b). Returns<arg1> for other types.

DELTA Delta: true if<arg1> is zero, false otherwise.

EVEN Test if Even: returns true if<arg1> is an even number, false otherwise.

FLOAT Convert to Float: converts toFLOAT type.

FLOOR Floor: computes the greatest integer less than or equal to<arg1>.

GAMMA Gamma: computes the gamma function of<arg1>.

IMAG Imaginary Part: returns the imaginary part of complex numbers. Returns zero for other types.

INTEGER Convert to Integer: truncates<arg1>, returnsINTEGER type.

INV Multiplicative Inverse: computes the multiplicative inverse of<arg1>, i.e.,1. /

<arg1>.

ODD Test if Odd: returns true if<arg1> is an odd number, false otherwise.

REAL Real Part: returns the real part of complex numbers. Returns<arg1> for other types.

ROUND Round: computes the nearest integer to<arg1>.

SIGN Sign: determines the sign of<arg1>. Returns 1 if<arg1> is positive, 0 if 0, -1 if negative.

SINC Sinc: returns (SIN (

π

* <arg1>)) / (

π

* <arg1>).

STEP Step: returns true if<arg1> >= 0, false otherwise.

Function Definition

== (Equality): true if<arg1> and<arg2> are equal, false otherwise.

=~ (Case Insensitive String Equality): true if<string1> and<string2> are equal ignoring upper and lower case differences, false otherwise.

!= (Inequality): true if<arg1> and<arg2> are not equal, false otherwise.

!~ (Case Insensitive String Inequality): true if<string1> and<string2> are not equal ignoring upper and lower case differences, false otherwise.

> (Greater Than): true if<arg1> is greater than<arg2>, false otherwise.

>= (Greater Than or Equal): true if<arg1> is greater than or equal to<arg2>, false otherwise.

< (Less Than): true if<arg1> is less than<arg2>, false otherwise.

<= (Less Than or Equal): true if<arg1> is less than or equal to<arg2>, false otherwise.

EQ Equality: true if<arg1> and<arg2> are equal, false otherwise.

ISALLTRUE Test for All Non-zero: returnsBINARY SCALAR regardless of input type.

If any element of input table or matrix is zero, returns false. Returns true if all elements are non-zero.

ISNONZERO Test for Non-zero: returnsBINARY SCALAR regardless of input type.

If any element of input table or matrix is non-zero, returns true. Returns false if all elements are zero.

NE Inequality: true if<arg1> and<arg2> are not equal, false otherwise.

GE Greater Than or Equal: true if<arg1> is greater than or equal to<arg2>, false otherwise.

GT Greater Than: true if<arg1> is greater than<arg2>, false otherwise.

LE Less Than or Equal: true if<arg1> is less than or equal to<arg2>, false otherwise.

LT Less Than: true if<arg1> is less than<arg2>, false otherwise.

Size

These functions return size information about input objects.

CELLAREA Cell Area: returns the cell size (resolution) of each pixel in an input raster.

CELLUNITS Cell Units: returns the measurement unit for cell size of the input raster.

Function Definition

CELLX Cell X: returns the X dimension of the pixels in the input raster.

CELLY Cell Y: returns the Y dimension of the pixels in the input raster.

LAYERHEIGHT Layer Height: returns the number of rows in an input raster.

LAYERWIDTH Layer Width: returns the number of columns in an input raster.

NUMCOLS Number of Columns: returns number of columns in an object.

NUMLAYERS Number of Layers: returns number of layers in an object.

NUMROWS Number of Rows: returns number of rows in an object.

Stack Statistics

Perform stack operations including diversity, maximum, mean, minimum, standard deviation, sum, and more.

STACK DIVERSITY Stack Diversity: returns a single layer each of whose pixels contain the number of different values for that pixel among the layers of the point.

STACK MAJORITY Stack Majority: returns a single layer each of whose pixels contain the most commonly occurring value for that pixel among the layers of the input.

STACK MAX Stack Maximum: returns a single layer each of whose pixels contain

STACK MAX Stack Maximum: returns a single layer each of whose pixels contain

In document Spatial Modeler (Page 55-72)

Related documents