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

wrap up for version 1.5.3 #1120

Merged
merged 4 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dist/
downloads/
eggs/
.eggs/
fix_typos/
lib/
lib64/
parts/
Expand Down
15 changes: 7 additions & 8 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mamba install -c conda-forge mintpy
</details>

<details>
<p><summary>via docker</summary></p>
<p><summary>or via docker</summary></p>

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:

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

<details>
<p><summary>via apt (Linux Debian)</summary></p>
<p><summary>or via apt (for Linux Debian)</summary></p>

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:

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

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

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

<p>
<details>
<p><summary>Or install the dependencies to a new environment, e.g. named "mintpy", by running:</summary></p>
<p><summary>Or install the dependencies to a new environment, e.g. named "insar", by running:</summary></p>

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

<details>
<p><summary>via path setup</summary></p>
<p><summary>or via path setup</summary></p>

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:

Expand Down Expand Up @@ -152,7 +151,7 @@ sudo xcodebuild -license</code></pre>
<details>
<p><summary>Or install MintPy via MacPorts</summary></p>

Same as the instruction for Linux, except for the "b. Install dependencies" section, which is as below:
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.

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:

Expand Down
34 changes: 19 additions & 15 deletions scripts/fix_typos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,35 +45,39 @@ esac
GDAL_ROOT=$SCRIPT_DIR/..
cd "$GDAL_ROOT"

if ! test -d fix_typos; then
if [ ! -f fix_typos/gdal_dict.txt ]; then
# Get our fork of codespell that adds --words-white-list and full filename support for -S option
mkdir fix_typos
(cd fix_typos
git clone https://github.com/rouault/codespell
(cd codespell && git checkout gdal_improvements)
# Aggregate base dictionary + QGIS one + Debian Lintian one
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
curl https://salsa.debian.org/lintian/lintian/-/raw/master/data/spelling/corrections | grep "||" | grep -v "#" | sed "s/||/->/" > debian.txt
cat codespell/data/dictionary.txt qgis.txt debian.txt | awk 'NF' > gdal_dict.txt
echo "difered->deferred" >> gdal_dict.txt
echo "differed->deferred" >> gdal_dict.txt
grep -v 404 < gdal_dict.txt > gdal_dict.txt.tmp
mv gdal_dict.txt.tmp gdal_dict.txt
mkdir -p fix_typos
(
cd fix_typos
if [ ! -d codespell ]; then
git clone https://github.com/rouault/codespell
fi
(cd codespell && git checkout gdal_improvements)
# Aggregate base dictionary + QGIS one + Debian Lintian one
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
curl https://salsa.debian.org/lintian/lintian/-/raw/master/data/spelling/corrections | grep "||" | grep -v "#" | sed "s/||/->/" > debian.txt
cat codespell/data/dictionary.txt qgis.txt debian.txt | awk 'NF' > gdal_dict.txt
echo "difered->deferred" >> gdal_dict.txt
echo "differed->deferred" >> gdal_dict.txt
grep -v 404 < gdal_dict.txt > gdal_dict.txt.tmp
mv gdal_dict.txt.tmp gdal_dict.txt
)
fi

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

python fix_typos/codespell/codespell.py -w -i 3 -q 2 -S "$EXCLUDED_FILES,./autotest/*,./build*/*" \
python fix_typos/codespell/codespell.py -w -i 3 -q 2 -S "$EXCLUDED_FILES,./autotest/*,./build*/*,./fix_typos/*" \
--words-white-list="$AUTHORIZED_LIST" \
-D ./fix_typos/gdal_dict.txt .
2 changes: 1 addition & 1 deletion scripts/run_stripmap_stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# clean folders before re-run
if [ -d "Igrams" ]; then
echo "clean obsolete files/folders before reruning"
echo "clean obsolete files/folders before rerunning"
rm -r baselines/ configs/ coregSLC/ geom_reference/ Igrams/ merged/ offsets/ refineSecondaryTiming/ run_files/ SLC/
rm run_unPackALOS
cd download
Expand Down
2 changes: 1 addition & 1 deletion src/mintpy/cli/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def cmd_line_parse(iargs=None):
parser.error("--dem-blend requires -d/-dem.")
# --cbar-ext option is ignored
if '--cbar-ext' in inps.argv:
print('WARNING: --cbar-ext is NOT compatiable with --dem-blend, ignore --cbar-ext and continue.')
print('WARNING: --cbar-ext is NOT compatible with --dem-blend, ignore --cbar-ext and continue.')

# check: conflicted options (geo-only options if inpput file is in radar-coordinates)
geo_opt_names = ['--coord', '--show-gps', '--coastline', '--lalo-label', '--lalo-step', '--scalebar', '--faultline']
Expand Down
2 changes: 1 addition & 1 deletion src/mintpy/data/colormaps/differences.cpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# GMT colour palette table (cpt)
# grass2cpt ouput
# grass2cpt output
# COLOR_MODEL = RGB
-1.000000e+00 0 0 255 0.000000e+00 255 255 255
0.000000e+00 255 255 255 1.000000e+00 255 0 0
Expand Down
3 changes: 2 additions & 1 deletion src/mintpy/plot_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ def plot_network(inps):
print(f'save figure to {fig_names[2]}')

# Fig 3 - Coherence Matrix
fig, ax = plt.subplots(figsize=[max(inps.fig_size), max(inps.fig_size)])
fig_size3 = np.mean(inps.fig_size)
fig, ax = plt.subplots(figsize=[fig_size3, fig_size3])
ax = pp.plot_coherence_matrix(
ax,
inps.date12List,
Expand Down
4 changes: 2 additions & 2 deletions src/mintpy/simulation/fractal.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def fractal_surface_atmos(shape=(128, 128), resolution=60., p0=1., freq0=1e-3,
# get the fractal spectrum and transform to spatial domain
Hfrac = np.divide(H, fraction)
fsurf = pyfftw.interfaces.numpy_fft.ifft2(Hfrac)
fsurf = np.abs(fsurf, dtype=np.float32)
fsurf = np.abs(fsurf).astype(np.float32)
fsurf -= np.mean(fsurf)

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

Expand Down
2 changes: 1 addition & 1 deletion src/mintpy/utils/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2217,7 +2217,7 @@ def prep_blend_image(data, dem, vmin=None, vmax=None, cmap='viridis',
vert_exag=vert_exag,
)

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

## masking the shaded-relief image:
Expand Down
1 change: 1 addition & 0 deletions src/mintpy/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
###########################################################################
Tag = collections.namedtuple('Tag', 'version date')
release_history = (
Tag('1.5.3', '2023-11-23'),
Tag('1.5.2', '2023-08-09'),
Tag('1.5.1', '2023-01-03'),
Tag('1.5.0', '2022-11-18'),
Expand Down