Batch Command Editor

ERDAS IMAGINE Help

HGD_Variant
16.5.1
HGD_Product
ERDAS IMAGINE
HGD_Portfolio_Suite
Producer

Using the Batch Command Editor, you can process one or more files with one or more commands at any time, from one minute to many years in the future. This is useful if you have a process that requires a long time to run and you want to run it when your system is at minimum utilization (for example, during the night).

The Batch Command Editor opens when you click the Batch button contained in many of the processing dialogs in ERDAS IMAGINE, such as Import and Export dialogs, options for enhancing images, raster options, and others.

Click the Batch button to place the command in the batch queue instead of actually performing the operation. Off-line processing allows unattended operation, enabling you to log off if desired.

SHARED Tip Some applications, like 3D Surfacing (Surface), Multipoint Geometric Correction, and Mosaic use temporary files that are deleted when the application completes. This makes these applications inappropriate for automating in Batch.

Workflows

Record Commands for Automation

You can record multiple batch commands as you perform each command. The Batch Command Editor dialog collects commands as they are generated by clicking the Batch button that is available on many IMAGINE dialogs.

(Recording Commands...)    Flashing message indicates that the batch process is recording each command.

Record each command by clicking one of these:

  • File button > documents_gear Batch > Start Recording Batch Commands.
  • Record button in Batch Command Editor

You can run each command in addition to recording it. Check the Run commands as they are recorded checkbox.

Dialog Description

The Batch Command Editor consists of a Commands section, a Variables section, and common buttons. The Editor is resizeable, and you can also drag the horizontal split line to resize the top or bottom sections.

Commands

In the Commands field, you can customize an explicit software-generated command to generalize it, thus making it useful for a larger set of input files. You can replace elements of the command with variables.

Commands    This text field contains the command statement that will be run or stored as part of the batch process. You can edit directly in this field, or use the Variables or Editing tools.

Information about the syntax of IMAGINE commands can be found in the IMAGINE Command and Function Syntax reference.

Variables    Click this dropdown list to substitute one or more variables to replace an argument or to insert into the command.

Original commands    Use the command in its original form with no substitutions.

One or more inputs, one output    Create and insert variables using the stated pattern.

<input1><input2>...<inputN> <output>

The variable $(InputN) is inserted in the command line replacing the file name of any input file.

One input, one or more outputs    Create and insert variables using the stated pattern.

<input><output1>...<outputN>

The variable $(InputN) is inserted in the command line replacing the file name of any input file.

The variable $(OutputN) is inserted in the command line replacing the file name of any output file.

One input, zero or more temps, one output    Create and insert variables using the stated pattern.

<input><temp1>...<tempN> <output>

The variable $(InputN) is inserted in the command line replacing the file name of any input file.

The variable $(Output) is inserted in the command line replacing the file name of any output file.

Edit...    Click to create and edit variables, and insert variables into the Batch command statement. The Variable Editor opens.

Undo    Click to undo the previous change to the command. Click multiple times to undo a series of edits.

Record    Click to begin recording each function as a batch command. The (Recording Commands...) message flashes.

Run commands as they are recorded    Click this checkbox to execute each command in addition to recording each command. This option is enabled when Record is active.

Save    Click to save commands to a file for future use as a Batch Command File (.bcf). A File Selector opens.

Open    Click to load commands saved in a Batch Command File (.bcf). A File Selector opens.

When batching the Reproject command, make sure that the projection name does not contain slashes. If it does, then it will be mistaken for a filename, which will cause the Batch system to create the wrong variables.

Variable Values

CellArray

The CellArray contains a column named for each User or Automatic type variable when you select any of the Variables patterns other than Original commands.

Each row contains the values that will be substituted for the variable names. For each row, the software runs the batch job one time.

Use Filechooser to Edit Names    When you want to edit file names in the CellArray, click this checkbox to open a File Selector to locate files. When not checked, simply click in the CellArray to type in a different file name.

Show Full Pathname    Click this checkbox to switch between showing or hiding the full path to the file in the CellArray.

Add Files    Click to add files to the CellArray. A File Selector opens from which you may add files individually or in groups using simple wild card operators.

Delete    Click to delete the selected file from the CellArray.

Save...    Click to save variable lists to a file (.bls) for future use. A File Selector opens.

Load...    Click to load saved variable lists from a file (.bls). A File Selector opens.

Drag and Drop Files

You may also add files by dragging and dropping filenames from Windows Explorer into this CellArray. If you have individual files selected, and drag and drop them, all the files will be added. Be careful to only select files which are appropriate for your batch commands.

If you drag and drop a folder name into this CellArray, all files contained in that folder will be added. You may need to remove any files which are not appropriate for your batch commands. However, if you click the Add Files button beforehand, then close the File Selector, then drag a folder name into the CellArray, only the appropriate files from the folder will be added.

Variables File (.bls)

The .bls files contain the list of names to be operated on by the Batch system. The first line of the file contains the name of each variable separated by white space. White space is any consecutive sequence of spaces and tabs. The rest of the lines of the file contain the filenames for each field separated by white space. Every line is terminated by either a new line or a combination of new line and carriage return. If a name contains a space or a tab, the name needs to be enclosed in quotes.

Single Variable Example

The following is an example for a single variable case. The variable is called 'Input' and each subsequent line contains one entry which is the value of Input for that line. When the Batch system runs, it runs the list of commands for each of these lines, substituting the value found on that line for each occurrence of $(Input) in the commands.

Input

"g:/work dir/imagine/root/examples/ColorBlocks.img"

g:/work/imagine/root/examples/badlines.img

g:/work/imagine/root/examples/DeathValleyRelief.img

g:/work/imagine/root/examples/DeathValley_30M_DEM.img

g:/work/imagine/root/examples/DeathValley_Radarsat.img

g:/work/imagine/root/examples/DEMmerge_sub.img

g:/work/imagine/root/examples/dmtm.img

Two Variables Example

The following is an example for a two variable case. The variables are called 'Input1' and 'Input2'. Each subsequent line contains two entries (separated by a tab) which are the values of Input1 and Input2 (respectively) for that line. When the Batch system runs, it runs the list of commands for each of these lines, substituting the first value found on that line for each occurrence of $(Input) in the commands, and substituting the second value found on the line for each occurrence of $(Output).

Input1 Input2

"g:/work dir/ColorBlocks.img" g:/data/Colorblocks.img

g:/work/badlines.img g:/data/Colorblocks.img

g:/work/DeathValleyRelief.img g:/data/Colorblocks.img

g:/work/DeathValley_30M_DEM.img g:/data/Colorblocks.img

g:/work/DeathValley_Radarsat.img g:/data/Colorblocks.img

g:/work/DEMmerge_sub.img g:/data/Colorblocks.img

g:/work/examples/dmtm.img g:/data/Colorblocks.img

Many processes (such as Resolution Merge and Layer Stack) do not accept multiple input variables and may not work in Automated Batch Mode.

For detailed information on the specific batch job files and their contents, refer to Batch Job Files.

Common Buttons

Preview...    Click to generate a list of command statements in a Text Editor that would be run if Run Now or Submit buttons were clicked. Wait a few moments for the list to be generated.

Run Now   Click to run the commands now.

Submit...    Click to run the commands, run simultaneous processes, enter user credentials if needed, run distributed processing, or schedule for a later time. The Submit dialog opens.

Close    Click to cancel the current batch job and close this dialog.

Help    Click to open this On-Line Help document.