diff --git a/smallbaselineApp_aria.ipynb b/smallbaselineApp_aria.ipynb index 8149296..0d46d01 100644 --- a/smallbaselineApp_aria.ipynb +++ b/smallbaselineApp_aria.ipynb @@ -25,7 +25,7 @@ "\n", "References: The detailed algorithms implemented in MintPy can be found in the following manuscript: \n", "\n", - "+ Yunjun, Z., H. Fattahi, F. Amelung (2019), Small baseline InSAR time series analysis: Unwrapping error correction and noise reduction, Computers & Geosciences, 133, 104331, doi:[10.1016/j.cageo.2019.104331](https://doi.org/10.1016/j.cageo.2019.104331), [ArXiv](https://eartharxiv.org/9sz6m/)." + "+ Yunjun, Z., H. Fattahi, F. Amelung (2019), Small baseline InSAR time series analysis: Unwrapping error correction and noise reduction, _Computers & Geosciences, 133,_ 104331, doi:[10.1016/j.cageo.2019.104331](https://doi.org/10.1016/j.cageo.2019.104331), [ArXiv](https://eartharxiv.org/9sz6m/)." ] }, { @@ -48,11 +48,19 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": { "hidden": true }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Go to work directory: /Users/yunjunz/data/SanAndreas/SanFranSenDT42\n" + ] + } + ], "source": [ "%matplotlib inline\n", "import os\n", @@ -61,13 +69,7 @@ "from mintpy import view, tsview, plot_network, plot_transection, plot_coherence_matrix\n", "\n", "# define the work directory\n", - "work_dir = os.path.abspath(os.getcwd())\n", - "\n", - "#The Path to the folder where ARIA data after running ariaTSsetup.py is stored\n", - "aria_dir = os.path.join(os.getenv(\"HOME\"),'work/04_ariaTSprep')\n", - "\n", - "print(\"Work directory: \", work_dir)\n", - "print(\"The path to the directory with ARIA data after running ariaTSsetup:\", aria_dir)\n", + "work_dir = os.path.join(os.getenv(\"HOME\"),'data/SanAndreas/SanFranSenDT42')\n", "\n", "if not os.path.isdir(work_dir):\n", " os.makedirs(work_dir)\n", @@ -98,7 +100,14 @@ "* correcting unwrapping errors and inverting for the raw phase time-series (blue ovals),\n", "* correcting for noise from different sources to obtain the displacement time-series (green ovals).\n", "\n", - "Some steps are optional, which are switched off by default (marked by dashed boundaries). Configuration parameters for each step are initiated with default values in a customizable text file: [smallbaselineApp.cfg](https://github.com/insarlab/MintPy/blob/master/mintpy/defaults/smallbaselineApp.cfg). In this notebook, we will walk through the various steps." + "Some steps are optional, which are switched off by default (marked by dashed boundaries). Configuration parameters for each step are initiated with default values in a customizable text file: [smallbaselineApp.cfg](https://github.com/insarlab/MintPy/blob/master/mintpy/defaults/smallbaselineApp.cfg). In this notebook, we will walk through the various steps.\n", + "\n", + "

\n", + " \n", + "

\n", + "

\n", + " (Figure from Yunjun et al., 2019)\n", + "

" ] }, { @@ -121,11 +130,73 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "hidden": true - }, - "outputs": [], + "execution_count": 5, + "metadata": { + "hidden": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "usage: smallbaselineApp.py [-h] [--dir WORKDIR] [-g] [-H] [-v] [--noplot]\r\n", + " [--start STEP] [--end STEP] [--dostep STEP]\r\n", + " [customTemplateFile]\r\n", + "\r\n", + "Routine Time Series Analysis for Small Baseline InSAR Stack\r\n", + "\r\n", + "positional arguments:\r\n", + " customTemplateFile custom template with option settings.\r\n", + " ignored if the default smallbaselineApp.cfg is input.\r\n", + "\r\n", + "optional arguments:\r\n", + " -h, --help show this help message and exit\r\n", + " --dir WORKDIR specify custom working directory. The default is:\r\n", + " a) current directory, OR\r\n", + " b) $SCRATCHDIR/$projectName/mintpy, if:\r\n", + " 1) autoPath == True in $MINTPY_HOME/mintpy/defaults/auto_path.py AND\r\n", + " 2) environment variable $SCRATCHDIR exists AND\r\n", + " 3) customTemplateFile is specified (projectName.*)\r\n", + " -g generate default template (if it does not exist) and exit.\r\n", + " -H print the default template file and exit.\r\n", + " -v, --version print software version and exit\r\n", + " --noplot do not plot results at the end of the processing.\r\n", + "\r\n", + "steps processing (start/end/dostep):\r\n", + " Command line options for steps processing with names are chosen from the following list:\r\n", + " \r\n", + " ['load_data', 'modify_network', 'reference_point', 'correct_unwrap_error', 'stack_interferograms']\r\n", + " ['invert_network', 'correct_LOD', 'correct_troposphere', 'deramp', 'correct_topography']\r\n", + " ['residual_RMS', 'reference_date', 'velocity', 'geocode', 'google_earth', 'hdfeos5']\r\n", + " \r\n", + " In order to use either --start or --dostep, it is necessary that a\r\n", + " previous run was done using one of the steps options to process at least\r\n", + " through the step immediately preceding the starting step of the current run.\r\n", + "\r\n", + " --start STEP start processing at the named step (default: load_data).\r\n", + " --end STEP, --stop STEP\r\n", + " end processing at the named step (default: hdfeos5)\r\n", + " --dostep STEP run processing at the named step only\r\n", + "\r\n", + "reference:\r\n", + " Yunjun, Z., H. Fattahi, and F. Amelung (2019), Small baseline InSAR time series analysis: \r\n", + " Unwrapping error correction and noise reduction, Computers & Geosciences, 133, 104331,\r\n", + " doi:10.1016/j.cageo.2019.104331.\r\n", + "\r\n", + "example:\r\n", + " smallbaselineApp.py #run with default template 'smallbaselineApp.cfg'\r\n", + " smallbaselineApp.py #run with default and custom templates\r\n", + " smallbaselineApp.py -h / --help #help\r\n", + " smallbaselineApp.py -H #print default template options\r\n", + " smallbaselineApp.py -g #generate default template if it does not exist\r\n", + " smallbaselineApp.py -g #generate/update default template based on custom template\r\n", + "\r\n", + " # Run with --start/stop/dostep options\r\n", + " smallbaselineApp.py GalapagosSenDT128.template --dostep velocity #run at step 'velocity' only\r\n", + " smallbaselineApp.py GalapagosSenDT128.template --end load_data #end after step 'load_data'\r\n" + ] + } + ], "source": [ "!smallbaselineApp.py --help" ] @@ -207,9 +278,22 @@ "hidden": true }, "source": [ - "Create a text file named SanFranSenDT42.txt and copy the following few lines in that file: \n", + "Create a text file named _SanFranSenDT42.txt_ and copy the following few lines in that file: \n", "\n", "```cfg\n", + "mintpy.load.processor = aria #[isce, aria, snap, gamma, roipac], auto for isce\n", + "mintpy.load.updateMode = auto #[yes / no], auto for yes, skip re-loading if HDF5 files are complete\n", + "mintpy.load.compression = auto #[gzip / lzf / no], auto for no.\n", + "##---------interferogram datasets:\n", + "mintpy.load.unwFile = ../stack/unwrapStack.vrt\n", + "mintpy.load.corFile = ../stack/cohStack.vrt\n", + "mintpy.load.connCompFile = ../stack/connCompStack.vrt\n", + "##---------geometry datasets:\n", + "mintpy.load.demFile = ../DEM/SRTM_3arcsec.dem\n", + "mintpy.load.incAngleFile = ../incidenceAngle/20150605_20150512.vrt\n", + "mintpy.load.azAngleFile = ../azimuthAngle/20150605_20150512.vrt\n", + "mintpy.load.waterMaskFile = ../mask/watermask.msk\n", + "\n", "mintpy.reference.yx = 490,630\n", "mintpy.network.coherenceBased = no\n", "mintpy.networkInversion.weightFunc = no\n", @@ -248,7 +332,7 @@ "hidden": true }, "source": [ - "MintPy is most consistent with the ISCE direct outputs. However, it supports interferograms processed with other InSAR software including Gamma and SNAP. In this tutorial we are not using the direct ISCE outputs in their flat binary formats, but rather we use the ISCE outputs packaged in an HDF5 file, which have been produced by ARIA. Therefore we skip the conventional load data step in MintPy and instead manually run a script called prep_aria.py to load the ARIA products into MintPy. In other words prep_aria.py creates HDF5 files which contains the stack of unwrapped interferograms, coherence, connected components and required metdata which are used as inputs to MintPy.\n", + "MintPy is most consistent with the ISCE direct outputs. However, it supports interferograms processed with other InSAR software including Gamma and SNAP. In this tutorial we are not using the direct ISCE outputs in their flat binary formats, but rather we use the ISCE outputs packaged in an HDF5 file, which have been produced by ARIA. \n", "\n", "If the user has already prepared the ARIA data, then the data preparation can be skipped. Please see the [example data directory](https://mintpy.readthedocs.io/en/latest/dir_structure/) about setting up the stack for MintPy processing. " ] @@ -262,7 +346,7 @@ "outputs": [], "source": [ "#ariaDownload.py -b '37.25 38.1 -122.6 -121.75' --track 42\n", - "#ariaTSsetup.py -f 'products/*.nc' -b '37.25 38.1 -122.6 -121.75' --mask Download\n" + "#ariaTSsetup.py -f 'products/*.nc' -b '37.25 38.1 -122.6 -121.75' --mask Download" ] }, { @@ -271,11 +355,6 @@ "hidden": true }, "source": [ - "
\n", - "
\n", - "Note : \n", - "smallbaslineApp.py currently does not load ARIA products. Therefore users need to run prep_aria.py script before running the smallbaselineApp.py inorder to load the products in a single HDF5 file that MintPy expects. \n", - "
\n", "To load the ARIA interferograms into mintpy run the following command:" ] }, @@ -287,7 +366,7 @@ }, "outputs": [], "source": [ - "!prep_aria.py -s ../04_ariaTSprep/stack/ -i ../04_ariaTSprep/incidenceAngle/20150605_20150512.vrt -d ../04_ariaTSprep/DEM/SRTM_3arcsec.dem -a ../04_ariaTSprep/azimuthAngle/20150605_20150512.vrt --water-mask ../04_ariaTSprep/mask/watermask.msk" + "!smallbaselineApp.py -t SanFranSenDT42.txt --dostep load_data" ] }, { @@ -2014,7 +2093,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.7" + "version": "3.7.7" } }, "nbformat": 4,