Skip to content

Commit

Permalink
make PyRate workflow descriptions consistent between README on main p…
Browse files Browse the repository at this point in the history
…age and the documentation
  • Loading branch information
Sarah Lawrie committed Apr 11, 2017
1 parent d86ce5b commit 0e49d54
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 52 deletions.
13 changes: 6 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ different parts of the workflow.
3. ``linrate_timeseries``
4. ``postprocess``

More detailed documentation on the use of PyRate can be found in the `User Guide <http://geoscienceaustralia.github.io/PyRate>`_.

******************************************
1. prepifg: Preparing input interferograms
Expand Down Expand Up @@ -192,19 +191,19 @@ the full size interferograms. This enables large interferograms to be more easil

.. code-block:: python
>> pyrate linrate --help
Usage: pyrate linrate [OPTIONS] CONFIG_FILE
>> pyrate linrate_timeseries --help
Usage: pyrate linrate_timeseries [OPTIONS] CONFIG_FILE
Options:
-r, --rows INTEGER divide ifgs into this many rows
-c, --cols INTEGER divide ifgs into this many columns
--help Show this message and exit
The ``linrate`` command will perform the time series and linear rate analysis:
The ``linrate_timeseries`` command will perform the time series and linear rate analysis:

.. code-block:: python
pyrate linrate path/to/config_file -c 3 -r 4
pyrate linrate_timeseries path/to/config_file -c 3 -r 4
This command also has the option to break the interferograms into tiles of ``r`` rows and
``c`` columns (see ``correct`` command above).
Expand All @@ -227,7 +226,7 @@ geotiff files of the final time series and linear rate products.
--help Show this message and exit.
Make sure to use the same number of rows and columns that was used in the
previous ``linrate`` step:
previous ``linrate_timeseries`` step:

.. code-block:: python
Expand Down Expand Up @@ -256,7 +255,7 @@ MPI Support
===========

PyRate has been designed for use on High Performance Computers and
instructions to use a HPC cluster can be found in the `pbs directory <pbs>`_.
instructions to use a HPC cluster can be found in the `hpc directory <hpc>`_.

==============================
Python Multi-threading Support
Expand Down
127 changes: 82 additions & 45 deletions docs/usage.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Usage

## PyRate workflow
## PyRate Workflow

`PyRate` installs an executable `pyrate`.
After installing PyRate, an executable program
``pyrate`` is created.

Use ``help`` for the different command line options:

Use `help` for the different command line options:

>> pyrate --help
Usage: pyrate [OPTIONS] COMMAND [ARGS]...
Expand All @@ -19,75 +21,106 @@ Use `help` for the different command line options:
postprocess
prepifg

As you can see `pyrate` has three command line options.

1. prepifg
1. linrate
1. postprocess
The ``pyrate`` program has four command line options corresponding to
different parts of the workflow.

1. ``prepifg``
2. ``correct``
3. ``linrate_timeseries``
4. ``postprocess``


### 1. prepifg: Preparing input interferograms

Below we discuss these options.
The first step of PyRate is to convert the GAMMA or ROI\_PAC format
unwrapped interferograms into geotiff format, followed by applying
multi-looking and cropping operations. These procedures are all
performed by ``pyrate prepifg`` command:

### Preparing interferograms: prepifg
The first step of PyRate is to convert the unwrapped interferograms into
geotiffs, followed by multilooking and cropping. Both of these operations are
performed by `pyrate prepifg` command:

>> pyrate prepifg --help
Usage: pyrate prepifg [OPTIONS] CONFIG_FILE

Options:
--help Show this message and exit.

So one can use the `prepfig` command as the following:
The ``prepfig`` command is used as follows:


pyrate prepifg /path/to/config_file

The two major steps during the `prepifg` operation are described below.
The two major steps during the ``prepifg`` operation are described
below.



#### Data formatting: convert to geotiff

The `prepifg` command will determine the input format from the value specified
at the *processor:* keyword in the config file (0: ROI\_PAC; 1: GAMMA)
The ``prepifg`` command will determine the input format from the value
specified at the *processor:* keyword in the config file (0: ROI\_PAC;
1: GAMMA)

Each GAMMA geocoded unwrapped interferogram requires three header files to extract metadata required for data formatting: a geocoded DEM header file (*\*.dem.par*), and the master and slave epoch SLC parameter files (*\*.slc.par*).

The path and name of the DEM header file are specified in the config file under the *demHeaderFile:* keyword.

The SLC parameter files should be in the directory specified in the config file under the *slcFileDir:* keyword. SLC parameter files for a particular interferogram are found automatically by date string pattern matching.

