Example #1
0
    'shadowMask': 'mintpy.load.shadowMaskFile',
    'waterMask': 'mintpy.load.waterMaskFile',
    'bperp': 'mintpy.load.bperpFile'
}

DEFAULT_TEMPLATE = """template:
########## 1. Load Data (--load to exit after this step)
{}\n
{}\n
{}""".format(
    auto_path.AUTO_PATH_GAMMA,
    auto_path.AUTO_PATH_ISCE_STRIPMAP,
    auto_path.AUTO_PATH_ISCE_TOPS,
)

TEMPLATE = get_template_content('load_data')

NOTE = """NOTE:
  For interferogram, unwrapPhase is required, the other dataset are optional, including coherence, connectComponent, wrapPhase, etc.
  The unwrapPhase metadata file requires DATE12 attribute in YYMMDD-YYMMDD format.
  All path of data file must contain the reference and secondary date, either in file name or folder name.
"""

EXAMPLE = """example:
  load_data.py -t GalapagosSenDT128.tempalte
  load_data.py -t smallbaselineApp.cfg
  load_data.py -t smallbaselineApp.cfg GalapagosSenDT128.tempalte --project GalapagosSenDT128
  load_data.py -H #Show example input template for ISCE/ROI_PAC/GAMMA products

  # load geometry only
  # fill metaFile, baselineDir and geometry datasets in the template and run load_data.py
Example #2
0
import argparse
import warnings
import numpy as np

from mintpy.objects.resample import resample
from mintpy.defaults.template import get_template_content
from mintpy.utils import (
    arg_group,
    readfile,
    writefile,
    utils as ut,
    attribute as attr,
)

######################################################################################
TEMPLATE = get_template_content('geocode')

EXAMPLE = """example:
  geocode.py velocity.h5
  geocode.py velocity.h5 -b -0.5 -0.25 -91.3 -91.1
  geocode.py velocity.h5 timeseries.h5 -t smallbaselineApp.cfg --outdir ./geo --update

  # radar-code file in geo coordinates
  geocode.py swbdLat_S02_N01_Lon_W092_W090.wbd -l geometryRadar.h5 -o waterMask.rdr --geo2radar
  geocode.py geo_velocity.h5 --geo2radar
"""

DEG2METER = """
degrees     --> meters on equator
0.000925926 --> 100
0.000555556 --> 60
Example #3
0
import h5py
import numpy as np

from mintpy.objects import timeseries, geometry, sensor
from mintpy.defaults.template import get_template_content
from mintpy.utils import ptime, readfile
from mintpy import info

BOOL_ZERO = np.bool_(0)
INT_ZERO = np.int16(0)
FLOAT_ZERO = np.float32(0.0)
CPX_ZERO = np.complex64(0.0)
COMPRESSION = 'lzf'

################################################################
TEMPALTE = TEMPLATE = get_template_content('hdfeos5')

EXAMPLE = """example:
  save_hdfeos5.py geo/geo_timeseries_ERA5_ramp_demErr.h5
  save_hdfeos5.py timeseries_ERA5_ramp_demErr.h5 --tc temporalCoherence.h5 --asc avgSpatialCoh.h5 -m maskTempCoh.h5 -g inputs/geometryGeo.h5
"""


def create_parser():
    parser = argparse.ArgumentParser(
        description='Convert MintPy timeseries product into HDF-EOS5 format\n'
        +
        '  https://earthdata.nasa.gov/esdis/eso/standards-and-references/hdf-eos5\n'
        + '  https://mintpy.readthedocs.io/en/latest/hdfeos5/',
        formatter_class=argparse.RawDescriptionHelpFormatter,
        epilog=TEMPALTE + '\n' + EXAMPLE)
Example #4
0
key_prefix = 'mintpy.networkInversion.'
configKeys = [
    'obsDatasetName', 'numIfgram', 'weightFunc', 'maskDataset',
    'maskThreshold', 'minRedundancy', 'minNormVelocity'
]

################################################################################################
EXAMPLE = """example:
  ifgram_inversion.py  inputs/ifgramStack.h5 -t smallbaselineApp.cfg --update
  ifgram_inversion.py  inputs/ifgramStack.h5 -w no  # turn off weight for fast processing
  ifgram_inversion.py. inputs/ifgramStack.h5 -c no  # turn off parallel processing
  # invert offset stack
  ifgram_inversion.py  inputs/ifgramStack.h5 -i azimuthOffset --water-mask waterMask.h5 --mask-dset offsetSNR --mask-threshold 5
"""

