diff --git a/mintpy/bulk_plate_motion.py b/mintpy/bulk_plate_motion.py index 6010d7b6c..303a384c9 100755 --- a/mintpy/bulk_plate_motion.py +++ b/mintpy/bulk_plate_motion.py @@ -24,6 +24,7 @@ import os import sys +import collections import numpy as np from skimage.transform import resize @@ -42,6 +43,27 @@ raise ImportError(msg) +# ITRF2014-PMM defined in Altamimi et al. (2017) +# units: +# omega_x/y/z in mas/yr (milli-second of arc per year) +# omega in deg/Ma (degree per megayear or one-million-year) +# wrms_e/n in mm/yr (milli-meter per year), WRMS: weighted root mean scatter +Tag = collections.namedtuple('Tag', 'name num_site omega_x omega_y omega_z omega wrms_e wrms_n') +ITRF2014_PMM = { + 'ANTA' : Tag('Antartica' , 7, -0.248, -0.324, 0.675, 0.219, 0.20, 0.16), + 'ARAB' : Tag('Arabia' , 5, 1.154, -0.136, 1.444, 0.515, 0.36, 0.43), + 'AUST' : Tag('Australia' , 36, 1.510, 1.182, 1.215, 0.631, 0.24, 0.20), + 'EURA' : Tag('Eurasia' , 97, -0.085, -0.531, 0.770, 0.261, 0.23, 0.19), + 'INDI' : Tag('India' , 3, 1.154, -0.005, 1.454, 0.516, 0.21, 0.21), + 'NAZC' : Tag('Nazca' , 2, -0.333, -1.544, 1.623, 0.629, 0.13, 0.19), + 'NOAM' : Tag('N. America' , 72, 0.024, -0.694, -0.063, 0.194, 0.23, 0.28), + 'NUBI' : Tag('Nubia' , 24, 0.099, -0.614, 0.733, 0.267, 0.28, 0.36), + 'PCFC' : Tag('Pacific' , 18, -0.409, 1.047, -2.169, 0.679, 0.36, 0.31), + 'SOAM' : Tag('S. America' , 30, -0.270, -0.301, -0.140, 0.119, 0.34, 0.35), + 'SOMA' : Tag('Somalia' , 3, -0.121, -0.794, 0.884, 0.332, 0.32, 0.30), +} + + ######################################### Usage ############################################## REFERENCE = """reference: diff --git a/mintpy/geocode.py b/mintpy/geocode.py index a51990f49..bb4f82ac4 100755 --- a/mintpy/geocode.py +++ b/mintpy/geocode.py @@ -160,15 +160,26 @@ def _check_inps(inps): # 2. lookup table is in radar coordinates if inps.laloStep: if not inps.radar2geo: - print('ERROR: --lalo-step can NOT be used together with --geo2radar!') + print('ERROR: "--lalo-step" can NOT be used together with "--geo2radar"!') sys.exit(0) atr = readfile.read_attribute(inps.lookupFile) if 'Y_FIRST' in atr.keys(): - print('ERROR: --lalo-step can NOT be used with lookup table file in geo-coordinates!') + print('ERROR: "--lalo-step" can NOT be used with lookup table file in geo-coordinates!') sys.exit(0) # check 5 - number of processors for multiprocessingg inps.nprocs = check_num_processor(inps.nprocs) + + + # check 6 - geo2radar + if not inps.radar2geo: + if inps.SNWE: + print('ERROR: "--geo2radar" can NOT be used together with "--bbox"!') + sys.exit(0) + if inps.software == 'scipy': + print('ERROR: "--geo2radar" is NOT supported for "--software scipy"!') + sys.exit(0) + return inps diff --git a/mintpy/subset.py b/mintpy/subset.py index a64e2b592..f99fe69b9 100755 --- a/mintpy/subset.py +++ b/mintpy/subset.py @@ -121,7 +121,7 @@ def get_coverage_box(atr): width = int(atr['WIDTH']) # Get geo box - try: + if all(x in atr.keys() for x in ['Y_STEP', 'X_STEP', 'Y_FIRST', 'X_FIRST']): lat_step = float(atr['Y_STEP']) lon_step = float(atr['X_STEP']) ul_lat = float(atr['Y_FIRST']) @@ -129,16 +129,18 @@ def get_coverage_box(atr): lr_lat = ul_lat + lat_step*length lr_lon = ul_lon + lon_step*width geo_box = (ul_lon, ul_lat, lr_lon, lr_lat) - except ValueError: + else: geo_box = None # Get pixel box - try: - pix_box = (int(atr['SUBSET_XMIN']), - int(atr['SUBSET_YMIN']), - int(atr['SUBSET_XMAX']), - int(atr['SUBSET_YMAX'])) - except ValueError: + if all(f'SUBSET_{x}' in atr.keys() for x in ['YMIN', 'XMIN', 'YMAX', 'XMAX']): + pix_box = ( + int(atr['SUBSET_XMIN']), + int(atr['SUBSET_YMIN']), + int(atr['SUBSET_XMAX']), + int(atr['SUBSET_YMAX']), + ) + else: pix_box = None return pix_box, geo_box diff --git a/mintpy/utils/arg_utils.py b/mintpy/utils/arg_utils.py index 95d77efcb..609d1a235 100644 --- a/mintpy/utils/arg_utils.py +++ b/mintpy/utils/arg_utils.py @@ -172,7 +172,7 @@ def add_figure_argument(parser): action='store_false', help='do not display title') fig.add_argument('--title-in', dest='fig_title_in', action='store_true', help='draw title in/out of axes') - fig.add_argument('--figtitle', dest='fig_title', + fig.add_argument('--title','--fig-title','--figtitle', dest='fig_title', help='Title shown in the figure.') fig.add_argument('--title4sen','--title4sentinel1', dest='disp_title4sentinel1', action='store_true', help='display Sentinel-1 A/B and IPF info in title.') diff --git a/mintpy/version.py b/mintpy/version.py index a67899dcd..2409cc7e2 100644 --- a/mintpy/version.py +++ b/mintpy/version.py @@ -10,6 +10,7 @@ ########################################################################### Tag = collections.namedtuple('Tag', 'version date') release_history = ( + Tag('1.4.0', '2022-08-04'), Tag('1.3.3', '2022-04-14'), Tag('1.3.2', '2021-11-21'), Tag('1.3.1', '2021-08-02'),