-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add
prep_nisar
to load NISAR GUNW products (#1035)
* add `prep_nisar.py` and `cli/prep_nisar.py` to prepare and load NISAR GUNW products into HDF5/MintPy format. * add `prep_nisar` to `setup` and `__main__` --------- Co-authored-by: Scott Staniewicz <[email protected]> Co-authored-by: Zhang Yunjun <[email protected]>
- Loading branch information
1 parent
7ff149b
commit ce93e2e
Showing
7 changed files
with
558 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#!/usr/bin/env python | ||
############################################################ | ||
# Program is part of MintPy # | ||
# Copyright (c) 2013, Zhang Yunjun, Heresh Fattahi # | ||
# Author: Sara Mirzaee, Jul 2023 # | ||
############################################################ | ||
|
||
import sys | ||
|
||
from mintpy.utils.arg_utils import create_argument_parser | ||
|
||
############################################################ | ||
EXAMPLE = """example: | ||
prep_nisar.py -i 'interferograms/stitched/*.h5' -d dem.tiff | ||
""" | ||
|
||
def create_parser(subparsers=None): | ||
"""Command line parser.""" | ||
synopsis = 'Prepare NISAR GUNW products for MintPy.' | ||
epilog = EXAMPLE | ||
name = __name__.split('.')[-1] | ||
parser = create_argument_parser( | ||
name, synopsis=synopsis, description=synopsis, epilog=epilog, subparsers=subparsers) | ||
|
||
parser.add_argument( | ||
"-i", | ||
"--input-file-glob", | ||
dest='input_glob', | ||
type=str, | ||
default="./interferograms/NISAR*.h5", | ||
help="path pattern of NISAR interferograms (default: %(default)s).", | ||
) | ||
|
||
parser.add_argument( | ||
"-d", | ||
"--dem-file", | ||
dest="dem_file", | ||
type=str, | ||
default="./dem.tif", | ||
help="path to the DEM (default: %(default)s).", | ||
) | ||
|
||
parser.add_argument( | ||
"-o", | ||
"--out-dir", | ||
dest="out_dir", | ||
type=str, | ||
default="./mintpy", | ||
help="output directory (default: %(default)s).", | ||
) | ||
|
||
parser.add_argument( | ||
'--force', | ||
dest='update_mode', | ||
action='store_false', | ||
help='Force to overwrite all .rsc metadata files.' | ||
) | ||
parser.add_argument( | ||
'--sub-lat', | ||
'--sublat', | ||
'--subset-lat', | ||
dest='subset_lat', | ||
type=float, | ||
nargs=2, | ||
metavar=('LATMIN', 'LATMAX'), | ||
help='subset in latitude' | ||
) | ||
|
||
parser.add_argument( | ||
'--sub-lon', | ||
'--sublon', | ||
'--subset-lon', | ||
dest='subset_lon', | ||
type=float, | ||
nargs=2, | ||
metavar=('LONMIN', 'LONMAX'), | ||
help='subset in longitude' | ||
) | ||
|
||
return parser | ||
|
||
|
||
def cmd_line_parse(iargs=None): | ||
"""Create the command line parser.""" | ||
parser = create_parser() | ||
inps = parser.parse_args(args=iargs) | ||
|
||
return inps | ||
|
||
#################################################################################### | ||
def main(iargs=None): | ||
# parse | ||
inps = cmd_line_parse(iargs) | ||
|
||
# import | ||
from mintpy.prep_nisar import load_nisar | ||
|
||
# run | ||
load_nisar(inps) | ||
|
||
|
||
#################################################################################### | ||
if __name__=="__main__": | ||
main(sys.argv[1:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.