TEMPLATE = get_template_content('invert_network')

REFERENCE = """references:
  Berardino, P., Fornaro, G., Lanari, R., & Sansosti, E. (2002). A new algorithm for surface
    deformation monitoring based on small baseline differential SAR interferograms. IEEE TGRS,
    40(11), 2375-2383. doi:10.1109/TGRS.2002.803792
  Pepe, A., and R. Lanari (2006), On the extension of the minimum cost flow algorithm for phase unwrapping
    of multitemporal differential SAR interferograms, IEEE-TGRS, 44(9), 2374-2383.
  Perissin, D., and T. Wang (2012), Repeat-pass SAR interferometry with partially coherent targets, IEEE TGRS,
    50(1), 271-280, doi:10.1109/tgrs.2011.2160644.
  Samiei-Esfahany, S., J. E. Martins, F. v. Leijen, and R. F. Hanssen (2016), Phase Estimation for Distributed
    Scatterers in InSAR Stacks Using Integer Least Squares Estimation, IEEE TGRS, 54(10), 5671-5687.
  Seymour, M. S., and I. G. Cumming (1994), Maximum likelihood estimation for SAR interferometry, 1994.
    IGARSS '94., 8-12 Aug 1994.
  Yunjun, Z., H. Fattahi, and F. Amelung (2019), Small baseline InSAR time series analysis: Unwrapping error
    correction and noise reduction, Computers & Geosciences, 133, 104331, doi:10.1016/j.cageo.2019.104331.
Example #5
0
# Copyright (c) 2013, Zhang Yunjun, Heresh Fattahi         #
# Author: Zhang Yunjun, Heresh Fattahi, 2013               #
############################################################

import os
import sys
import argparse
import h5py
import numpy as np
import random
from mintpy.objects import timeseries
from mintpy.defaults.template import get_template_content
from mintpy.utils import readfile, writefile, utils as ut

#########################################  Usage  ##############################################
TEMPLATE = get_template_content('reference_point')

NOTE = """note: Reference value cannot be nan, thus, all selected reference point must be:
  a. non zero in mask, if mask is given
  b. non nan  in data (stack)
  
  Priority:
      input reference_lat/lon
      input reference_y/x
      input selection_method
      existing REF_Y/X attributes (can be ignored by --force option)
      default selection methods:
          maxCoherence
          random

  The recommended reference pixel should meets the following criteria:
Example #6
0
############################################################
# Program is part of MintPy                                #
# Copyright (c) 2013, Zhang Yunjun, Heresh Fattahi         #
# Author: Zhang Yunjun, 2017                               #
############################################################

import os
import argparse
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mintpy.defaults.template import get_template_content
from mintpy.utils import readfile, ptime, utils as ut, plot as pp

######################################################################################################
TEMPLATE = get_template_content('residual_RMS')

EXAMPLE = """example:
  timeseries_rms.py  timeseriesResidual.h5 
  timeseries_rms.py  timeseriesResidual.h5  --template smallbaselineApp.cfg
  timeseries_rms.py  timeseriesResidual.h5  -m maskTempCoh.h5  --cutoff 3
"""

REFERENCE = """reference:
Rousseeuw, P. J., and M. Hubert (2011), Robust statistics for outlier detection,
    Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 1(1),
    73-79, doi:doi:10.1002/widm.2.
"""


def create_parser():
Example #7
0
from mintpy.defaults.template import get_template_content
from mintpy.utils import ptime, readfile, writefile, utils as ut


# key configuration parameter name
key_prefix = 'mintpy.topographicResidual.'
configKeys = [
    'polyOrder',
    'phaseVelocity',
    'stepFuncDate',
    'excludeDate',
]


############################################################################
TEMPLATE = get_template_content('correct_topography')

