GIAnT Doc
GIAnT Doc
User Manual
Piyush S Agram
Romain Jolivet
Mark Simons
TIM
E
earthdef@caltech.edu
Copyright: Do not make money with that. If you do, we will sentence you
to write a full PhD thesis.
Contents
Contents 2
0.1 About This Document . . . . . . . . . . . . . . . . . . . . . 7
0.2 Who Will Use This Documentation . . . . . . . . . . . . . . 7
0.3 Citation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
0.4 Acknowledgements and Credits . . . . . . . . . . . . . . . . 8
0.5 Request for feedback . . . . . . . . . . . . . . . . . . . . . . 8
1 Introduction 11
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.3 Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4 Programming philosophy . . . . . . . . . . . . . . . . . . . . 13
1.5 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2 Installation 15
2.1 Pre-requisites . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.1.1 Python 2.6 or higher . . . . . . . . . . . . . . . . . . 16
2.1.2 Numerical Python (NumPy) . . . . . . . . . . . . . . 16
2.1.3 Scientific Python (SciPy) . . . . . . . . . . . . . . . . 17
2.1.4 Cython . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.1.5 Matplotlib . . . . . . . . . . . . . . . . . . . . . . . . 18
2.1.6 h5py . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.1.7 pygrib . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.1.8 pywavelets . . . . . . . . . . . . . . . . . . . . . . . . 19
2.1.9 LXML . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.2 Optional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.2.1 ffmpeg or mencoder . . . . . . . . . . . . . . . . . . . 20
2
CONTENTS 3
2.2.2 pyresample . . . . . . . . . . . . . . . . . . . . . . . 20
2.2.3 HDFview . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2.4 iPython . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2.5 bpython . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2.6 pykml . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2.7 ImageMagick . . . . . . . . . . . . . . . . . . . . . . 22
2.2.8 xmlcopyeditor . . . . . . . . . . . . . . . . . . . . . . 22
2.3 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3.1 Building extensions . . . . . . . . . . . . . . . . . . . 23
2.3.2 Non-standard installations . . . . . . . . . . . . . . . 24
2.4 Automated installation of pre-requisites . . . . . . . . . . . . 24
3 Using GIAnT 27
3.1 Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.2 Working with HDF5 . . . . . . . . . . . . . . . . . . . . . . 29
3.3 Matplotlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.4 GIAnT conventions . . . . . . . . . . . . . . . . . . . . . . . 30
6 Time-series: SBAS 59
6.1 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.2 Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.3 The SBAS method . . . . . . . . . . . . . . . . . . . . . . . 60
6.3.1 Inversion Strategy . . . . . . . . . . . . . . . . . . . . 60
6.3.2 Uncertainties estimation . . . . . . . . . . . . . . . . 60
6.3.3 Outputs . . . . . . . . . . . . . . . . . . . . . . . . . 61
6.3.4 Checklist . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.4 The NSBAS method . . . . . . . . . . . . . . . . . . . . . . 62
6.4.1 Inversion strategy . . . . . . . . . . . . . . . . . . . . 62
6.4.2 Traditional stacking 1 as special case . . . . . . . . . 64
6.4.3 Uncertainties estimation . . . . . . . . . . . . . . . . 64
6.4.4 Outputs . . . . . . . . . . . . . . . . . . . . . . . . . 64
6.4.5 Checklist . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.5 The TimeFun method . . . . . . . . . . . . . . . . . . . . . 65
6.5.1 Inversion strategy . . . . . . . . . . . . . . . . . . . . 66
6.5.2 Uncertainties estimation . . . . . . . . . . . . . . . . 67
6.5.3 Outputs . . . . . . . . . . . . . . . . . . . . . . . . . 67
6.5.4 Checklist . . . . . . . . . . . . . . . . . . . . . . . . . 68
6.6 Important Note . . . . . . . . . . . . . . . . . . . . . . . . . 68
7 Time-series: MInTS 69
7.1 The MInTS Algorithm . . . . . . . . . . . . . . . . . . . . . 69
7.2 Forward Wavelet Transform . . . . . . . . . . . . . . . . . . 70
7.3 Time-series inversion of the wavelet coefficients . . . . . . . . 71
7.3.1 Inversion strategy . . . . . . . . . . . . . . . . . . . . 71
7.3.2 Uncertainties estimation . . . . . . . . . . . . . . . . 73
7.4 Inverse Wavelet Transform . . . . . . . . . . . . . . . . . . . 73
7.5 Note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
7.6 Checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
8.4 Geocoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Appendices 78
A I/O Utilities 79
A.1 Text files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
A.2 Binary files . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
A.3 HDF5 Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
A.4 GMT netcdf files . . . . . . . . . . . . . . . . . . . . . . . . 81
A.5 XML Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
A.5.1 XML format . . . . . . . . . . . . . . . . . . . . . . . 81
A.5.2 Creating XML file . . . . . . . . . . . . . . . . . . . 81
A.5.3 Reading XML file . . . . . . . . . . . . . . . . . . . . 82
A.6 DEM RSC file for non ROI PAC data . . . . . . . . . . . . . 82
A.7 GPS Input Files . . . . . . . . . . . . . . . . . . . . . . . . . 83
A.7.1 Option 1: Velocity type station list . . . . . . . . . . 83
A.7.2 Option 2: Station-wise time series . . . . . . . . . . . 83
Option a: Classic Station List . . . . . . . . . . . . . 83
Option b: SOPAC station list . . . . . . . . . . . . . 83
Station File example . . . . . . . . . . . . . . . . . . 83
B Time-series Utilities 85
B.1 Temporal characterization . . . . . . . . . . . . . . . . . . . 85
B.1.1 Dictionary of functions . . . . . . . . . . . . . . . . . 85
B.1.2 Putting functions together . . . . . . . . . . . . . . . 87
B.1.3 SBAS Formulation . . . . . . . . . . . . . . . . . . . 87
B.2 Network utilities . . . . . . . . . . . . . . . . . . . . . . . . 87
C Image utilities 89
C.1 MInTS image routines . . . . . . . . . . . . . . . . . . . . . 89
C.2 Stack routines . . . . . . . . . . . . . . . . . . . . . . . . . . 89
D Wavelets 91
D.1 Convention . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
D.2 Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
D.3 Other wavelets . . . . . . . . . . . . . . . . . . . . . . . . . 93
E Solvers 95
E.1 Least squares . . . . . . . . . . . . . . . . . . . . . . . . . . 95
E.2 Regularized L2 norm . . . . . . . . . . . . . . . . . . . . . . 95
E.3 Iteratively reweighted least squares . . . . . . . . . . . . . . 96
6 CONTENTS
Bibliography 97
Preface
0.3 Citation
We make this source code available at no cost in hopes that the software
will enhance your research. Commercial use of any part of this software is
not allowed without express permission from the authors.
7
8 CONTENTS
1. Definitions
" Contributor " means any person or entity that distributes the
Program .
9
10 CONTENTS
" Recipient " means anyone who receives the Program under this
Agreement , including all Contributors .
2. Grant of Rights
a ) Program and derivative works may not be sold , nor may they be
used in a commercial product or activity .
3. Usage
The Program is the work of many developers , each of whom owns the
copyright to the code they wrote . There is no central copyright
authority you can license the code from . The proper way to use
the Program is to examine it to understand how it works , and
then write your own modules . Sorry , there is no free lunch here .
4. No Warranty
Introduction
1.1 Overview
The Generic InSAR Analysis Toolbox (GIAnT) is a suite of commonly used
time-series interferometry algorithms in a common Python framework. Im-
provements in synthetic aperture radar (SAR) interferometry over the past
couple of decades allow accurate measurement of ground surface deforma-
tion with unprecedented spatial coverage. Various packages are available to
compute one or several interferograms, e.g, ROI PAC [Rosen et al., 2004a],
DORIS [Kampes et al., 2003], the new ISCE [Rosen et al., 2011], GMTSAR
[Sandwell et al.] or variants, like NSBAS [Doin et al., 2011]. Observing large
amplitude deformation signals, such as surface deformations due to earth-
quakes, is now a routine process. However, the detection of lower amplitude
signals, such as interseismic accumulation, creeping faults, seasonal subsi-
dence, etc., is more challenging. Time series analysis methods are used to
enhance the signal-to-noise ratio and to study the temporal variability of
surface deformation. The InSAR community uses a wide variety of meth-
ods and algorithms for interferometric time-series analysis. However, no
common modular framework exists that allows researchers to quickly ap-
ply these wide range of algorithms on a single data set and compare their
relative merits or limitations.
Development of GIAnT is primarily motivated by:
1. The need for standardization of data formats for ease in sharing time-
series products.
11
12 CHAPTER 1. INTRODUCTION
1.2 Features
Some of key features of GIAnT include:
1. It is free.
2. It provides a Python-based framework.
3. Source code is distributed along with the package.
4. Use of memory mapped files facilitating analysis of large interferogram
stacks.
5. A simple interface to weather model based atmospheric phase screen
corrections [http://earthdef.caltech.edu Jolivet et al., 2011].
6. Direct calls to optimized linear algebra libraries like LAPACK, BLAS
etc that can be optimized for speed using packages like ATLAS/ Intel
MKL.
7. A set of interactive data visualization scripts.
8. Simple parallelization using Python’s multiprocessing (shared mem-
ory) module for performance.
1.3 Algorithms
The time-series analysis routines in GIAnT can be broken down into two
stages - spatial analysis and temporal analysis. GIAnT users can choose
to analyze their data sets in radar (range, azimuth) coordinates directly or
transform their data into wavelet domain before analysis. For the tempo-
ral analysis, the users can choose to work with the traditional piece-wise
linear SBAS formulation [Berardino et al., 2002] or use a parameterized
functional form of their choice [Hetland et al., 2011]. GIAnT modules have
1.4. PROGRAMMING PHILOSOPHY 13
been designed in a manner that allows users to combine various types of spa-
tial and temporal analysis algorithms as desired. The following time-series
techniques have already been implemented and are provided with GIAnT
for immediate use.
Installation
Generic Linux
We recommend using a package manager like apt or yum to install the pre-
requisites before installing GIAnT. We provide command lines to install the
required Python libraries on a Linux Ubuntu machine.
OS-X
A convenient way to install all the pre-requisites is to use the package man-
ager MacPorts (free)1 . Installing MacPorts on OS-X machines is straight-
forward but requires Xcode2 (free). We provide command lines to install
the required Python libraries using MacPorts. Please be sure to run these
commands as root. Another package manager called Fink is available3 but
the installation of all the libraries required by GIAnT has never been tested
with Fink.
1
http://www.macports.org
2
https://developer.apple.com/xcode/
3
http://www.finkproject.org
15
16 CHAPTER 2. INSTALLATION
2.1 Pre-requisites
All the following pre-requisites may be installed from source. Although, we
strongly advise the use of a package manager for beginners.
Ubuntu - 12.04:
>> apt-get install python2.7 python2.7-dev
OS-X:
>> port install python27
>> port select python python27
Ubuntu - 12.04:
>> apt-get install python-numpy
OS-X:
>> port install py27-numpy
OS-X:
>> port install py27-numpy +atlas +gcc45
Ubuntu - 12.04:
>> apt-get install python-scipy
OS-X:
>> port install py27-scipy
OS-X:
>> port install py27-scipy +atlas +gcc45
2.1.4 Cython
Cython (http://www.cython.org) is a language that makes writing C ex-
tensions for the Python language as easy as Python itself. Cython is ideal
for wrapping external C libraries and for writing fast C modules that speeds
up the execution of Python code.
Ubuntu - 12.04:
>> apt-get install cython
(or)
>> easy_install cython
OS-X:
18 CHAPTER 2. INSTALLATION
2.1.5 Matplotlib
Matplotlib (http://matplotlib.sourceforge.net) is a python 2D plot-
ting library which produces publication quality figures in a variety of hard-
copy formats and interactive environments across platforms. We use mat-
plotlib for displaying output and for our interactive time-series viewers.
Ubuntu - 12.04:
>> apt-get install python-matplotlib
OS-X:
>> port install py27-matplotlib
2.1.6 h5py
h5py (http://code.google.com/p/h5py) provides a NumPy interface to
Hierarchial Data Format 5 (HDF5) memory mapped files. We use h5py for
storage and retrieval of named variables during various stages of processing.
A big advantage of h5py is it allows us to access slices of large matrices
directly from a file, without having to use up memory resources needed
to read the entire matrices. The latest version of MATLAB also uses the
HDF5 format and it is possible to directly read in .mat files into Python
using scipy.io.loadmat.
Ubuntu - 12.04:
>> apt-get install python-h5py
OS-X:
>> port install py27-h5py
2.1.7 pygrib
GIAnT can directly interact with PyAPS modules to use weather model
data for atmospheric phase screen corrections. pygrib (http://code.google.
com/p/pygrib) provides the interface for directly reading in GRIB-format
weather data files in Python. Successful installation of pygrib needs grib api,
openjpeg, jasper, libpng, zlib (including all development versions) which can
2.1. PRE-REQUISITES 19
Ubuntu - 12.04:
>> apt-get install zlib1g zlib1g-dev
>> apt-get install libpng12-0 libpng12-dev
>> apt-get install libjasper1 libjasper-dev
>> apt-get install libopenjpeg2 libopenjpeg-dev
>> apt-get install libgrib-api-1.9.9 libgrib-api-dev libgrib-api-tools
>> apt-get install python-mpltoolkits.basemap
>> apt-get install pyproj
>> easy_install pygrib
OS-X:
>> port install py27-pygrib
2.1.8 pywavelets
The MInTS Hetland et al. [2011] time-series approach uses wavelets for
spatial analysis. We provide our own Meyer wavelet library for analysis
with the original MInTS approach. However, GIAnT also allows one to use
other wavelets for spatial decomposition of unwrapped interferograms using
the pywt (http://github.com/nigma/pywt) package.
Ubuntu - 12.04:
>> apt-get install python-pywt
OS-X:
>> port install py27-pywavelets
(or)
>> easy_install pywavelets
2.1.9 LXML
GIAnT uses XML files for setting up data and processing parameters.
Specifically, we use the eTree module from lxml to construct input XML
20 CHAPTER 2. INSTALLATION
files and the objectify module from lxml to read in XML files. LXML
(http://lxml.de) should be available as a standard repository on most
linux distributions.
Ubuntu - 12.04:
>> apt-get install python-lxml
OS-X:
>> port install py27-lxml
2.2 Optional
We would also recommend installing the following packages before installing
GIAnT.
Ubuntu - 12.04:
>> apt-get install ffmpeg mencoder
OS-X:
>> port install ffmpeg
2.2.2 pyresample
Pyresample is a Python package that allows for easy geocoding of swath
data (interferograms etc). We use pyresample to generate movies in the
geocoded domain. Pyresample can be downloaded from http://code.
google.com/p/pyresample/. If pyproj is already installed on your ma-
chine, you can install pyresample using the command
2.2.3 HDFview
HDFview is open source software for exploring the contents of an HDF file.
The latest version can be downloaded from http://www.hdfgroup.org/
hdf-java-html/hdfview/index.html.
Ubuntu - 12.04:
>> apt-get install hdfview
HDFview does not exist through MacPorts but can be easily installed
following the instructions on the HDFview website.
2.2.4 iPython
Interactive Python (iPython) [Pérez and Granger, 2007] provides a rich
toolkit for Python that allows users to work with the python interpreter in
an environment similar to MATLAB or IDL.
Ubuntu - 12.04:
>> apt-get install ipython
OS-X:
>> port install py27-ipython
2.2.5 bpython
bpython http://bpython-interpreter.org/ is a simple interface to the
python interpreter. We recommend bpython when iPython cannot be used,
for example when you are on a NFS partition.
Ubuntu - 12.04:
>> apt-get install bpython
OS-X:
>> port install py27-bpython
2.2.6 pykml
pykml (http://packages.python.org/pykml/) is a Python library for cre-
ating, parsing and manipulating KML files. GIAnT can output time-series
products to KML files for immediate visualization in Google Earth.
22 CHAPTER 2. INSTALLATION
2.2.7 ImageMagick
This is typically a part of the standard Linux distributions. We use Im-
ageMagick’s convert utility to make parts of PNG files transparent for dis-
play usign KML/KMZ files.
Ubuntu - 12.04:
>> apt-get install imagemagick
OS-X:
>> port install imagemagick
2.2.8 xmlcopyeditor
xmlcopyeditor http://xml-copy-editor.sourceforge.net/ is a simple
editor for XML. The XML files used in GIAnT or ISCE can be easily mod-
ified using a text editor but xmlcopyeditor makes the task a little simpler.
We recommend installing the package from source.
2.3 Installation
GIAnT has the following directory structure.
Identify the directory in which you want to install GIAnT and make it
your current working directory. Checkout the latest version of the code as
svn co http://earthdef.caltech.edu/svn/giant
cd giant/GIAnT
svn co http://earthdef.caltech.edu/svn/pyaps
Using Bash:
>> export GIANT=/directory/where/you/did/copy/GIAnT
>> export PYTHONPATH=$GIANT:$PYTHONPATH
Using Csh:
>> setenv GIANT ’/directory/where/you/did/copy/GIAnT’
>> setenv PYTHONPATH $GIANT:$PYTHONPATH
On OS-X, the default compiler will be clang. This will cause some
problems if you use any regularized inversions. Therefore, on OS-X, if you
24 CHAPTER 2. INSTALLATION
Alternate installation
Alternately, identify the directories in which the LAPACK, BLAS and AT-
LAS libraries are located. Compile using f2py in the gsvd directory.
>> f2py gensvd.pyf dggsvd.f -LPATH_TO_LIBS -llapacklib
-lblaslib -latlaslib
On Ubuntu - 12.04:
>> f2py gensvd.pyf dggsvd.f -llapack -lblas -latlas
Test the compiled module using the provided test.py. Ensure that you are
using the f2py corresponding to the numpy version you want to use.
hope that active users will contribute to this table and add support for
other Linux distributions.
Chapter 3
Using GIAnT
1. Stack preparation
Unwrapped interferograms are read from various locations on disk and
are consolidated into a data cube. The data cube is stored along with
other auxiliary information in a hierarchical data format (HDF5) file.
Chapter 4 describes this step in detail.
2. Stack preprocessing
Preprocessing of the stack including orbit deramping and topo-correlated
atmospheric phase correction. The outputs are stored in a HDF5 file.
Chapter 5 describes each of the preprocessing steps in detail.
27
28 CHAPTER 3. USING GIANT
3. Time-series estimation
The time-series is estimated from the processed stack using a tech-
nique of choice. Currently, you can choose between various SBAS
techniques (Chapter 6) and MInTS (chapter 7).
GIAnT workflow
Unwrapped Common
Coherence Metadata
IFGs Mask
ProcessStack.py
MInTS chain
SBAS chain
DatatoWavelet.py
SBASInvert.py
InvertWaveletCoeffs.py
(or)
(or)
NSBASInvert.py
InvertWaveletCoeffs_fol
(or)
ds.py
TimefnInvert.py
WavelettoData.py
Visualization
Figure 3.1: GIAnT workflow for using InSAR time-series analysis. The
main strength of GIAnT is the modular implementation of these various
stages. The modules can themselves be used to extend GIAnT and imple-
ment other time-series techniques.
3.1 Python
For users who are familiar with MATLAB or IDL, the transition to Python
should be fairly easy. Two resources that we recommend for users who are
new to Python are
• The tentative Numpy turorial- http://scipy.org/Tentative_NumPy_
Tutorial
• Numpy for MATLAB users http://mathesaurus.sourceforge.net/
matlab-numpy.html
3.3 Matplotlib
GIAnT uses matplotlib [Hunter, 2007] for plotting. Some familiarity with
matplotlib will allow users to write their own visualization codes for debug-
ging and understanding the processing chain. Two useful tutorials can be
found at
• http://matplotlib.sourceforge.net/users/pyplot_tutorial.html
• http://matplotlib.github.com/users/image_tutorial.html
Master-slave Typically, users prefer to use the most recent amongst the
pair of SAR acquisitions as the master scene when generating inter-
ferograms. GIAnT has been designed to be flexible and automatically
figures out the correct connectivity matrix even if the order of master
and slave acquisitions do not adhere to a consistent convention. We
would still recommend the users to the latest SAR acquisition as the
master scene in every pair consistently.
Help attributes All the metadata values in input XML files must include
a <help> field. All datasets in HDF5 files must be stored with a help
attribute. This requirement is designed to aid users in understanding
the relevance of input, output and intermediate products.
Chapter 4
During this first step of the processing, all the necessary metadata and the
unwrapped interferograms are sorted and organized into an HDF5 file and
a few additional binary files, specially formatted for GIAnT. Inputs are
data from outputs of ROI PAC, DORIS, GMTSAR, GAMMA or ISCE. As
we would like to provide the most generic toolbox, we tried to implement
readers for the most common datasets, but slight changes might be needed
to adapt GIAnT to your case. In this section we describe how to use two
scripts located in GIANT/SCR:
• PrepIgramStack.py reads the input data and creates files for GI-
AnT.
4.1 Inputs
To run these steps, the user needs to gather the following files:
31
32 CHAPTER 4. PREPARING DATA FOR PROCESSING
Filenames Parameters
userfn.py Inputs data.xml
Multilook
Common reference
ensure that the corresponding wavelength fields are populated in the rdict
dictionary in PrepIgramStack.py. If all data is from a single sensor, the
wavelength is automatically read in from the example rsc file. You will also
need to provide a mapping from the dates to a filename on disk as a python
function (Section 4.5).
We would also like to point out that most users will probably end up
customizing the PrepIgramStack.py script according to their own needs.
Some users may prefer to read in the filenames and the associated wave-
lengths directly from an ASCII file. Implementing such changes should be
trivial and we leave it up to the users to implement their favorite strategy.
1
4.1.1 Using geocoded stacks
If the users have processed their interferograms individually and plan to
combine them in geocoded domain, they should make the following changes
to make GIAnT treat the data as if it was radar coded (range, azimuth).
1. Create latitude and longitude files of the same size as your geocoded
unwrapped interferograms.
34 CHAPTER 4. PREPARING DATA FOR PROCESSING
2. Crop your DEM to the same size as your geocoded unwrapped inter-
ferograms.
4. You will also need to include entries for the four corners of the DEM
in a ROI PAC style RSC file. See Appendix A.
4.2 Outputs
A HDF5 file containing the following datasets is computed:
Additionally, the binary files containing each pixels latitude, longitude and
elevation are also output if the corresponding inputs are provided. Finally,
PNG format previews of the interferograms are created.
or
Note that the structure of the XML files changes as we add more options
to the processing chain and need more control parameters. The help fields
36 CHAPTER 4. PREPARING DATA FOR PROCESSING
in the XML files have been added to describe each of the options for the
benefit of users.
• fname - The name of the example rsc file from ROI PAC. This
file contains parameters like the width of the image, its length, the
sensors wavelength.... An example can be found in the directory
GIAnT/example.
mask STR File for common mask for pixels. This None
mask has to be the same size as your in-
terferograms, and consist on a binary grid
of 1 and 0 or NaN.
file length INT Number of azimuth lines in the unwrapped From
files rsc file
width INT Number of range pixels in the unwrapped From
files rsc file
xmin INT First pixel of cropping limit in Range di- None
rection
xmax INT Last pixel of cropping limit in Range di- None
rection
ymin INT First line of cropping limit in Azimuth di- None
rection
ymax INT Last line of cropping limit in Azimuth di- None
rection
rxmin INT First pixel of reference region in Range af- None
ter cropping
rxmax INT Last pixel of reference region in Range af- None
ter cropping
rymin INT First line of referene region in Azimuth af- None
ter cropping
rymax INT Last line of reference region in Azimuth af- None
ter cropping
latfile STR Latitude file. The latitude file is a binary None
file, that has the same size as your interfer-
ograms, that specifies the latitude of each
pixel. It is encoded has real, single preci-
sion. If this file is not provided, then, GI-
AnT uses a crude and simple linear trans-
formation to calculate the geographic coor-
dinates of the pixels. This is needed only
by the PyAPS module. If you specify a
latfile, you need to specify a lonfile.
38 CHAPTER 4. PREPARING DATA FOR PROCESSING
masktype STR Type of data in the provided mask file (op- ’f4’
tional) Can be any dtype used in Numpy.
Like all the scripts included in GIAnT, using the -h flag as input provides
a detailed description and input options for the script. The input options
for PrepIgramStack.py are:
• -h: Ask for help.
• -i INAME: INAME Input file name containing interferograms acqui-
sition dates, perpendicular baseline and sensor code name. Default is
ifg.list.
• -o ONAME: ONAME Output HDF5 file name. Default is RAW-STACK.h5.
• -x DXML: DXML data.xml filename. Default is data.xml.
• -f FIGS: FIGS Directory in the general figure directory where inter-
ferograms previews are stored. Default is Igrams.
• -u USERPY: USERPY Python script with the user defined function
makefnames.
PrepIgramStack.py currently supports RMG or plain binary files
which are either in short, integer, float32 or float64 format. Any other
format would require some additional changes in the PrepIgramStack.py
script. The input formats for the files are read in from the data.xml file.
If users develop readers for data in other formats, we strongly encourage
them to share these with the community.
4.6 Checklist
Here is a summary of the actions and commands to prepare your dataset:
8. Check that you have a new HDF5 file and have a look at the PNG
previews just created.
9. If you provided lat, lon and incidence angle files as inputs make sure
that equivalent binary files are created in the h5dir directory.
Chapter 5
Once the data are has been read into a HDF5 file, the user may proceed
to the stack pre-processing by applying atmospheric corrections and the
estimation of residual orbit errors. These corrections are performed by the
ProcessStack.py script. No major change is required in this script, unless
the users wants to implement their own correction strategy. Again, we ask
users to share their extensions of this script with the community.
ProcessStack.py uses the parameters provided in the data.xml and
sbas.xml (default) or mints.xml files. It processes the data stored into
the previously created HDF5 file (default: Stack/RAW-STACK.h5) and
the latitude, longitude, elevation and incidence (optional) files. To execute,
type:
47
CHAPTER 5. REMOVING ORBITAL RAMPS AND STRATIFIED
48 TROPOSPHERIC ARTIFACTS
5.1 Inputs
To run this script, the user needs to make sure the following files are avail-
able:
5.2 Outputs
The output is, by default, stored in the HDF5 file Stack/PROC-STACK.h5.
The file name may be modified using the command line -o flag. This file
contains the following datasets:
Inputs Lat+Lon
DEM from
+DEM from
PrepIgramStack
PrepIgramStack
Automatic
Empirical multiscale Weather model download of
approach approach weather
model
IFG corrections
GPS data
Compare GPS to
Deramp each IFG from SOPAC
each IFG
or file
Orbital error
correction Network or direct
Network inversion of inversion of
parameters parameters
IFG corrections
1
http://pyaps.googlecode.com
5.3. ATMOSPHERIC CORRECTIONS 51
10−6
δLsLOS (z) =
cos(θ)
Z zref
k1 Rd Rd e e
(P (z) − P (zref )) + k2 − k1 + k3 2 dz ,
gm z Rv T T
(5.1)
PyAPS only downloads the fields of interest from the ECMWF archive
- Humidity and Temperature as a function of pressure level. Each file
(global for single time eopch) is about 28MB in size.
webpage and click on data access. You will need to agree to the terms
and conditions before proceeding. You might have to wait for a email
confirming your access to the data set. This dataset can only be ac-
cessed from within the United States. Each file is about 89MB in size.
Our scripts do not attempt to subset this dataset.
Theory
where, ai , bi , ci and ei are referred to as the orbital parameters for the scene
i. Orbital parameters are then combined to produce orbital error maps and
correct each interferogram.
If the netramp option is set to False, orbital errors are estimated in-
dependently on each interferogram. In such case, orbital errors are given
CHAPTER 5. REMOVING ORBITAL RAMPS AND STRATIFIED
56 TROPOSPHERIC ARTIFACTS
by:
where, aij , bij , cij and dij are referred to as the orbital parameters for the
interferogram ij. We strongly advise the user to set both gpsramp and
netramp options to True.
GPS displacements can be computed in three different ways:
• By using the actual raw GPS time series (not recommended).
• Using a smoothed version using cubic splines by setting the gpspreproc
option to True in the sbas.xml or mints.xml file (recommended).
• By using modeled GPS time series. One can use modelled time series
(SOPAC) or only a GPS velocity field.
Using modelled GPS time series is very convenient because it allows to
use any functional form. It is also possible to use only the GPS velocities
as input to flatten the interferograms. If a crude deformation model is
available, it is possible to simulate a dense network of GPS stations and
flatten the interferograms.
Implementation
Using the actual GPS time series, smoothed or not, is the default behav-
ior, when the gpsderamp code name is set to True in the sbas.xml or
mints.xml files. The netramp option in the XML file ensures consistency of
the orbital parameters in the network sense. The option gpsvert will force
the software to use vertical GPS displacements. The option gpspreproc
will smooth the GPS time series before using them (recommended).
The user needs to specify the path to the GPS station list, using the
option stnlist in the XML file, and what type of list it is, using the option
stntype in the XML file. The station list type can be
• False: This specifies the default station list type, based on the SOPAC
format. The station list file is a 14 columns file, as the ones one can
download from SOPAC6 . Only the columns 1, 5, 6 and 8 are used and
are station code names in 4 digits, latitude, longitude and starting
date of the time series, respectively.
6
http://garner.ucsd.edu/pub/timeseries/measures
5.5. CHECKLIST 57
• True: The station list is a 3 columns Ascii file specifying the station
code name (4 digits) and its latitude and longitude coordinates.
The GPS station files corresponding to the code names in the station
file list need to be in the directory specified by the option gpspath in the
XML file. In the SOPAC standard, each station file name has to be the 4
digits station code followed by CleanFlt.neu (ex: ctmsCleanFlt.neu for
the station ctms). Each file is an ASCII file starting by a header, describing
the modeled time series, followed by 9 columns, specifying the date (floating
point), the year (integer), the day of the year, North displacement, East
displacement, Up displacement, North uncertainty, East uncertainty and
Up Uncertainty. An example can be found in the Appendices and in the
example directory.
5.5 Checklist
1. Check the outputs from the previous step.
6. Check the new HDF5 file and the newly created PNG previews.
Chapter 6
Time-series: SBAS
Small Baseline Subset-like Time Series analysis are among the most com-
mon strategies to describe the ground displacements from a pile of interfer-
ograms. The name Small Baseline Subset (hereafter SBAS) was primarily
chosen by Berardino et al. [2002], but now represents a wide range of meth-
ods [e.g, Usai, 2003, Schmidt and Bürgmann, 2003, Cavalié et al., 2007,
Lopez-Quiroz et al., 2009]. We have included three implementations of
such algorithms in GIAnT - SBAS, N-SBAS and TimeFun. We also pro-
vide a way to estimate uncertainties in the estimated time-series products
using a cross-validation based approach.
6.1 Inputs
The input files are outputs from ProcessStack.py or PrepIgramStack.py,
including:
• The XML file containing the informations about the dataset (typi-
cally, data.xml).
• The XML file containing the informations about the processing strate-
gies (typically, sbas.xml).
59
60 CHAPTER 6. TIME-SERIES: SBAS
6.2 Outputs
The output dataset is organized in a single HDF5 file (default is Stack/LS-PARAMS.h5
for the SBAS chain, Stack/NSBAS-PARAMS.h5 for the NSBAS chain and
Stack/TIME-FUN.h5 for the time function inversion).
6.3.3 Outputs
Outputs are stored in a HDF5 file. Default is Stack/LS-PARAMS.h5 for
SBASInvert.py and Stack/LS-xval.py for SBASxval.py. The vari-
ables are:
6.3.4 Checklist
1. Copy the SBASInvert.py script to your working directory.
2. Run: python SBASInvert.py [Options].
3. Wait a minute or two.
4. Copy the plotts.py script to your working directory.
5. Check the results by running: python plotts.py [Options]. See
section 8.
6. If you are happy, copy the SBASxval.py script to your working
directory.
7. Run: python SBASxval.py [Options]
Pj−1
∀(i, j) ∈ Γ Φij = n=i δϕn
d = Gm ⇐⇒ (6.2)
Pk−1 k
∀k ∈ [2, N ] 0 = n=1 δϕn − f (∆tk ) + eBperp
6.4. THE NSBAS METHOD 63
where, Φij is the pixel phase value for the interferogram combining acquisi-
tion i and j (.i.e in the data vector d), δϕn is the phase increment between
acquisition n and n + 1, ∆tk = tk − t0 , e is a Digital Elevation Model error
estimation, Bkperp is the perpendicular baseline between satellite paths at
acquisition 1 and k. f is a parametric representation of the temporal form
of the deformation. This function needs to be specified in the userfn.py
file, using the NSBASdict function. By default, it is assumed to be of the
form:
f (t) = at2 + vt + c, (6.3)
where a is the pixel acceleration, v is the pixel velocity and c is a constant.
The resulting linear operator G can be written,
0 0
.. ..
D . .
0 0
, (6.4)
1
1 0 ··· 0 −f (∆t1 ) −Bperp
2
1 1 0 −f (∆t2 ) −Bperp
3
1 1 1 0 −f (∆t3 ) −Bperp
.. .. .. ..
. . . .
1 1 1 ··· 1 0
N
1 1 1 1 ··· 1 −f (∆tN ) −Bperp
1
6.4.2 Traditional stacking as special case
The simplest method to analyze a pile of interferograms is to estimate the
Line-of-Sight velocities. Even though such an analysis does not take into
account temporal variations in deformation rates compared to robust time-
series methods, it is still a good way to quickly look at one’s dataset. The
traditional velocity estimation by stacking is just a special case of NSBAS
inverstion that uses a linear function in time to tie observations between
disconnected interferogram clusters. The velocity map is stored as one of
the estimated model parameters in the output HDF5 file.
6.4.4 Outputs
Outputs are stored in a HDF5 file. Default is Stack/NSBAS-PARAMS.h5 for
NSBASInvert.py. The variables are:
6.4.5 Checklist
1. Copy the NSBASInvert.py script to your working directory.
• if regu is True, then, for each pixel mn, we minimize the cost function,
Fcmn given by,
• -u USER: The python script with the user defined time dictionary
function. Default: userfn.py.
6.5.3 Outputs
The output datasets are stored in a HDF5 file (default is Stack/TS-PARAMS.h5).
The datasets are:
6.5.4 Checklist
1. Copy the script TimefnInvert.py to your working directory.
2. Copy (if not done already) and modify the file userfn.py.
Time-series: MInTS
69
70 CHAPTER 7. TIME-SERIES: MINTS
to our inversion script using the userfn.py. If the user decides to use a
non-parametric inversion scheme using splines or integrated splines, the
solutions are regularized as described in Appendix E. InvertWavelet-
Coeffs folds.py represents our optimized implementation of the original
MInTS, using a k -fold cross validation approach to chose the damping pa-
rameter.
To run the inversion, type:
• -u USER: Python script with the user defined python function. De-
fault is userfn.py .
7.5 Note
One of the strengths of GIAnT is it’s modularity. We currently provide the
original implementation of MInTS with the GIAnT. However, it should be
trivial for the users to reuse modules from the SBAS-type algorithms and
apply them to the wavelet coefficients directly.
7.6 Checklist
1. Convert interferograms to the wavelet domain: python DatatoWavelet.py [Options]
2. Check the Hdf5 file produced.
3. Copy (if you have not done so before) the userfn.py file in your
working directory, and modify the MInTS dictionnary of functions.
4. Run python InvertWaveletCoeffs.py [Options].
5. Check the Hdf5 file produced.
6. Run python WavelettoData.py [Options].
7. Check the results using the script plotts.py.
8. Run python InvertWaveletCoeffs_xval.py to get the uncertain-
ties.
9. Run python WavelettoData.py -f WAVELET-INV-xval.h5.
Chapter 8
75
76 CHAPTER 8. VISUALIZATION AND GEOCODING
• -raw: Flag to display the filtered and un-filtered time series of a pixel
(Only for NSBAS outputs).
• -model: Plot the modeled phase value, along with the phase change
(works only with NSBAS,TimeFun and MInTS) .
• -zf : Change the reference time for plotting.
• -e: Plot the errorbars if available (works with Xval scripts).
8.2 Movies
We include a simple python script GIANT/SCR/make movie.py to build a
quick movie of your estimated time-series in radar coordinates. This script
can be used as a template in combination with the geocoding library to
make movies in geocoded domain as well. You can generate movies of your
time-series using
8.3 KML
The estimated time-series can also be spit out as a KML file with a time-
slider for immediate visualization in Google Earth. The script is similar
to the one that generates movies. The code does include system calls to
ImageMagick’s convert command for making parts of the image trans-
parent and zip command to generate a KMZ file from the generated KML
and PNG files. A colorbar is also automatically generated as an overlay.
• -y YINF YSUP: the lower and upper colorbar plot limits. Default
is -25 25.
• -win GWIN: Width of the Gaussian window in years used for inter-
polation. Default: 0.33.
• -model: If you use a parameteric inversion, use the model to inter-
polate rather than the reconstructed time-series. Default: False
• -x DXML: The data.xml file. This is needed as the file includes
information about the lat/lon files.
• -trans: The undefined data in the images (NaNs) are made transpar-
ent. Default: False
78 CHAPTER 8. VISUALIZATION AND GEOCODING
8.4 Geocoding
GIAnT includes geocoding library routines in GIAnT/geocode directory.
GIAnT uses the pyresample library to transform data to and from radar do-
main and geocoded domain. Currently, PyAPS and our geocoding modules
only support the WGS84 format. Extending support to other projections
should be relatively simple using pyresample.
An example script to geocode results from our output HDF5 files has
been included in GIANT/SCR/rdr2geo.py. The users should copy this
script and suitably modify it for their applications. Besides flat binary
files, the users should also be able to output data to GMT netcdf format
and OGR VRT files using the provided library.
Appendix A
I/O Utilities
• read rsc(fname)
This allows us to read in a ROI PAC style RSC file into a python
dictionary.
rdict = read_rsc(’example.unw’)
• write rsc(rdict,fname)
Writes the contents of the dictionary to file give by fname. The keys
of the dictionary become the headings for the entries of the RSC file.
79
80 APPENDIX A. I/O UTILITIES
#To map an RMG file of size 100 x 100 with phase in channel 2
arr = load_mmap(fname, 100, 100, map=’BIL’,
nchannels=2, channel=2)
• saveh5(fname,rdict)
Save the contents of specified dictionary (rdict) to a given HDF5 file
(fname). The keys of the dictionary automatically become dataset
names.
• loadh5(fname)
Returns the contents of a HDF5 file (fname) in a dictionary. The
names of the datasets becomes the keys in the dictionary.
A.4. GMT NETCDF FILES 81
<params>
<width>
<value>500</value>
<type>INT</type>
<help>Width of interferograms.</help>
</width>
</params>
By design, we force all XML field entries (other than branch nodes) to have
a help string describing the parameter. This has been enforced to ensure
that processing parameters are easily understood by users from different
backgrounds. Currently, we support INT, FLOAT, BOOL and STR data
types.
br = g.addnode(g.root,’params’)
g.addsubelement(br,’width’,100,’Width of interferograms.’)
g.writexml(’data.xml’)
All the data in XML is converted into a structured object that can be
directly used in your scripts.
WIDTH 350
FILE_LENGTH 500
LAT_REF1 38.5
LON_REF1 -119.5
LAT_REF2 37.3
LON_REF2 -118.0
LAT_REF3 38.5
LON_REF3 -119.5
LAT_REF4 37.3
LON_REF4 -118.0
AZIMUTH_PIXEL_SIZE 180.000000
RANGE_PIXEL_SIZE 63.300000
A.7. GPS INPUT FILES 83
#################################################################
# Refined Model Terms:
#
# n component
# slope 1: -0.0088 +/- 0.0000 m/yr (1999.1932 - 2010.0644)
# offset 1: -0.0002 +/- 0.0002 m (1999.6178)
# annual: 0.0012 +/- 0.0001 m; phase: 4.10
# semi-annual: 0.0003 +/- 0.0000 m; phase: 2.84
#
# e component
# slope 1: -0.0153 +/- 0.0000 m/yr (1999.1932 - 2010.0644)
# offset 1: 0.0013 +/- 0.0002 m (1999.6178)
# annual: 0.0007 +/- 0.0001 m; phase: 4.51
# semi-annual: 0.0004 +/- 0.0001 m; phase: 1.48
#
# u component
# slope 1: 0.0000 +/- 0.0001 m/yr (1999.1932 - 2010.0644)
# offset 1: -0.0031 +/- 0.0006 m (1999.6178)
# annual: 0.0048 +/- 0.0002 m; phase: 3.98
# semi-annual: 0.0008 +/- 0.0001 m; phase: 2.53
#
# ----------------------------------------------------------------
#
##################################################################
1999.1932 1999 071 0.0486 0.0834 -0.0011 0.0025 0.0020 0.0026
1999.1959 1999 072 0.0488 0.0828 -0.0004 0.0024 0.0019 0.0025
1999.1986 1999 073 0.0484 0.0829 0.0000 0.0024 0.0019 0.0026
1999.2014 1999 074 0.0492 0.0820 -0.0030 0.0025 0.0020 0.0026
1999.2041 1999 075 0.0491 0.0827 -0.0006 0.0026 0.0021 0.0027
1999.2068 1999 076 0.0490 0.0821 -0.0015 0.0024 0.0019 0.0025
1999.2096 1999 077 0.0493 0.0828 0.0006 0.0024 0.0019 0.0026
1999.2123 1999 078 0.0496 0.0835 0.0008 0.0027 0.0021 0.0028
1999.2151 1999 079 0.0497 0.0827 0.0025 0.0026 0.0021 0.0028
1999.2178 1999 080 0.0489 0.0821 -0.0012 0.0025 0.0020 0.0026
...
Appendix B
Time-series Utilities
fk (t) = (t − tk ) (B.1)
• Polynomial
Python representation [’POLY’,[p1,p2,...,pN],[t1,t2,...,tN]]
is equivalent to sum([p1,..,pN])+N rows of the design matrix such
that
fi,k (t) = (t − ti )k i ∈ [0, 1, ..., pi ] (B.2)
• Power
Python representation [’POW’,[p1,p2,...,pN],[t1,t2,...,tN]] is
85
86 APPENDIX B. TIME-SERIES UTILITIES
• Exponential decay
Python representation [’EXP’,[t1,t2,...,tN],[tau1,tau2,...,tauN]]
is equivalent to N rows of the design matrix such that
t − tk
fk (t) = 1 − exp · u (t − tk ) (B.4)
τk
• Logarithmic decay
Python represetntation [’LOG’,[t1,t2,...,tN],[tau1,tau2,...,tauN]]
is equivalent to N rows of the design matrix such that
t − tk
fk (t) = log 1 + · u (t − tk ) (B.5)
τk
• Step function
Python representation [’STEP’,[t1,t2,...,tN]] is equivalent to N
rows of the design matrix such that
fk (t) = u (t − tk ) (B.6)
• Seasonal
Python representation [’SEASONAL’,[tau1,tau2,...,tauN]] is equiv-
alent to 2N rows of the design matrix such that
t
f2k−1 (t) = cos 2π
τk
t
f2k (t) = sin 2π (B.7)
τk
• B-Splines
Python representation [’BSPLINE’,[Ord1,...,OrdN],[n1,...,nN]]
is equivalent to prod([n1,...nN])*len(t) rows of the design ma-
trix. “Ordk ” represents the order and “nk ” represents the number of
equally spaced splines between minimum and maximum values of the
time vector.
• Integrated B-Splines
Python representation [’ISPLINE’,[Ord1,...,OrdN],[n1,...,nN]]
is equivalent to prod([n1,...nN])*len(t) rows of the design ma-
trix. “Ordk ” represents the order and “nk ” represents the number of
equally spaced splines between minimum and maximum values of the
time vector.
B.2. NETWORK UTILITIES 87
[’EXP’,[4.0,8.0],[1.0,3.0]],
[’BSPLINE’,[3],[16]],
[’LOG’,[2.0,9.0],[1.0,3.0]],
[’SEASONAL’,[0.5,1.0]],
[’ISPLINE’,[3],[16]]]
H,vname,rflag = tsutils.Timefn(rep,t)
H,vname,rflag = Timefn([’SBAS’,[masterind]])
We allow the users to choose a master scene other than first SAR acquisition
for formulation their time-series inversions. The users may need to make
minor adjustments to the returned matrix depending on the exact imple-
mentation of the inversion scheme. Examples of such adjustments can be
found in various SBAS-style scripts distributed with GIAnT.
• ConnMatrix(dates,sensor)
Creates the connectivity matrix [1, −1] for the interferogram network
using the dates and satellite sensor as inputs.
• conntoPairmat(Jmat)
Returns an edge list of interferograms using the connectivity matrix
as input.
• conntoAdjmat(Jmat)
Returns the adjacency matrix using the connectivity matrix as input.
• adjmattoAdjlist(Amat)
Returns the adjacency list using the adjacency matrix as input.
• simpleCycle(Jmat)
Returns a list of all simple cycles using the connectivity matrix as
input.
Appendix C
Image utilities
• mints.inpaint(matrixwithnans)
The routine inpaints nans in the input matrix similar to the in-
paint nans (http://www.mathworks.com/matlabcentral/fileexchange/
4551-inpaintnans) package developed by John D’ Errico. We have
only implemented the spring metaphor.
• mints.Mirrortodyadic(matrix, frac)
Mirrors the input matrix to a dyadic length such that a specfied frac-
tion is always mirrored. This is done to reduce edge effects in the
wavelet transforms. Mirroring fraction is typically 20%.
89
90 APPENDIX C. IMAGE UTILITIES
• estramp(phs,mask,poly)
Estimates the ramp polynomial for an unwrapped interferogram using
a mask. Poly can be either 1, 3 or 4.
• deramp(phs,ramppoly)
Deramping of interferograms using a polynomail. Poly can be of
length 1 (constant), 3 (Planar) or 4 (Product of linear terms).
• nanmean(x)
Returns the mean of an array while taking care of NaNs.
Appendix D
Wavelets
The original implementation of MInTS Hetland et al. [2011] used the Meyer
wavelet routines in the Wavelab850 package (http://www-stat.stanford.
edu/~wavelab) for all wavelet operations. We have rewritten the Meyer
wavelet routines in Python and have added new ones for analyzing rectan-
gular datasets. We have also added routines that efficiently compute the
impulse response and the reliability score of wavelet coefficients over inter-
polated holes. All routines related to the Meyer wavelet transforms can be
found in meyer.py.
We have also included support for different wavelet functions using the
pyWavelets package. The interface to meyer.py has been replicated for
these set of wavelet basis in wvlt.py. Though, we prefer to work with Meyer
wavelets in our work these other wavelets can be used in the development
of future applications.
In our approach, we use wavelets to reduce the effect of spatially cor-
related noise in the estimated time-series. We explicitly avoid interpreting
the information at various spatial scales as different components of defor-
mation/ orbits / atmosphere like Shirzaei and Walter [2011], as these may
be dependent on the family of wavelets used for analysis.
D.1 Convention
The original version of MInTS used cells to store matries of wavelet coef-
ficients. We have decided to retain all the wavelet coefficients in a single
2D matrix (same size as original data matrix) for faster access during time-
series inversions. This also allows us to use other features of MInTS directly
for time-series analysis of InSAR data directly, instead of the wavelet coeffi-
91
92 APPENDIX D. WAVELETS
[1,1] [1,MM]
II
NN
III IV
[NN,1] [NN,MM]
MM
D.2 Routines
The functions in our custom written Meyer wavelet library (meyer.py) are
• w = meyer.fwt2 meyer(matrix,degree,minscale)
2D wavelet transform of rectangular matrix. Scale definition is with
D.3. OTHER WAVELETS 93
• meyer.impulse resp(matrix.shape,fname)
Writes the impulse response for 2D wavelet transform for a matrix of
given shape to a specified HDF5 file. This is an important change to
MInTS and now allows us to apply MInTS to very large matrices with
ease. The impulse response for a matrix of given size (dyadic lengths)
must be computed and stored before the analysis of the wavelet coef-
ficients.
• wt = meyer.CoeffWeight(mask,responsefname)
Computes the reliability of wavelet coefficients using the mask of real
and interpolated data, and the HDF5 file containing the appropriate
impulse response as inputs.
• w = wvlt.fwt2(matrix,wvlt=’db12’)
• mat = wvlt.iwt2(matrix,wvlt=’db12’)
• wvlt.impulse resp(matrix.shape,fname,wvlt=’db12’)
• wt = wvlt.CoeffWeight(mask,responsefname,wvlt=’db12’)
Appendix E
Solvers
95
96 APPENDIX E. SOLVERS
97
98 BIBLIOGRAPHY
P. Wessel and W. Smith. New version of the generic mapping tools released.
Eos Trans. AGU, 76(329), 1995.