7-Day SELES Course Day 7

Back to Course Index

General

 * Procedural: step by step sequence of commands
 * Some commands will block until a simulation terminates
 * Case sensitive
 * First line: Scenario Information

Raster Layers

 * SELES currently supports GRASS, ERDAS and ARC ASCII formats
 * A model has one resolution and extent, so all rasters must have the same dimensions and represent the same landscape
 * SELES has support for aligning rasters

Loading Rasters

 * 
 *  = 

Example:
 * .\gisdata\cell\Elevation
 * DEM = .\gisdata\Elevation.asc

Loading Real-value Rasters

 *  * #Multiplier
 *  =  * #Multiplier
 * multiplies cell values as they are read

Example:
 * .\gisdata\cell\SiteIndex * 10

Saving Rasters

 * Save   

Example:
 * Save DEM .\gisdata\cell\Elevation GRASS
 * Save DEM .\Elevation.asc ARC ASCII


 *  = GRASS COMPRESSED
 *  = GRASS
 *  = ARC ASCII
 *  = ERDAS8
 *  = ERDAS16

Saving JPEGs

 * Save   JPEG
 * Save <ViewName> <FileName> JPEG #Resolution
 * Save <ViewName> <FileName> JPEG [#bottom, #left, #top, #right]

Example:
 * Save DEM fig1.jpg JPEG

Closing Views

 * CLOSE ALL
 * CLOSE <Viewname>

Example:
 * Close DEM

Scenario Dimensions

 * Model Width: #NumColumns
 * Model Height: #NumRows


 * Model Cols: #NumColumns
 * Model Rows: #NumRows


 * Model Dimensions: #NumRows, #NumCols
 * Model Dimensions: <ViewName>

View Commands

 * Minimize All
 * Minimize


 * Minimize Initial State
 * Minimize Static


 * Minimize


 * Display Resolution: Number
 * Tile


 * Close
 * Close All

General Commands

 * cwd  (or cd )
 * Change current working directory
 * Will create directory if not present


 * System "command”


 * Example:
 * system "copy AAC1.txt AAC.txt"

Simulation Control

 * SimStart #RunLength #Runs
 * SimStart #RunLength #Runs Priority

Example:
 * SimStart 10 100 Low Priority


 * = Expression
 * %UseEvent

Example:
 * FireRotation = 100
 * Logging.lse OFF

Expressions

 * Expr = #Value
 * Expr = Expr + Expr
 * Expr = Expr - Expr
 * Expr = Expr * Expr
 * Expr = Expr / Expr
 * Expr = Expr ^ Expr
 * Expr = Expr % Expr
 * Expr = (Expr)

Models
pic17

Script Variables: Defining

 * $VarName$ = “value”
 * $VarName$ = value
 * $VarName$ = #globalVar#

Example:
 * $threshold = 10
 * $baseDir = “..\output1”

String Temporary Variables: Using
Put anywhere in an expression except in quoted text

Example:
 * cwd  $baseDir$\v1
 * param1 = $threshold$ + 10

Iteration

 * FOR($var$ = “filenameExpr”)
 * … (any commands)
 * END

Example:
 * FOR($x$ = \outputRasters\ageClass*)


 * FOR($var$ = #Number : #Number)
 * … (any commands)
 * END

Example:
 * FOR($x$ = 1:5)


 * FOR($var$ = #Number : #Number, #Step)
 * … (any commands)
 * END

Example:
 * FOR($x$ = 0:100,10)


 * WHILE(condition)
 * … (any commands)
 * END

Example:
 * WHILE(difference < 0.1)

Conditions
IF(condition)
 * … (any commands)
 * END

Example:
 * IF($x$ EQ 10)

Scheduling Commands
SCHEDULE(timestep)
 * … (any commands)
 * END

Example:

SCHEDULE(10)
 * $x$ = #year#
 * waterLevel = .\gisData\waterLevel$x$
 * END

Command Ordering

 * BEFORE Model (.sel) file:
 * Loading rasters
 * Copying files (file specified read when .sel file loaded)


 * AFTER Model (.sel) file:
 * Changing variable initial state (loading file will reset values)
 * Changing to output directory

Directories

 * Starting directory for processing a scenario:
 * Directory of scenario file
 * Ending directory after scenario processed
 * Current directory


 * Directory for files loaded in .sel file:
 * Directory of .sel file