SGeMS Commands


aboucher - Posted on 12 April 2009

Most of the tasks performed in SGeMS using the graphical interface, e.g. creating a new cartesian grid or executing a geostatistics algorithm, can be executed using a command line. For example, the following command:

     NewCartesianGrid  mygrid::100::100::10

will create a new cartesian grid called "mygrid", of dimensions 100x100x10.

Commands can be entered in the Command Panel. The Command Panel is not displayed by default. To display it, go to the View menu and select Commands Panel. To execute a command, type it in the field under "Run Command" (refered to as the command line) and press Enter. Use the Help command (just type Help in the command line) to get a list of all available commands.

The SGeMS Commands History tab shows a log of all commands performed either from the graphical interface or the command line. The commands appear in black. Messages are displayed in blue, and warnings or errors in red. Commands can be copied from the log, pasted to the command line, edited and executed.

Clicking the Run Command button will prompt for a file containing a list of commands to be executed. Each command in the file must start on a new line and be contained on a single line. Comments start with a # sign.

S-GeMS actually keeps two logs of the commands executed during a session: one is displayed in the SGeMS Commands History tab, the other one is recorded to a file called "sgems_history.log". This file is located in the directory where SGeMS was started. It only contains the commands: messages, warnings and errors are not recorded.

Commands are an easy way to automate tasks in SGeMS. They however offer limited flexibility: there are no control structures such as loops, tests, etc. Hence performing 20 runs of a given algorithm, each time changing a parameter, would require that the 20 commands corresponding to each run are written in the commands file. If more powerful scripting capabilities are needed, one should turn to the other automation facility of SGeMS: Python script.