Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{alias:gen}
h2. Name

gen — Generate grid

h2. Syntax
{panel:|borderStyle=solid|borderWidth=1|bgColor=#FFFFAA}

*gen* \[*inc*] | \[_nx ny_ \[nz]] \[*gse*] \[*gre*] ;#- _generate grid_

*gen xbo* - generate extra border

*gen gpl* _nx ny_ \[*step*] - generate grid plane

*gen ori* - generate origin of grid
{panel}

h2. Description

Generate an empty grid within the graphical window, either surface grid or cube. A quick way to establish a grid that afterwards can be given values and used in various ways. 

h2. Arguments

{indent}No arguments, the grid will have the same number of rows and columns as the last grid that set the @nrow @ncol variables.{indent} 
*inc* _xinc yinc_ 
{indent}Generate an empty grid with increment _xinc_ and _yinc_. The z values of the grid will be 0.{indent} 
_nx ny_ 
{indent}Generate an empty grid with _nx_ times _ny_ elements in rows and columns. The z values in the grid will be 0. To fill the grid with random values use the command mak ras i.e make random scalars.{indent} 
*inc* _xinc yinc zinc_ 
{indent}Generate an empty cube with increment _xinc_ and _yinc_ and _zinc_. The scalar values of the cube will be 0.{indent} 
_nx ny nz_ 
{indent}Generate an empty grid with _nx_ times _ny_ times _nz_ elements in rows and columns. The scalar values of the cube will be 0.{indent} 
*gse* 
{indent}Grid select. Select the part of the grid that is inside the graphical window window.{indent} 
*gre* _workspacename_ 
{indent}Replace the grid in _workspacename_ into the active grid. The two grids must have the same dimension and location.{indent} 
*xbo* 
{indent}Generate an extra border of boundary cells around the grid or cube. The boundary cells will have no values. For grids one can fill the boundary using the command *grp ext*.{indent} 
*gpl* _nx ny_ \[*step*] 
{indent}Generate grid plane according to these rules: 
# 1, 2 or 3 input points will generate a plane through the points. 
# More than 3 input points generate a step plane after a nearest point rule. 
# If the step argument is used a step plane is generated in all cases. 
{indent}
*ori lo | hi | min | max | zero | cur | z* _zvalue_ | _x y z_   
{indent}Generate new origin for grid or image.
- *lo* - lower left corner of window
- *hi* - upper right corner of window
- *min* - minimum value of dataset
- *max* - maximum value of dataset
- *cur* - set the origin to the cursor position
- *z* _zvalue_ - shift the z values in grid with _zvalue_
- _x y z_ - set the origin to _x y z_
{indent}

h2. Examples

h3. Ex.1: Generate grid and cube

{noformat:|borderWidth=1|bgColor=#eeeeee}
# generate a dummy grid and fill it with random scalar values
gen 100 100 ; # generate a grid with 100 x 100 elements in rows and columns
mak ras ; # mak random scalars into the grid
{noformat}

{noformat:|borderWidth=1|bgColor=#eeeeee}
# generate a dummy cube and fill it with random scalar values
win 450000 460000 6450000 6460000 1000 5000 ; # specify the grid window
gen 100 100 50 ; # generate a grid with 100 x 100 x 50 elements in rows, columns and layers
mak ras ; # mak random scalars into the cube
dis ; # display the cube
{noformat}

The above example produces this image of the generated cube.

!att:_img_ref^cmd_gen_cube.png!
_Result of the *gen* command_

h2. See also

[grp - Grid points and lines], [gr3 - Grid data into 3D cube]
{pagebreak}