EXAMPLE = """example:
  # correct DEM error with pixel-wise geometry parameters [slow]
  dem_error.py  timeseries_ERA5_ramp.h5 -g inputs/geometryRadar.h5 -t smallbaselineApp.cfg

  # correct DEM error with mean geometry parameters [fast]
  dem_error.py  timeseries_ERA5_ramp.h5 -t smallbaselineApp.cfg

  # get time-series of estimated deformation model
  diff.py timeseries_ERA5_ramp_demErr.h5 timeseriesResidual.h5 -o timeseriesDefModel.h5

  # get updated/corrected DEM
  save_roipac.py inputs/geometryGeo.h5 -o dem.h5   #for dataset in geo coordinates
  mask.py demErr.h5 -m maskTempCoh.h5 -o demErr_msk.h5
  add.py demErr_msk.h5 dem.h5 -o demNew.h5
Example #8
0
  unwrap_error_bridging.py  ./inputs/ifgramStack.h5  --water-mask waterMask.h5
  unwrap_error_bridging.py  20180502_20180619.unw    --water-mask waterMask.h5
"""

REFERENCE = """reference:
  Yunjun, Z., H. Fattahi, and F. Amelung (2019), Small baseline InSAR time series analysis:
  Unwrapping error correction and noise reduction, Computers & Geosciences, 133, 104331,
  doi:10.1016/j.cageo.2019.104331.
"""

NOTE = """
  by connecting reliable regions with MST bridges. This method assumes the phase differences
  between neighboring regions are less than pi rad in magnitude.
"""

TEMPLATE = get_template_content('correct_unwrap_error')


def create_parser():
    parser = argparse.ArgumentParser(
        description='Unwrapping Error Correction with Bridging' + NOTE,
        formatter_class=argparse.RawTextHelpFormatter,
        epilog=REFERENCE + '\n' + TEMPLATE + '\n' + EXAMPLE)

    parser.add_argument('ifgram_file',
                        type=str,
                        help='interferograms file to be corrected')
    parser.add_argument(
        '-r',
        '--radius',
        dest='bridgePtsRadius',
Example #9
0
    plot as pp,
)

###############################  Usage  ################################
REFERENCE = """reference:
  Yunjun, Z., H. Fattahi, and F. Amelung (2019), Small baseline InSAR time series analysis: 
  Unwrapping error correction and noise reduction, Computers & Geosciences, 133, 104331,
  doi:10.1016/j.cageo.2019.104331.

  Chaussard, E., R. Bürgmann, H. Fattahi, R. M. Nadeau, T. Taira, C. W. Johnson, and I. Johanson
  (2015), Potential for larger earthquakes in the East San Francisco Bay Area due to the direct 
  connection between the Hayward and Calaveras Faults, Geophysical Research Letters, 42(8),
  2734-2741, doi:10.1002/2015GL063575.
"""

TEMPLATE = get_template_content('modify_network')

EXAMPLE = """example:
  modify_network.py inputs/ifgramStack.h5 -t smallbaselineApp.cfg
  modify_network.py inputs/ifgramStack.h5 --reset
  modify_network.py inputs/ifgramStack.h5 --manual
"""


