Skip to content

Commit c7c9ca4

Browse files
authored
wrap up for version 1.5.3 (#1120)
+ src/mintpy/version.py: add tag for version 1.5.3 + simulation/fractal: fix np.abs(dtype) bug due to numpy behavior change + plot_network: fine-tune coh mat fig size for long time series + scripts/fix_typos.sh: use github.com instead of raw.githubusercontent.com for spelling.dat URL - use the github.com url for the spelling.dat file, as downloading raw.githubusercontent.com files in China does not work well - check gdal_dict.txt file instead of the ./fix_typos dir, so that one could run the script without deleting the ./fix_typos directory - add more words to the AUTHORIZED_LIST + fix some typos by running scripts/fix_typos.sh + docs/installation.md: add deprecation note for macports
1 parent 3ccba02 commit c7c9ca4

File tree

10 files changed

+36
-30
lines changed

10 files changed

+36
-30
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dist/
1919
downloads/
2020
eggs/
2121
.eggs/
22+
fix_typos/
2223
lib/
2324
lib64/
2425
parts/

docs/installation.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mamba install -c conda-forge mintpy
1919
</details>
2020

2121
<details>
22-
<p><summary>via docker</summary></p>
22+
<p><summary>or via docker</summary></p>
2323

2424
Docker allows one to run MintPy in a dedicated container, which is essentially an efficient virtual machine, and to be independent of the platform OS. First, install <a href="https://docs.docker.com/install">docker</a> if you have not already done so. Then run the following to pull the latest stable released container image version from <a href="https://github.com/insarlab/MintPy/pkgs/container/mintpy">MintPy GitHub Container Registry</a> to your local machine:
2525

@@ -31,7 +31,7 @@ docker pull ghcr.io/insarlab/mintpy:latest
3131
</details>
3232

3333
<details>
34-
<p><summary>via apt (Linux Debian)</summary></p>
34+
<p><summary>or via apt (for Linux Debian)</summary></p>
3535

3636
MintPy is available in the main archive of the <a href="https://tracker.debian.org/pkg/mintpy">Debian</a> GNU/Linux OS. It can be installed by using your favorite package manager or running the following command:
3737

@@ -79,7 +79,6 @@ bash Miniconda3-latest-Linux-x86_64.sh -b -p ~/tools/miniconda3
7979
Install the dependencies into a custom existing environment [recommended] by running:
8080

8181
```bash
82-
# To create a new custom environment, e.g. named "insar", run "conda create --name insar; conda activate insar"
8382
# To speedup, try "conda install mamba", then use "mamba install" to replace "conda install" below
8483

8584
# Add "gdal'>=3'" below to install extra dependencies if you use ARIA, FRInGE, HyP3 or GMTSAR
@@ -89,13 +88,13 @@ conda install -c conda-forge --file ~/tools/MintPy/requirements.txt
8988

9089
<p>
9190
<details>
92-
<p><summary>Or install the dependencies to a new environment, e.g. named "mintpy", by running:</summary></p>
91+
<p><summary>Or install the dependencies to a new environment, e.g. named "insar", by running:</summary></p>
9392

9493
```bash
9594
# Add "gdal'>=3'" below to install extra dependencies if you use ARIA, FRInGE, HyP3 or GMTSAR
9695
# Add "isce2" below to install extra dependencies if you use ISCE-2
97-
conda create --name mintpy --file ~/tools/MintPy/requirements.txt
98-
conda activate mintpy
96+
conda create --name insar --file ~/tools/MintPy/requirements.txt
97+
conda activate insar
9998
```
10099
</details>
101100
</p>
@@ -113,7 +112,7 @@ python -m pip install -e ~/tools/MintPy
113112
</details>
114113

115114
<details>
116-
<p><summary>via path setup</summary></p>
115+
<p><summary>or via path setup</summary></p>
117116

118117
Add below in your source file, e.g. <code>\~/.bash_profile</code> for <em>bash</em> users or <code>\~/.cshrc</code> for <em>csh/tcsh</em> users:
119118

@@ -152,7 +151,7 @@ sudo xcodebuild -license</code></pre>
152151
<details>
153152
<p><summary>Or install MintPy via MacPorts</summary></p>
154153

155-
Same as the instruction for Linux, except for the "b. Install dependencies" section, which is as below:
154+
Same as the instruction for Linux, except for the "b. Install dependencies" section, which is as below. Note that the installation procedure via MacPorts has not been maintained since Sep 2022, and will likely be phased out at some point, since conda/mamba works seamlessly on both MacOS and Linux.
156155

157156
Install <a href="https://www.macports.org/install.php">macports</a> if you have not done so. Add the following at the bottom of your <code>~/.bash_profile</code> file:
158157

scripts/fix_typos.sh

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,35 +45,39 @@ esac
4545
GDAL_ROOT=$SCRIPT_DIR/..
4646
cd "$GDAL_ROOT"
4747

48-
if ! test -d fix_typos; then
48+
if [ ! -f fix_typos/gdal_dict.txt ]; then
4949
# Get our fork of codespell that adds --words-white-list and full filename support for -S option
50-
mkdir fix_typos
51-
(cd fix_typos
52-
git clone https://github.com/rouault/codespell
53-
(cd codespell && git checkout gdal_improvements)
54-
# Aggregate base dictionary + QGIS one + Debian Lintian one
55-
curl https://raw.githubusercontent.com/qgis/QGIS/master/scripts/spell_check/spelling.dat | sed "s/:/->/" | sed "s/:%//" | grep -v "colour->" | grep -v "colours->" > qgis.txt
56-
curl https://salsa.debian.org/lintian/lintian/-/raw/master/data/spelling/corrections | grep "||" | grep -v "#" | sed "s/||/->/" > debian.txt
57-
cat codespell/data/dictionary.txt qgis.txt debian.txt | awk 'NF' > gdal_dict.txt
58-
echo "difered->deferred" >> gdal_dict.txt
59-
echo "differed->deferred" >> gdal_dict.txt
60-
grep -v 404 < gdal_dict.txt > gdal_dict.txt.tmp
61-
mv gdal_dict.txt.tmp gdal_dict.txt
50+
mkdir -p fix_typos
51+
(
52+
cd fix_typos
53+
if [ ! -d codespell ]; then
54+
git clone https://github.com/rouault/codespell
55+
fi
56+
(cd codespell && git checkout gdal_improvements)
57+
# Aggregate base dictionary + QGIS one + Debian Lintian one
58+
curl https://github.com/qgis/QGIS/blob/master/scripts/spell_check/spelling.dat | sed "s/:/->/" | sed "s/:%//" | grep -v "colour->" | grep -v "colours->" > qgis.txt
59+
curl https://salsa.debian.org/lintian/lintian/-/raw/master/data/spelling/corrections | grep "||" | grep -v "#" | sed "s/||/->/" > debian.txt
60+
cat codespell/data/dictionary.txt qgis.txt debian.txt | awk 'NF' > gdal_dict.txt
61+
echo "difered->deferred" >> gdal_dict.txt
62+
echo "differed->deferred" >> gdal_dict.txt
63+
grep -v 404 < gdal_dict.txt > gdal_dict.txt.tmp
64+
mv gdal_dict.txt.tmp gdal_dict.txt
6265
)
6366
fi
6467

6568
EXCLUDED_FILES="*/.svn*,*/.git/*,configure,config.log,config.status,config.guess,config.sub,*/autom4te.cache/*,*.ai,*.svg"
69+
if [ -z ${AUTHORIZED_LIST+x} ]; then export AUTHORIZED_LIST=""; fi
6670
AUTHORIZED_LIST="$AUTHORIZED_LIST,te" # gdalwarp switch
6771
AUTHORIZED_LIST="$AUTHORIZED_LIST,LaTeX,BibTeX"
6872
AUTHORIZED_LIST="$AUTHORIZED_LIST,ALOS,Alos"
6973
AUTHORIZED_LIST="$AUTHORIZED_LIST,lon,Lon,LON"
7074
# New Mintpy ones
7175
AUTHORIZED_LIST="$AUTHORIZED_LIST,alos,ALOS,alosStack"
72-
AUTHORIZED_LIST="$AUTHORIZED_LIST,NED"
76+
AUTHORIZED_LIST="$AUTHORIZED_LIST,NED,LOD,Lod,lod"
7377
AUTHORIZED_LIST="$AUTHORIZED_LIST,waterMask,watermask"
7478
AUTHORIZED_LIST="$AUTHORIZED_LIST,smallbaselineApp"
7579
AUTHORIZED_LIST="$AUTHORIZED_LIST,Nealy" # Author in reference
7680

77-
python fix_typos/codespell/codespell.py -w -i 3 -q 2 -S "$EXCLUDED_FILES,./autotest/*,./build*/*" \
81+
python fix_typos/codespell/codespell.py -w -i 3 -q 2 -S "$EXCLUDED_FILES,./autotest/*,./build*/*,./fix_typos/*" \
7882
--words-white-list="$AUTHORIZED_LIST" \
7983
-D ./fix_typos/gdal_dict.txt .

scripts/run_stripmap_stack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# clean folders before re-run
44
if [ -d "Igrams" ]; then
5-
echo "clean obsolete files/folders before reruning"
5+
echo "clean obsolete files/folders before rerunning"
66
rm -r baselines/ configs/ coregSLC/ geom_reference/ Igrams/ merged/ offsets/ refineSecondaryTiming/ run_files/ SLC/
77
rm run_unPackALOS
88
cd download

src/mintpy/cli/view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def cmd_line_parse(iargs=None):
150150
parser.error("--dem-blend requires -d/-dem.")
151151
# --cbar-ext option is ignored
152152
if '--cbar-ext' in inps.argv:
153-
print('WARNING: --cbar-ext is NOT compatiable with --dem-blend, ignore --cbar-ext and continue.')
153+
print('WARNING: --cbar-ext is NOT compatible with --dem-blend, ignore --cbar-ext and continue.')
154154

155155
# check: conflicted options (geo-only options if inpput file is in radar-coordinates)
156156
geo_opt_names = ['--coord', '--show-gps', '--coastline', '--lalo-label', '--lalo-step', '--scalebar', '--faultline']

src/mintpy/data/colormaps/differences.cpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# GMT colour palette table (cpt)
2-
# grass2cpt ouput
2+
# grass2cpt output
33
# COLOR_MODEL = RGB
44
-1.000000e+00 0 0 255 0.000000e+00 255 255 255
55
0.000000e+00 255 255 255 1.000000e+00 255 0 0

src/mintpy/plot_network.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ def plot_network(inps):
207207
print(f'save figure to {fig_names[2]}')
208208

209209
# Fig 3 - Coherence Matrix
210-
fig, ax = plt.subplots(figsize=[max(inps.fig_size), max(inps.fig_size)])
210+
fig_size3 = np.mean(inps.fig_size)
211+
fig, ax = plt.subplots(figsize=[fig_size3, fig_size3])
211212
ax = pp.plot_coherence_matrix(
212213
ax,
213214
inps.date12List,

src/mintpy/simulation/fractal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def fractal_surface_atmos(shape=(128, 128), resolution=60., p0=1., freq0=1e-3,
121121
# get the fractal spectrum and transform to spatial domain
122122
Hfrac = np.divide(H, fraction)
123123
fsurf = pyfftw.interfaces.numpy_fft.ifft2(Hfrac)
124-
fsurf = np.abs(fsurf, dtype=np.float32)
124+
fsurf = np.abs(fsurf).astype(np.float32)
125125
fsurf -= np.mean(fsurf)
126126

127127
# calculate the power spectral density of 1st realization
@@ -130,7 +130,7 @@ def fractal_surface_atmos(shape=(128, 128), resolution=60., p0=1., freq0=1e-3,
130130
# scale the spectrum to match the input power spectral density.
131131
Hfrac *= np.sqrt(p0/p1)
132132
fsurf = pyfftw.interfaces.numpy_fft.ifft2(Hfrac)
133-
fsurf = np.abs(fsurf, dtype=np.float32)
133+
fsurf = np.abs(fsurf).astype(np.float32)
134134
fsurf -= np.mean(fsurf)
135135
return fsurf
136136

src/mintpy/utils/plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2217,7 +2217,7 @@ def prep_blend_image(data, dem, vmin=None, vmax=None, cmap='viridis',
22172217
vert_exag=vert_exag,
22182218
)
22192219

2220-
# add tranparency layer to the array (defualt: all ones = opaque)
2220+
# add tranparency layer to the array (default: all ones = opaque)
22212221
illum_rgb = np.dstack([illum_rgb, np.ones_like(illum_rgb[:, :, 0])])
22222222

22232223
## masking the shaded-relief image:

src/mintpy/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
###########################################################################
99
Tag = collections.namedtuple('Tag', 'version date')
1010
release_history = (
11+
Tag('1.5.3', '2023-11-23'),
1112
Tag('1.5.2', '2023-08-09'),
1213
Tag('1.5.1', '2023-01-03'),
1314
Tag('1.5.0', '2022-11-18'),

0 commit comments

Comments
 (0)