IDL Scripting Examples - Geocoding

 

<< Click to Display Table of Contents >>

Navigation:  Help Content > SARscape Task-IDL Scripting-Modeler > Examples >

IDL Scripting Examples - Geocoding

 

Previous pageReturn to chapter overviewNext page

Purpose

 

It allows to execute one or more processing steps by preparing an IDL script, which actually calls specific SARscape routines.

 

The SARscapeBatch object has to be used to call any SARscape functionality by means of an IDL script.

 

Technical Note

 

The use of this functionality foresees the knowledge of the IDL programming language. The SARscape IDL scripting technology is also exploited in the batch processing.

 

The IDL script must be structured as shown in the IDLscript_example_geocoding.pro example file

(found in the following zip folder: "C:\Program Files\SARMAP SA\SARscape\examples\example_script_geocoding.zip", which is relevant to the execution  of a geocoding process.

To start this example, please perform the following steps:

Run IDL or IDL + ENVI

Open the IDLscript_example_geocoding.pro in IDL and click the compile button

To Run the script you need to write the following command in the IDL console: IDLscript_example_geocoding

 

The content of the IDL example script is synthetically described here below:

 

 

1)SARscape batch initialization and temporary directory setting (preparatory step)

The SARscape extension file is restored from the original repository folder. The folder path, where the default processing values are copied, is defined. It has to be noted that all the alternative default settings (General, VHR, HR, MR, etc.) are stored within this folder, but the one which is used is always the "SARscape_default_values_dataset_General.txt".

 

It is convenient to set a different directory than the one selected in the ENVI "File>Preferences>Directories>Temporary Directory", in order to avoid overwriting the standard SARscape default settings.

 

2a)Show all SARscape functions (preparatory step, optional)

It is possible to list all SARscape functions, which can be executed afterwards.

 

2b) Show specific SARscape functions (preparatory step, optional)

Alternatively to the step 2a, it is possible to enter a portion of the reference name relevant to the SARscape functionality to list. In our example the name of the functionality to call is the "Geocoding".

 

3)Geocoding input data and parameters (Input data and parameter definition)

The input/output data and parameters are entered. In our example they consist of: two input SAR images (..._slc); an input Digital Elevation Model (..._dem); two output SAR geocoded images (..._geo) and the parameter relevant the output grid size (25.0).

 

4a)Obtain Preferences List (preparatory step, optional)

It is needed to load a list of all SARscape default preferences.

 

4b)Search the preferences using a specific string and restore it (preparatory step, optional)

A given string is searched in the list (4a).

How many times the string is found? A result list is created

Select the needed preference from the result list (in the example, [0] refers to the first result in the result list)

Restore of the selected preference

 

4c)Restore a specific preference (preparatory step, optional)

If the name of the preference is know, it can be directly loaded.

 

4d)Read the actual preference and save it in a .sav file (preparatory step, optional)

 

4e)Load the user-specific default file (preparatory step, optional)

It is possible to enter an existing default file where the user-specific processing parameters have been previously set. If this file contains also the location of the working directory ("working_directory" tag), then the next preparatory step (5th) is not needed.

 

If this step is not executed the latest used default file is adopted.

 

5)Set the working directory (preparatory step, optional)

The folder path, where the processing related information (e.g. trace files, log files, working files, etc.) are written, is entered.  

 

6)Create the BasicGeocoding object (Processing functionality creation and validation)

The object relevant to the previously retrieved SARscape functionality (refer to step 4) is now created and afterwards the program checks its validity.

 

7)Fill the parameters (Input and output files and processing parameters are set)

First the list of input files, then the list of output files, then the Digital Elevation Model file name and finally the output grid size and the resampling method are entered.

 

8) Verify the parameters (All previous settings are checked, optional but important)

All details relevant to the specific process, which is going to be executed, are reported; in case the instruction is modified using "silent=0" (instead of "silent=1") the details are not shown. In any case, if all previous steps have been properly done, this function provides the code 1 (i.e. ok message); if any mandatory field was missing, this function provides the code 0 (i.e. failure message).

 

9) Process execution (The process is executed)

If the previous setting was properly done this function provides the code 1 (i.e. ok message) and the processing is successfully executed; otherwise the function provides the code 0 (i.e. failure message).

 

10) Exit from SARscape batch mode (The SARscape Batch session is end)

 

 

Section Content

 

SARscapeBatch Object

 

 

Input Parameter(s)

 

Refer to the Technical Note.

 

General Functions

 

Refer to the IDL help documentation.

 

Specific Function(s)

 

Refer to the IDL help documentation.

 

References

 

None.