Each ROI_PAC geocoded unwrapped interferogram requires its own header/resource file (*\*.unw.rsc*) . These header files need to be stored in the same directory as the interferograms. In addition, the geocoded DEM header file (*\*.dem.rsc*) is required and its path and name are specified in the config file under the *demHeaderFile:* keyword. The geographic projection in the parameter *DATUM:* is extracted from the DEM header file.


#### Image transformations: multi-looking and cropping

The ``prepifg`` command will also perform multi-looking (image
sub-sampling) and cropping of the input interferograms.

Two example config files are provided in the *configs/* directory, one each for ROI_PAC and GAMMA prepifg configuration.
Either config files can be used with ``prepifg``.

A GAMMA translation requires a geographic DEM header file (\*.dem.par) and SLC parameter files (\*.slc.par) for both master and slave images to extract metadata required for the formatting. Therefore three header files are needed to format each geocoded unwrapped GAMMA interferogram <GAMMA_FILE>. The path and name of the DEM header file are specified in the config file under the *demHeaderFile:* keyword. The SLC parameter files should be in the same location as the interferogram file and are found automatically by date string pattern matching.

A ROI\_PAC translation requires a header/resource file (*.rsc* extension) for the geocoded unwrapped ROI_PAC interferogram (in the same directory) and either the geographic projection (e.g. 'WGS84') specified as an option or a header/resource file for the geographic DEM containing the geographic projection in the parameter DATUM:
### 2. correct: Calculation of corrections

#### Image transformations: multilooking and cropping
This `prepifg` command will also perform multi-looking (resampling) and
cropping the images.
This is the core of the processing tools, handled by the ``correct``
command:

Two examples of the config files are provided in `configs` directory,
with examples of the `roipac` and `gamma` prepifg configuration.
Both config files can be used with `prepifg`.

### Linear rate and time series analysis: linrate
pyrate correct path/to/config_file -c 3 -r 4

>> pyrate linrate --help
Usage: pyrate linrate [OPTIONS] CONFIG_FILE
This command will perform xxxxxxxxxxx, and has the option to break the interferograms into tiles of ``r`` rows and
``c`` columns. For example, the above command will break the interferograms into 12 tiles and will produce 12 linear rate and time series products
corresponding to each tile.

The option of rows and columns can be used to create smaller ``tiles`` of
the full size interferograms. This enables large interferograms to be more easily be accommodated in system memory. The number of tiles chosen should be as small as possible that fits in the system memory.


### 3. linrate_timeseries: Linear rate and time series analysis


>> pyrate linrate_timeseries --help
Usage: pyrate linrate_timeseries [OPTIONS] CONFIG_FILE

Options:
-r, --rows INTEGER divide ifgs into this many rows
-c, --cols INTEGER divide ifgs into this many columns
--help Show this message and exit


This is the core of the processing tools, handled by the `linrate` command:
The ``linrate_timeseries`` command will perform the time series and linear rate analysis:


pyrate linrate_timeseries path/to/config_file -c 3 -r 4

pyrate linrate path/to/config_file -c 3 -r 4
This command also has the option to break the interferograms into tiles of ``r`` rows and
``c`` columns (see ``correct`` command above).

This command will does the time series and linear rate analysis, but has the
options to break the interferograms into tiles of `r` rows and `c` columns.
So this above command will break the interferograms into 12 tiles and will
produce 12 linear rate and time series predictions corresponding to each tile.

The optional rows and columns help us create smaller `tiles` of the
interferograms that can be accommodated in the memory. The number of tiles
chosen should be as small as possible that fits in the system memory.

### Putting it back together: postprocess
The last step in `pyrate` is to put all the tiles back together from the
`linrate` part.
### 4. postprocess: Putting the tiles back together

The last step of the PyRate workflow is to re-assemble the tiles and save geotiff files of the final time series and linear rate products.


>> pyrate postprocess --help
Usage: pyrate postprocess [OPTIONS] CONFIG_FILE
Expand All @@ -98,15 +131,19 @@ The last step in `pyrate` is to put all the tiles back together from the
--help Show this message and exit.

Make sure to use the same number of rows and columns with `postprocess` as
with `linrate`:
with `linrate_timeseries`:

pyrate postprocess path/to/config_file -c 3 -r 4



## MPI Support
`PyRate` has been designed for supercomputers and instructions to use an HPC
cluster can be found in the [pbs directory](pbs).

## Python multiprocessing support
In addition to the MPI support for HPC, `PyRate` can be use standard
multiprocessing simply by turning `parallel: 1` in the config file to take
PyRate has been designed for High Performance Computers and instructions to use a HPC cluster can be found in the [hpc directory](hpc).


## Python Multi-threading Support

In addition to the MPI support for HPC, PyRate can be use standard
multi-threading simply by turning `parallel: 1` in the config file to take
advantage of multiple cores on a single PC.

0 comments on commit 0e49d54

Please sign in to comment.