Running stripmapApp.py with \-\-steps also enables one to enter the Python
interpreter after a run and load the state of the workflow at any stage
and introspect the objects in the flow and play with them as follows,
for example:
```bash
%> python3
>>> import isce
>>> f = open("PICKLE/formslc")
>>> import pickle
>>> a = pickle.load(f)
>>> o = f.getMasterOrbit()
>>> t, x, p, off = o._unpackOrbit()
>>> print(t)
>>> print(x)
```
Someone with familiarity of the inner workings of ISCE can exploit
this mode of interacting with the pickle object to discover much about
the workflow states and also to edit the state to see its effect
on a subsequent run with \-\-dostep or \-\-start.
### Notes on Digital Elevation Models
- ISCE will automatically download SRTM Digital Elevation Models when you run an
application that requires a DEM. In order for this to work follow the next 2
instructions:
1. You will need to have a user name and password from urs.earthdata.nasa.gov and
you need to include LPDAAC applications to your account.
a. If you don't already have an earthdata username and password,
you can set them at https://urs.earthdata.nasa.gov/
b. If you already have an earthdata account, please ensure that
you add LPDAAC applications to your account:
- Login to earthdata here: https://urs.earthdata.nasa.gov/home
- Click on my applications on the profile
- Click on “Add More Applications”
- Search for “LP DAAC”
- Select “LP DAAC Data Pool” and “LP DAAC OpenDAP” and approve.
2. create a file named .netrc with the following 3 lines:
```bash
machine urs.earthdata.nasa.gov
login your_earthdata_login_name
password your_earthdata_password
```
3. set permissions to prevent others from viewing your credentials:
```bash
> chmod go-rwx .netrc
```
- When you run applications that require a dem, such as stripmapApp.py, if a dem
component is provided but the dem is referenced to the EGM96 geo reference (which
is the case for SRTM DEMs) it will be converted to have the WGS84 ellipsoid as its
reference. A new dem file with suffix wgs84 will be created.
- If no dem component is specified as an input a EGM96 will be automatically
downloaded (provided you followed the preceding instructions to register at
earthdata) and then it will be converted into WGS84.
- If you define an environment variable named DEMDB to contain the path to a
directory, then ISCE applications will download the DEM (and water body mask files
into the directory indicated by DEMDB. Also ISCE applications will look for the
DEMs in the DEMDB directory and the local processing directory before downloading
a new DEM. This will prevent ISCE from downloading multiple copies of a DEM if
you work with data in different subdirectories that cover similar geographic
locations.
## Input Files
Input files are structured 'xml' documents. This section will briefly
introduce their structure using a special case appropriate for processing ALOS
data. Examples for the other sensor types can be found in the directory
'examples/input\_files'.
The basic (ALOS) input file looks like this (indentation is optional):
### stripmapApp.xml (Option 1)
```xml
<stripmapApp>
<componentname="stripmapApp">
<propertyname="sensor name">ALOS</property>
<componentname="Master">
<propertyname="IMAGEFILE">
/a/b/c/20070215/IMG-HH-ALPSRP056480670-H1.0__A
</property>
<propertyname="LEADERFILE">
/a/b/c/20070215/LED-ALPSRP056480670-H1.0__A
</property>
<propertyname="OUTPUT">20070215</property>
</component>
<componentname="Slave">
<propertyname="IMAGEFILE">
/a/b/c/20061231/IMG-HH-ALPSRP049770670-H1.0__A
</property>
<propertyname="LEADERFILE">
/a/b/c/20061231/LED-ALPSRP049770670-H1.0__A
</property>
<propertyname="OUTPUT">20061231</property>
</component>
</component>
</stripmapApp>
```
The data are enclosed between an opening tag and a closing tag. The \<stripmapApp\>
tag is closed by the \<\/stripmapApp\> tag for example. This outer tag is necessary
but its name has no significance. You can give it any name you like. The
other tags, however, need to have the names shown above. There are 'property',
and 'component' tags shown in this example.
The component tags have names that match a Component name in the ISCE code.
The component tag named 'stripmapApp' refers to the configuration information for
the Application (which is a Component) named "stripmapApp". Components contain
properties and other components that are configurable. The property tags
give the values of a single variable in the ISCE code. One of the properties
defined in stripmapApp.py is the "sensor name" property. In the above example
it is given the value ALOS. In order to run stripmapApp.py two images need to
be specified. These are defined as components named 'Master' and 'Slave'.
These components have properties named 'IMAGEFILE', 'LEADERFILE', and 'OUTPUT'
with the values given in the above example.
NOTE: the capitalization of the property and component names are not of any
importance. You could enter 'imagefile' instead of 'IMAGEFILE', for example,
and it would work correctly. Also extra spaces in names that include spaces,
such as "sensor name" do not matter.
There is a lot of flexibility provided by ISCE when constructing these input
files through the use of "catalog" tags and "constant" tags.
A "catalog" tag can be used to indicate that the contents that would normally
be found between an opening ad closing "component" tag are defined in another
xml file. For example, the stripmapApp.xml file shown above could have been split
between three files as follows:
### stripmapApp.xml (Option 2)
```xml
<stripmapApp>
<componentname="insar">
<propertyname="Sensor name">ALOS</property>
<componentname="master">
<catalog>20070215.xml</catalog>
</component>
<componentname="slave">
<catalog>20061231.xml</catalog>
</component>
</component>
</stripmapApp>
```
#### 20070215.xml
```xml
<componentname="Master">
<propertyname="IMAGEFILE">
/a/b/c/20070215/IMG-HH-ALPSRP056480670-H1.0__A
</property>
<propertyname="LEADERFILE">
/a/b/c/20070215/LED-ALPSRP056480670-H1.0__A
</property>
<propertyname="OUTPUT">20070215 </property>
</component>
```
#### 20061231.xml
```xml
<componentname="Slave">
<propertyname="IMAGEFILE">
/a/b/c/20061231/IMG-HH-ALPSRP049770670-H1.0__A
</property>
<propertyname="LEADERFILE">
/a/b/c/20061231/LED-ALPSRP049770670-H1.0__A
</property>
<propertyname="OUTPUT">20061231</property>
</component>
```
-----
## Component Configurability
In the examples for running stripmapApp.py ([Here](#running-isce-from-the-command-line) and [Here](#running-isce-in-the-python-interpreter) above) the input
data were entered by giving the name of an 'xml' file on the command line. The
ISCE framework parses that 'xml' file to assign values to the configurable
variables in the isce Application stripmapApp.py. The Application executes
several steps in its workflow. Each of those steps are handled by a Component
that is also configurable from input data. Each component may be configured
independently from user input using appropriately named and placed xml files.
This section will explain how to name these xml files and where to place them.
### Component Names: Family and Instance
Each configurable component has two "names" associated with it. These names
are used in locating possible configuration xml files for those components. The
first name associated with a configurable component is its "family" name. For
stripmapApp.py, the family name is "insar". Inside the stripmapApp.py file an
Application is created from a base class named Insar. That base class defines
the family name "insar" that is given to every instance created from it. The
particular instance that is created in the file stripmapApp.py is given the
'instance name' 'stripmapApp'. If you look in the file near the bottom you will
see the line,
```python
insar = Insar(name="stripmapApp")
```
This line creates an instance of the class Insar (that is given the family name
'insar' elsewhere in the file) and gives it the instance name "stripmapApp".
Other applications could be created that could make several different instances
of the Insar. Each instance would have the family name "insar" and would be
given a unique instance name. This is possible for every component. In the
above example xml files instances name "Master" and "Slave" of a family named