Skip to content

Commit

Permalink
bugfix in water_mask + update to mintpy-v1.4.1-11 (#46)
Browse files Browse the repository at this point in the history
+ water_mask:
   - bugfix since the water value read by mintpy from *.wbd file changed from -1 to 255
   - update API usage to mintpy version 1.4.1-11

+ closure_phase_bias:fix typo for the GitHub link

+ update to mintpy-v1.4.1-11 for the other notebooks
  • Loading branch information
yunjunz authored Sep 23, 2022
1 parent ce036bc commit a3df6ce
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 77 deletions.
10 changes: 2 additions & 8 deletions applications/closure_phase_bias.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"id": "d8b096a1",
"metadata": {},
"source": [
"In the following, we use the Barstow-Bristol Trough, CA dataset (as shown in Zheng et al., 2022) as an example to illustrate the use of `closure_phase_bias.py`. This dataset includes interferograms generated from 153 Sentinel-1 A/B SAR images at descending orbit 173 using [ISCE2](https://github.com/isceframework/isce2) [topsStack](https://github.com/isce-framework/isce2/tree/main/contrib/stack/topsStack) processor (Rosen et al., 2012; Fattahi et al., 2017) developed at JPL/Caltech. The stack of interferograms is freely available on Zenodo at: https://doi.org/10.5281/zenodo.6558341 (size: 13 GB).\n",
"In the following, we use the Barstow-Bristol Trough, CA dataset (as shown in Zheng et al., 2022) as an example to illustrate the use of `closure_phase_bias.py`. This dataset includes interferograms generated from 153 Sentinel-1 A/B SAR images at descending orbit 173 using [ISCE2](https://github.com/isce-framework/isce2) / [topsStack](https://github.com/isce-framework/isce2/tree/main/contrib/stack/topsStack) processor (Rosen et al., 2012; Fattahi et al., 2017) developed at JPL/Caltech. The stack of interferograms is freely available on Zenodo at: https://doi.org/10.5281/zenodo.6558341 (size: 13 GB).\n",
"\n",
"The average velocity maps of bw-1, bw-5, and bw-10 are shown in the figure below (right). Note that there are systematic descrepancies in these velocity maps. These descrepancies result from temporally inconsistent processes. We can use `closure_phase_bias.py` to estimate and remove these descrepancies.\n",
"\n",
Expand Down Expand Up @@ -60,7 +60,6 @@
"cell_type": "markdown",
"id": "f2844294",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
Expand All @@ -84,7 +83,7 @@
"source": [
"%matplotlib inline\n",
"import os\n",
"from mintpy import view\n",
"from mintpy.cli import view\n",
"\n",
"# define and go to the work directory\n",
"work_dir = os.path.expanduser('~/data/DrylakeSenD173/mintpy')\n",
Expand All @@ -102,7 +101,6 @@
"cell_type": "markdown",
"id": "307a76f2",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
Expand Down Expand Up @@ -214,7 +212,6 @@
"cell_type": "markdown",
"id": "e5b48e43",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
Expand Down Expand Up @@ -416,7 +413,6 @@
"cell_type": "markdown",
"id": "a6690f43",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
Expand Down Expand Up @@ -837,7 +833,6 @@
"cell_type": "markdown",
"id": "8465fba6",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
Expand Down Expand Up @@ -1565,7 +1560,6 @@
"cell_type": "markdown",
"id": "36125751",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
Expand Down
8 changes: 3 additions & 5 deletions applications/coherence_change_detection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"from skimage import exposure\n",
"\n",
"# mintpy modules\n",
"from mintpy import geocode, save_kmz\n",
"from mintpy.objects import ifgramStack\n",
"from mintpy.utils import readfile, writefile, utils as ut\n",
"\n",
Expand Down Expand Up @@ -612,14 +611,13 @@
"######################## GEOCODE RESULTS ##################################\n",
"#######################################################################################\n",
"\n",
"geocode.main(f'cohChange_Fernandina-0917.h5 -l {geom_file}'.split())\n",
"!geocode.py cohChange_Fernandina-0917.h5 -l $geom_file\n",
"\n",
"#######################################################################################\n",
"##################### EXPORT RESULTS TO KMZ ###############################\n",
"#######################################################################################\n",
"%matplotlib notebook\n",
"save_kmz.main('geo_cohChange_Fernandina-0917.h5 CCD_diff-092017 \\\n",
" --cbar-label Eruption-Sep2017 -u CCD -c magma_r'.split())"
"!save_kmz.py geo_cohChange_Fernandina-0917.h5 CCD_diff-092017 --cbar-label Eruption-Sep2017 -u CCD -c magma_r"
]
},
{
Expand Down Expand Up @@ -662,7 +660,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.8.13"
}
},
"nbformat": 4,
Expand Down
15 changes: 8 additions & 7 deletions applications/plot_gps_quiver.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
"import os\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"from mintpy.defaults.plot import *\n",
"from mintpy.objects.gps import search_gps, GPS\n",
"from mintpy.objects import sensor\n",
"from mintpy.utils import utils as ut\n",
"from mintpy import view\n",
"from mintpy.view import prep_slice, plot_slice\n",
"\n",
"# input\n",
"date12 = '20180706_20180712'\n",
Expand Down Expand Up @@ -140,7 +141,7 @@
"cmd = 'view.py {} unwrapPhase-{} -m {} -d {} '.format(ifgram_file, date12, mask_file, geom_file)\n",
"cmd += '--sub-lat -0.87 -0.77 --sub-lon -91.20 -91.08 '\n",
"cmd += '--notitle -u cm -c jet_r --nocbar --lalo-label --lalo-max-num 3 --noverbose '\n",
"dv, atr, inps = view.prep_slice(cmd)\n",
"dv, atr, inps = prep_slice(cmd)\n",
"print('Done.')"
]
},
Expand Down Expand Up @@ -178,13 +179,13 @@
"# Horizontal\n",
"ax = axs[0]\n",
"inps.lalo_loc = [1,0,0,1]\n",
"ax, inps, im = view.plot_slice(ax, dv, atr, inps)[0:3]\n",
"ax, inps, im = plot_slice(ax, dv, atr, inps)[0:3]\n",
"q = ax.quiver(gps_lons, gps_lats, dis_e, dis_n, zorder=10, units='width', pivot='tail')\n",
"ax.quiverkey(q, X=0.1, Y=0.9, U=key_length, label='GPS horz = {:.0f} {}'.format(key_length, inps.disp_unit), labelpos='E', coordinates='figure')\n",
"# Vertical\n",
"ax = axs[1]\n",
"inps.lalo_loc = [0,0,0,1]\n",
"ax, inps, im = view.plot_slice(ax, dv, atr, inps)[0:3]\n",
"ax, inps, im = plot_slice(ax, dv, atr, inps)[0:3]\n",
"q = ax.quiver(gps_lons, gps_lats, np.zeros(len(gps_lats)), dis_u, zorder=10, units='width', pivot='tail')\n",
"ax.quiverkey(q, X=0.53, Y=0.9, U=key_length, label='GPS vert = {:.0f} {}'.format(key_length, inps.disp_unit), angle=90, labelpos='E', coordinates='figure')\n",
"\n",
Expand All @@ -211,7 +212,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -225,9 +226,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
"version": "3.8.13"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
24 changes: 13 additions & 11 deletions applications/stripmapApp_postProc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@
"import time\n",
"from datetime import datetime as dt\n",
"from decimal import Decimal\n",
"\n",
"import h5py\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"from mintpy.utils import readfile, writefile, utils as ut\n",
"\n",
"work_dir = os.path.expanduser(\"~/insarlab/Others/Koae4shuangyu/\")\n",
Expand Down Expand Up @@ -111,9 +113,7 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"scrolled": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -158,11 +158,13 @@
"source": [
"# geocoding\n",
"for in_file, out_file in zip(in_files, out_files):\n",
" cmd = \"geocode.py {f} -l {l} -b {b} -o {o} --lat-step -{s} --lon-step {s}\".format(f=in_file,\n",
" l=geom_file, \n",
" b=SNWE,\n",
" o=out_file,\n",
" s=step)\n",
" cmd = \"geocode.py {f} -l {l} -b {b} -o {o} --lat-step -{s} --lon-step {s}\".format(\n",
" f=in_file,\n",
" l=geom_file, \n",
" b=SNWE,\n",
" o=out_file,\n",
" s=step,\n",
" )\n",
" print(cmd)\n",
" !{cmd}"
]
Expand Down Expand Up @@ -350,7 +352,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -364,9 +366,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
"version": "3.8.13"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
7 changes: 4 additions & 3 deletions applications/tropo_gacos.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from skimage.transform import resize\n",
"\n",
"from mintpy.objects import timeseries\n",
"from mintpy.utils import ptime, readfile, utils as ut\n",
"from mintpy import view\n",
"from mintpy.cli import view\n",
"\n",
"# GACOS product directory\n",
"ztd_dir = os.path.expanduser('~/insarlab/Kirishima/AlosAT424F620_630/GACOS')\n",
Expand Down Expand Up @@ -303,7 +304,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -317,7 +318,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.8.13"
}
},
"nbformat": 4,
Expand Down
136 changes: 93 additions & 43 deletions applications/water_mask.ipynb

Large diffs are not rendered by default.

0 comments on commit a3df6ce

Please sign in to comment.