Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add prep nisar #4

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
89c1611
add prep nisar
Jun 29, 2023
e054eff
Use arbitrary bounding box in lat/lon
Jun 29, 2023
a2ba92a
Use speed of light from mintpy constants
mirzaees Jun 29, 2023
dae973f
remove extra line
mirzaees Jun 29, 2023
b9910dc
Use earth radius from mintpy constants
mirzaees Jun 29, 2023
2a765a6
import constants from mintpy
mirzaees Jun 29, 2023
530ca9d
account for half a pixel difference in origin of the coordinates
Jun 30, 2023
33e017c
correct x-first to be the upper left pixel
Jul 1, 2023
7476d0f
pyupgrade: v3.7.0 → v3.8.0 (#1039)
pre-commit-ci[bot] Jul 4, 2023
ccff336
add prep_nisar to setup and __main__
yunjunz Jul 5, 2023
cb52331
Update __main__.py
yunjunz Jul 5, 2023
2115549
fix bug in gdal -> mintpy corner coordinate convention (#1034)
sssangha Jul 5, 2023
a1db4bf
pyupgrade: v3.8.0 → v3.9.0 (#1043)
pre-commit-ci[bot] Jul 11, 2023
f1fc2e9
readfile: generalize gamma LUT file ext + ~pi value handling
yunjunz Jun 20, 2023
97fcad7
bugfix in geocode.py --bbox option for gamma products
yunjunz Jun 21, 2023
3a646ae
pyupgrade: v3.9.0 → v3.10.1 (#1051)
pre-commit-ci[bot] Aug 1, 2023
fec802b
hdfeos5: calc/write latitude/longitude if missing in geometry file (#…
yunjunz Aug 1, 2023
308024a
convert coord btw. UTM and lat/lon (#1052)
yunjunz Aug 1, 2023
6cd22a7
fix the UTM_ZONE confusion (#1053)
yunjunz Aug 3, 2023
5d330ad
isce_utils: add filter_goldstein() (#1058)
yunjunz Aug 6, 2023
1c8e7a1
tsview --figsize-img & relaxed subset tmpl reading (#1059)
yunjunz Aug 6, 2023
b74fffc
`load2hdf5 --compression` & `view --faultline-min-dist` (#1062)
yunjunz Aug 7, 2023
2af3905
read_attribute: translate DATA_TYPE ci2 to float32 for roipac (#1064)
yunjunz Aug 8, 2023
0cd227b
tropo_pyaps3: bugfix for hyp3 product (#1061)
yunjunz Aug 8, 2023
6605a95
seq. closure phase: bring back spatial referencing for ARIA products …
yunjunz Aug 9, 2023
23b87d9
dep/doc: add tab completion via `argcomplete` (#1065)
yunjunz Aug 9, 2023
559b8d7
fix zero step size bug in unwrap_error_phase_closure (#1067)
yunjunz Aug 9, 2023
29d901d
`isce_utils.extract_multilook_number()`: search XML and VRT files (#1…
yunjunz Aug 9, 2023
62b369d
dep: add shapely (#1069)
yunjunz Aug 10, 2023
4f09c58
tsview: improved auto figsize for geocoded TS file (#1071)
yunjunz Aug 15, 2023
11a9020
`read_gdal`: switch back to gdal kwargs to leverage its subsetting ca…
scottstanie Aug 19, 2023
f068ec5
`view.prep_slice()`: support quoted lists of characters as inputs (#1…
yunjunz Aug 23, 2023
136e67e
`mintpy.geocode.laloStep`: support single value input (#1075)
yunjunz Aug 23, 2023
b800d64
`subset`: support hdf5 <--> binary (#1076)
yunjunz Aug 23, 2023
1493c9a
`prep_hyp3`: support burst-wide interferograms from hyp3-isce2 (#1074)
cirrusasf Aug 25, 2023
09daaac
Correct example command line
mirzaees Aug 28, 2023
7ff149b
Run `fix_typos.sh` on repo to catch spelling errors (#1082)
scottstanie Aug 30, 2023
183819d
Merge branch 'main' into prep_script_for_NISAR
yunjunz Aug 31, 2023
018ddbd
pre-commit suggestions
yunjunz Aug 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
view.prep_slice(): support quoted lists of characters as inputs (in…
…sarlab#1077)

+ view.prep_slice(): support quoted lists of characters as inputs so that its parsing behavior is the same as the one in command line
  • Loading branch information
yunjunz committed Aug 23, 2023
commit f068ec5a5009419abf7ce28e9ae66657b9beb7f9
34 changes: 32 additions & 2 deletions src/mintpy/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def prep_slice(cmd, auto_fig=False):

cmd = 'view.py geo_velocity.h5 velocity --mask geo_maskTempCoh.h5 --dem srtm1.dem --dem-nocontour '
cmd += f'--sub-lon {W} {E} --sub-lat {S} {N} -c jet -v -3 10 '
cmd += '--cbar-loc bottom --cbar-nbins 3 --cbar-ext both --cbar-size 5% '
cmd += '--cbar-loc bottom --cbar-nbins 3 --cbar-ext both --cbar-label "LOS velocity [cm/year]" '
cmd += '--lalo-step 0.2 --lalo-loc 1 0 1 0 --scalebar 0.3 0.80 0.05 --notitle'

data, atr, inps = prep_slice(cmd)
Expand All @@ -350,7 +350,37 @@ def prep_slice(cmd, auto_fig=False):
"""
# parse
from mintpy.cli.view import cmd_line_parse
inps = cmd_line_parse(cmd.split()[1:])
iargs = cmd.split()[1:]

# support option inputs of a list of characters (separated by whitespaces but quoted)
# e.g.: --cbar-label "LOS velocity [cm/yar]" --title "S1 asc. velocity"
# to be consistent with the behavior in command line parsing
if any(x.startswith(('"', '\'')) for x in iargs):
# backup and reset
temp_iargs = list(iargs)
iargs = []

# get index of quoted list of characters
ind0s = np.where([x.startswith(('"', '\'')) for x in temp_iargs])[0]
ind1s = np.where([x.endswith(('"', '\'')) for x in temp_iargs])[0]
for i, temp_iarg in enumerate(temp_iargs):
if any(ind0 <= i <= ind1 for ind0, ind1 in zip(ind0s, ind1s)):
# quoted list of characters
for ind0, ind1 in zip(ind0s, ind1s):
if i == ind0:
temp = temp_iarg[1:]
elif ind0 < i < ind1:
temp += ' ' + temp_iarg
elif i == ind1:
temp += ' ' + temp_iarg[:-1]
iargs.append(temp)
break
else:
# regular unquoted list of characters
iargs.append(temp_iarg)

# run parse
inps = cmd_line_parse(iargs)

global vprint
vprint = print if inps.print_msg else lambda *args, **kwargs: None
Expand Down