def create_parser():
    parser = argparse.ArgumentParser(
        description='Modify the network of interferograms',
        formatter_class=argparse.RawTextHelpFormatter,
        epilog=REFERENCE + '\n' + TEMPLATE + '\n' + EXAMPLE)
    parser.add_argument(
        'file',
Example #10
0
############################################################################
EXAMPLE = """example:
  timeseries2velocity.py  timeseries_ERA5_demErr.h5
  timeseries2velocity.py  timeseries_ERA5_demErr_ramp.h5  -t smallbaselineApp.cfg --update
  timeseries2velocity.py  timeseries_ERA5_demErr_ramp.h5  -t KyushuT73F2980_2990AlosD.template
  timeseries2velocity.py  timeseries.h5  --start-date 20080201
  timeseries2velocity.py  timeseries.h5  --start-date 20080201  --end-date 20100508
  timeseries2velocity.py  timeseries.h5  --exclude-date exclude_date.txt

  timeseries2velocity.py  LS-PARAMS.h5
  timeseries2velocity.py  NSBAS-PARAMS.h5
  timeseries2velocity.py  TS-PARAMS.h5
"""

TEMPLATE = get_template_content('velocity')

DROP_DATE_TXT = """exclude_date.txt:
20040502
20060708
20090103
"""


def create_parser():
    parser = argparse.ArgumentParser(
        description='Inverse velocity from time-series.',
        formatter_class=argparse.RawTextHelpFormatter,
        epilog=TEMPLATE + '\n' + EXAMPLE)

    parser.add_argument('timeseries_file',
Example #11
0
import os
import sys
import time
import shutil
import argparse
import h5py
import numpy as np

from mintpy.objects import timeseries
from mintpy.objects.cluster import split_box2sub_boxes
from mintpy.defaults.template import get_template_content
from mintpy.utils import arg_group, readfile, writefile, ptime, utils as ut

##################################################################
TEMPLATE = get_template_content('reference_date')

EXAMPLE = """example:
  reference_date.py timeseries.h5 timeseries_ERA5.h5 timeseries_ERA5_demErr.h5 --template smallbaselineApp.cfg
  reference_date.py timeseries_ERA5_demErr.h5 --ref-date 20050107
"""


def create_parser():
    parser = argparse.ArgumentParser(
        description='Change reference date of timeseries.',
        formatter_class=argparse.RawTextHelpFormatter,
        epilog=TEMPLATE + '\n' + EXAMPLE)

    parser.add_argument('timeseries_file',
                        nargs='+',
  This method assumes:
  a. abundance of network: for interferogram with unwrapping error, there is
     at least of one triangular connection to form a closed circle; with more
     closed circles comes better constrain.
  b. majority rightness: most of interferograms have to be right (no unwrapping
     error) to correct the wrong minority. And if most of interferograms have 
     unwrapping errors, then the minor right interferograms will turn into wrong.
"""

REFERENCE = """reference:
  Yunjun, Z., H. Fattahi, and F. Amelung (2019), Small baseline InSAR time series analysis:
  Unwrapping error correction and noise reduction, Computers & Geosciences, 133, 104331,
  doi:10.1016/j.cageo.2019.104331.
"""

TEMPLATE1 = get_template_content('quick_overview')
TEMPLATE2 = get_template_content('correct_unwrap_error')


def create_parser():
    parser = argparse.ArgumentParser(
        description='Unwrapping Error Correction based on Phase Closure' +
        NOTE,
        formatter_class=argparse.RawTextHelpFormatter,
        epilog=REFERENCE + '\n' + TEMPLATE1 + '\n' + TEMPLATE2 + '\n' +
        EXAMPLE)

    parser.add_argument('ifgram_file',
                        help='interferograms file to be corrected')
    parser.add_argument(
        '-c',
Example #13
0
    raise ImportError(
        'Can not import pysolid! Check https://github.com/insarlab/PySolid.')

from mintpy.objects import timeseries
from mintpy.objects.resample import resample
from mintpy.defaults.template import get_template_content
from mintpy.utils import (
    ptime,
    readfile,
    writefile,
    utils as ut,
    attribute as attr,
)

###############################################################
TEMPLATE = get_template_content('correct_SET')

EXAMPLE = """example:
  solid_earth_tides.py timeseries.h5 -g inputs/geometryRadar.h5
  solid_earth_tides.py timeseries.h5 -g inputs/geometryGeo.h5
  solid_earth_tides.py geo/geo_timeseries_ERA5_demErr.h5 -g geo/geo_geometryRadar.h5
"""

REFERENCE = """reference:
  Milbert, D., SOLID EARTH TIDE, http://geodesyworld.github.io/SOFTS/solid.htm, Accessd 2020 September 6.
  Fattahi, H., Z. Yunjun, X. Pi, P. S. Agram, P. Rosen, and Y. Aoki (2020), Absolute geolocation of SAR 
    Big-Data: The first step for operational InSAR time-series analysis, AGU Fall Meeting 2020, 1-17 Dec 2020.
"""


def create_parser():
Example #14
0
############################################################
# Based on the empirical model of Marinkovic and Larsen (2013),
# the LOD correction for each pixel is given in meters as:
#     C = 3.87e-7 * x * range_pixel_size_in_meter * time_difference_in_year
# where x is the pixel count in range direction

import os
import sys
import argparse
import numpy as np
from mintpy.objects import timeseries
from mintpy.defaults.template import get_template_content
from mintpy.utils import readfile, writefile, ptime

#########################################################################################
TEMPLATE = get_template_content('correct_LOD')

EXAMPLE = """example:
  local_oscilator_drift.py  timeseries.h5                 inputs/geometryRadar.h5
  local_oscilator_drift.py  filt_101020_110220_4rlks.unw  inputs/geometryRadar.h5
"""

REFERENCE = """reference:
  Marinkovic, P., and Y. Larsen (2013), Consequences of long-term ASAR local oscillator 
  frequency decay - An empirical study of 10 years of data, in Living Planet Symposium,
  Edinburgh, U.K.
"""


def create_parser():
    parser = argparse.ArgumentParser(