diff --git a/doc_cookbook/README.md b/doc_cookbook/README.md new file mode 100644 index 0000000000000000000000000000000000000000..82bb6b4e7df0702066e0e0ad19a73b3d8157714d --- /dev/null +++ b/doc_cookbook/README.md @@ -0,0 +1,53 @@ +To generate quickly the wiki, the process to follow is made up of multiple steps. + +However, before it is executed, the module conda must be loaded and the environment sphinx and diapotb must be ready to be loaded. + +The environment sphinx can be created with the file .yml or we can follow the following steps: +```shell +conda create -n <name_env_sphinx> python=3.7.2 +conda activate <name_env_sphinx> +pip install sphinx_rtd_theme +pip install sphinx_markdown_builder +pip install myst-parser +``` + +1. The module conda is loaded. Then, the environment diapotb is loaded, the environment variables used by the repository diapotb are defined. + +2. The source files for the applications C++ are generated: + +- First, we go to the repertory `doc_cookbook` inside the repository diapotb: + +```shell +cd <diapotb_root_path>/doc_cookbook +``` +<diapotb_root_path> : root path of the repository diapotb + +- Then, the rst files are generated: + +```shell +python otbGenerateWrappersRstDoc.py rst +``` + +3. The new wiki is generated: + +- The environment sphinx is loaded: + +```shell +conda activate <name_env_sphinx> +``` + +- We run the shell script `script_doc_sphinx.sh` which will generate the source files for the python script then use all the source files inside the temporary repertory `rst_tmp` to generate the new wiki at the output path requested. + +```shell +./script_doc_sphinx.sh <path_wiki_output> +``` + +<path_wiki_output> : Path of the repertory where the new wiki will be generated + +Example: + +```shell +./script_doc_sphinx.sh /work/ADM/C3/salehma +``` + +We will have the repertory `diapotb_wiki` at `/work/ADM/C3/salehma` with all the new content of the wiki diff --git a/doc_cookbook/conf.py b/doc_cookbook/conf.py index 8e2bac4e164b495a53253d52763680e74ef196b9..6ebb08087db9e15a8fb51246b93264a25ac5b63a 100644 --- a/doc_cookbook/conf.py +++ b/doc_cookbook/conf.py @@ -23,8 +23,15 @@ import sphinx_rtd_theme sys.path.insert(0, os.path.abspath('../python_src')) def setup(app): - app.add_stylesheet("css/otb_theme.css") - app.add_javascript("js/versions.js") + if hasattr(app, 'add_css_file'): + app.add_css_file("css/otb_theme.css") + else: + app.add_stylesheet("css/otb_theme.css") + if hasattr(app, 'add_js_file'): + app.add_js_file("js/versions.js") + else: + app.add_javascript("js/versions.js") + # -- General configuration ------------------------------------------------ @@ -41,20 +48,27 @@ extensions = [ 'sphinx.ext.viewcode', 'sphinx.ext.extlinks', 'sphinx_markdown_builder', - 'sphinx.ext.autodoc' + 'sphinx.ext.autodoc', + 'myst_parser' ] +# List of module to ignore when doing the doc for the python_src +autodoc_mock_imports = ["gdal","jsonschema","h5py","ogr","otbApplication","func_utils","osgeo"] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. -source_suffix = '.rst' +source_suffix = { + '.rst': 'restructuredtext', + '.md': 'markdown', +} + # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. -master_doc = 'index' +master_doc = 'home' # General information about the project. project = u'DiapOTB (OTB Remote Module)' diff --git a/doc_cookbook/doc_sphinx_wiki.yml b/doc_cookbook/doc_sphinx_wiki.yml new file mode 100644 index 0000000000000000000000000000000000000000..7fb88b2c6c74b2ff58da086bfbbbd29f67bc189c --- /dev/null +++ b/doc_cookbook/doc_sphinx_wiki.yml @@ -0,0 +1,24 @@ +name: doc_sphinx_wiki +channels: + - defaults +dependencies: + - _libgcc_mutex=0.1=main + - ca-certificates=2021.7.5=h06a4308_1 + - certifi=2021.5.30=py37h06a4308_0 + - libedit=3.1.20210714=h7f8727e_0 + - libffi=3.2.1=hf484d3e_1007 + - libgcc-ng=9.1.0=hdf63c60_0 + - libstdcxx-ng=9.1.0=hdf63c60_0 + - ncurses=6.2=he6710b0_1 + - openssl=1.1.1l=h7f8727e_0 + - pip=21.2.2=py37h06a4308_0 + - python=3.7.2=h0371630_0 + - readline=7.0=h7b6447c_5 + - setuptools=58.0.4=py37h06a4308_0 + - sqlite=3.33.0=h62c20be_0 + - tk=8.6.11=h1ccaba5_0 + - wheel=0.37.0=pyhd3eb1b0_1 + - xz=5.2.5=h7b6447c_0 + - zlib=1.2.11=h7b6447c_3 +prefix: /home/qt/salehma/.conda/envs/doc_sphinx_wiki + diff --git a/doc_cookbook/rst/Art/DIAPOTB_logo.jpg b/doc_cookbook/rst/Art/DIAPOTB_logo.jpg new file mode 100755 index 0000000000000000000000000000000000000000..4e3fb422e94f1a11a0cc5bda05408ec94f736cc1 Binary files /dev/null and b/doc_cookbook/rst/Art/DIAPOTB_logo.jpg differ diff --git a/doc_cookbook/rst/Art/DIAPOTB_logo.png b/doc_cookbook/rst/Art/DIAPOTB_logo.png new file mode 100755 index 0000000000000000000000000000000000000000..f88990a11af3f649ad4361068998f958d2f301b4 Binary files /dev/null and b/doc_cookbook/rst/Art/DIAPOTB_logo.png differ diff --git a/doc_cookbook/rst/Art/PythonAPI/python_src.png b/doc_cookbook/rst/Art/PythonAPI/python_src.png new file mode 100755 index 0000000000000000000000000000000000000000..6a39a202482b3a05c912cb7037496ef125e3b22c Binary files /dev/null and b/doc_cookbook/rst/Art/PythonAPI/python_src.png differ diff --git a/doc_cookbook/rst/Art/chains_description/diapOTB_SARMultiSlc.png b/doc_cookbook/rst/Art/chains_description/diapOTB_SARMultiSlc.png new file mode 100755 index 0000000000000000000000000000000000000000..82e8e9cc3fc3f5552d8cbf9f8fee98ddf52c8737 Binary files /dev/null and b/doc_cookbook/rst/Art/chains_description/diapOTB_SARMultiSlc.png differ diff --git a/doc_cookbook/rst/Art/chains_description/diapOTB_flowchart.png b/doc_cookbook/rst/Art/chains_description/diapOTB_flowchart.png new file mode 100755 index 0000000000000000000000000000000000000000..ccf169b43e34520b8a44f05180d341cde859a046 Binary files /dev/null and b/doc_cookbook/rst/Art/chains_description/diapOTB_flowchart.png differ diff --git a/doc_cookbook/rst/Art/chains_description/diapOTB_mainProcessing.png b/doc_cookbook/rst/Art/chains_description/diapOTB_mainProcessing.png new file mode 100755 index 0000000000000000000000000000000000000000..446bfff732af573a29bf65be7d1d42fc9860ceb0 Binary files /dev/null and b/doc_cookbook/rst/Art/chains_description/diapOTB_mainProcessing.png differ diff --git a/doc_cookbook/rst/Art/conf_chains/MultiSlc_Chain.png b/doc_cookbook/rst/Art/conf_chains/MultiSlc_Chain.png new file mode 100755 index 0000000000000000000000000000000000000000..3263a4592e2d397f3ffe299f1e5ae05a8357440d Binary files /dev/null and b/doc_cookbook/rst/Art/conf_chains/MultiSlc_Chain.png differ diff --git a/doc_cookbook/rst/Art/conf_chains/MultiSlc_IW_Chain.png b/doc_cookbook/rst/Art/conf_chains/MultiSlc_IW_Chain.png new file mode 100755 index 0000000000000000000000000000000000000000..9c1a9eeeff85d7444886dcb12cf062693af66f95 Binary files /dev/null and b/doc_cookbook/rst/Art/conf_chains/MultiSlc_IW_Chain.png differ diff --git a/doc_cookbook/rst/Art/conf_chains/diapOTB_1_chain.png b/doc_cookbook/rst/Art/conf_chains/diapOTB_1_chain.png new file mode 100755 index 0000000000000000000000000000000000000000..8fa6c270886a53e50fbbfd42095413b8debb4f7c Binary files /dev/null and b/doc_cookbook/rst/Art/conf_chains/diapOTB_1_chain.png differ diff --git a/doc_cookbook/rst/Art/conf_chains/diapOTB_2_chain.png b/doc_cookbook/rst/Art/conf_chains/diapOTB_2_chain.png new file mode 100755 index 0000000000000000000000000000000000000000..d31c962594fc322220e52dc4a67c9c11ca924047 Binary files /dev/null and b/doc_cookbook/rst/Art/conf_chains/diapOTB_2_chain.png differ diff --git a/doc_cookbook/rst/Art/logo-with-text.png b/doc_cookbook/rst/Art/logo-with-text.png new file mode 100644 index 0000000000000000000000000000000000000000..cdd561876be4a2ef8150c6a7e99806dbd1821e3b Binary files /dev/null and b/doc_cookbook/rst/Art/logo-with-text.png differ diff --git a/doc_cookbook/rst/Art/results_DiapOTB/Results_Reunion.png b/doc_cookbook/rst/Art/results_DiapOTB/Results_Reunion.png new file mode 100755 index 0000000000000000000000000000000000000000..591160ba0caa859312e9b30cdd8886b6978d6dc7 Binary files /dev/null and b/doc_cookbook/rst/Art/results_DiapOTB/Results_Reunion.png differ diff --git a/doc_cookbook/rst/ProcessingChains.md b/doc_cookbook/rst/ProcessingChains.md new file mode 100644 index 0000000000000000000000000000000000000000..a34e383bd18dd7770a5ac51ed13f5dd603a4e512 --- /dev/null +++ b/doc_cookbook/rst/ProcessingChains.md @@ -0,0 +1,73 @@ +<div align="justify"> + +# Processing Chains + +## Description + +DiapOTB remote module provides several processing chains that build a final interferogram from two SLC (Single Look Complex) images and a digital elevation model. The main processing can be displayed as follow : + + + + +This main processing is obtained by launching most of DiapOTB applications. The next schema sums up the link between all executions of DiapOTB/OTB applications : + + + + +At the end, a final interferogram is created as a VectorImage : + + +* Band 1 : Amplitude + + +* Band 2 : Phase + + +* Band 3 : Coherence + + +* Band 4 (if present) : IsData boolean to indicate if output pixels are consistent + +Example : Output interfergram for S1 SM product (Reunion island) + + + + + +Other optional outputs can be created such as a filtering interferogram. + + +NB: All outputs contain metadata inside the geom file (not the image itself). Thus, outputs are not georeferenced outside OTB. However, it is possible to add inside tiff images, the GCPs thanks to addGCP.py script. This script allows to add GCPs from an input geom file into a tiff image. Some sensors like Cosmo, do not owe GCPs natively. You can create this data with SARMetadataCorrection application before launching addGPC.py. +Please be aware that the GCPs come from inputs (referecence or secondary images) and intermediate geometries (such as ML) might not fit with GCPs. + + +## Available chains and execution + +Four kinds of workflows are available according input products and modes : + + +* [diapOTB.py](./ProcessingChains/diapOTB_Chain) : Single interferometry chain for S1 Stripmap mode and Cosmo + + +* [diapOTB_S1IW.py](./ProcessingChains/diapOTB_S1IW_Chain) : Single interferometry chain for S1 IW mode + + +* [SAR_MultiSlc.py](./ProcessingChains/Sar_MultiSlc_Chain) : Multitemporal interferometry chain for S1 Stripmap mode and Cosmo + + +* [SAR_MultiSlc_IW.py](./ProcessingChains/Sar_MultiSlc_IW_Chain) : Multitemporal interferometry chain for S1 IW mode + + + +All these chains can be executed by following the next [tutorial](ProcessingChains/tuto_chains). + + +A [Python API](PythonAPI/pythonAPI) was designed to organize python scripts and to help new chain development. In case of existing workflows do not fullfill your needs, you can easily create your own workflow by calling DiapOTB applications. + + + +## Limitations + +Two limitations can be noticed : +* Memory consumption : Some applications such as SARFineDeformationGrid or SARContenateBursts, may have a high memory consumption. It depends on input data volumetry and sensor/mode. For exemple, the S1 sensor for StripMap mode requires a high level of RAM (between 16GB and 32GB). It is necessary to adapt your processing with your material resources. You can, for instance, extract ROIs inside your inputs before launching DiapOTB chains. +* Instabilities dues to input GCPs for S1 sensor : GCPs are part of metadata for S1 sensor. You can find its with xml files contained into annotation directory of your input .SAFE. It was notified some incoherencies with GCPs following the IPF (Instrument Processing Facility) version. diff --git a/doc_cookbook/rst/ProcessingChains.rst b/doc_cookbook/rst/ProcessingChains.rst deleted file mode 100644 index abfcec4728f414efb0a7e3e039a02368d18c855a..0000000000000000000000000000000000000000 --- a/doc_cookbook/rst/ProcessingChains.rst +++ /dev/null @@ -1,27 +0,0 @@ - -Processing Chains -================= - -Most of DiapOTB applications have been used into larger processing workflows. - -All processing chains build a final interferogram from two SLC (Single Look Complex) images and a digital elevation model. - -Two kinds of workflows are available according input products and modes : - -.. toctree:: - :maxdepth: 1 - - ProcessingChains/diapOTB_Chain.rst - ProcessingChains/diapOTB_S1IW_Chain.rst - -At the end, a final interferogram is created as a VectorImage into Master geometry : - -- Band 1 : Amplitude -- Band 2 : Phase -- Band 3 : Coherence -- Band 4 : IsData boolean to indicate if output pixels are consistent - - -Example : Output interfergram for S1 SM product (Reunion island) - -.. image:: ../Art/results_DiapOTB/Results_Reunion.png diff --git a/doc_cookbook/rst/ProcessingChains/Sar_MultiSlc_Chain.md b/doc_cookbook/rst/ProcessingChains/Sar_MultiSlc_Chain.md new file mode 100644 index 0000000000000000000000000000000000000000..5a53f96f14a87f31c0ee2576592c9269c7da5d4d --- /dev/null +++ b/doc_cookbook/rst/ProcessingChains/Sar_MultiSlc_Chain.md @@ -0,0 +1,156 @@ +<div align="justify"> + +# SAR_MultiSlc.py + +## Description + +This workflow works on S1 StripMap and Cosmo data. It spreads the main processing with multitemporal SAR images. + +An input path indicates where to find all SAR images and a selection can be made with dates. One reference image is fixed by users and other images are processed as secondary image. This chain deals with DEM differently by creating automatically the corresponding DEM from a folder filled with SRTM files and a shapefile that contains the SRTM tile grid with the tiles location (lat,lon). The SRTM files must be hgt files and shapefiles are provided with DiapOTB. The SRTM tile grid shapefile is useful to select automatically the SRTM tiles needed in order to compute the interferograms on the area corresponding to the SAR images. + + + + +For each couple (reference/secondary), the processing is divided into four parts descrided below : + +* Pre-Processing Chain + + +* Ground Chain + + +* DIn-SAR Chain + + +* Post-Processing Chain : Orthorectification for final interferogram, filtering, multilook processing ... + +## Launch this chain + +This Python script takes a configuration file (.json) . + +The configuration file has always the same organization : + + + +Five sections compose the configuration file : + + +* Global : + + + * **SRTM_Shapefile :** Path to the SRTM shapefile + + + * **SRTM_Path :** Path to the SRTM folder + + + * **Geoid :** Path to Geoid file + + + * **Master_Image :** Filename of the master image + + + * **Start_Date :** Start date, format('20151222') + + + * **End_Date :** End date, format('20171119') + + + * **Exclude :** Time to exclude ('-9999' by default, no exlusion) + + + * **Input_Path :** Path to input folder + + + * **Output_Path :** Path to output folder + + + * **clean :** If activated, returns a light version: Interferogram.tif + Coregistrated.tif + Concatenated (deramped, and multilooked) bursts.tif (activated by default) + + + * **optram :** Available RAM (mb), by default the value is 4000 + + +* Pre_Processing : + + + * **doppler_file :** Output file to store Doppler0 result + + + * **ML_gain :** Gain applied on MultiLooked images + + + * **ML_ran :** MultLook factor on range dimension + + + * **ML_azi :** MultiLook factor on azimut dimension + + +* Metadata_Correction : + + + * **fine_metadata_file :** Output file to corrected metadata + + + * **activate :** Boolean to activate this chain (By default false) + + + * **GridStep_range :** Step for the correlation grid on range dimension + + + * **GridStep_azimut :** Step for the correlation grid on azimut dimension + + +* DIn_SAR : + + + * **GridStep_range :** Step for the deformation grid on range dimension + + + * **GridStep_azimut :** Step for the deformation grid on azimut dimensio + + + * **GridStep_Threshold :** Threshold for the correlation grid (applied on correlation rate) + + + * **Grid_Gap :** Maximum gap between DEM grid values and the mean value. If the difference betwwen a value of the DEM grid ans the mena is superior to this gap then the value is set to the mean. (Avoid incoherent shift) + + + * **Interferogram_gain :** Gain applied on amplitude band of output inteferegram. + + + * **Interferogram_mlran :** Ml factor on range for output inteferegram (only for interferogram). + + + * **Interferogram_mlazi :** Ml factor on azimut for output inteferegram (only for interferogram). + + + * **Activate_Interferogram :** Activate or deactivate interferogram output (Interferogram.tif). Activated by default. + + + + * **roi :** Define the lat lng ROI coordinates. Format : 'ulx uly lrx lry' + + +* Post_Processing : + + * **Activate_Ortho :** Activate or deactivate Orthorectified interferogram output (Orth_Interferogram.tif) + + + * **Spacingxy :** Set the spatial resolution for OrthRectification in degrees. Default value is 0.0001 + + + * **Activate_Filtering :** Activate or deactivate GoldStein filtering for interferogram output (filtered_interferogram.tif) + + + * **Filtered_Interferogram_mlran :** Ml factor on range for filtered inteferegram + + + * **Filtered_Interferogram_mlazi :** Ml factor on azimut for filtered inteferegram + + + * **Filtered_parameter_alpha :** alpha parameter for Goldstein filtering + + + +The processing chain needs metadata to launch the applications. Thus, input images must be into the native directory for each kind of products (i.e SAFE directory for Sentinel-1 products). diff --git a/doc_cookbook/rst/ProcessingChains/Sar_MultiSlc_IW_Chain.md b/doc_cookbook/rst/ProcessingChains/Sar_MultiSlc_IW_Chain.md new file mode 100644 index 0000000000000000000000000000000000000000..77d9d41a505fee5129a5d881d2a0a59d027252c5 --- /dev/null +++ b/doc_cookbook/rst/ProcessingChains/Sar_MultiSlc_IW_Chain.md @@ -0,0 +1,144 @@ +<div align="justify"> + +# SAR_MultiSlc_IW.py + +## Description + +This workflow works on S1 IW data. It spreads the main processing with multitemporal SAR images. + +An input path indicates where to find all SAR images and a selection can be made with dates. One reference image is fixed by users and other images are processed as secondary image. This chain deals with DEM differently by creating the corresponding DEM from a folder filled with SRTM files and a shapefile. The SRTM files must be hgt files and shapefiles are provided with DiapOTB. The SRTM tile grid shapefile is useful to select automatically the SRTM tiles needed in order to compute the interferograms on the area corresponding to the SAR images. + + + + +For each couple (reference/secondary), the processing is divided into four parts descrided below : + +* Pre-Processing Chain + + +* Ground Chain + + +* DIn-SAR Chain + + +* Post-Processing Chain : Burst concatenation, Orthorectification for final interferogram, filtering, multilook processing ... + +## Launch this chain + +This Python script spreads the general processing chain (SAR_MultiSlc.py). + +The input configuration file (.json) has the following organization : + + + +Five sections compose the configuration file : + + +* Global : + + + * **SRTM_Shapefile :** Path to the SRTM shapefile + + + * **SRTM_Path :** Path to the SRTM folder + + + * **Geoid :** Path to Geoid file + + + * **Master_Image :** Filename of the master image + + + * **Start_Date :** Start date, format('20151222') + + + * **End_Date :** End date, format('20171119') + + + * **Exclude :** Time to exclude ('-9999' by default, no exclusion) + + + * **Input_Path :** Path to input folder + + + * **Output_Path :** Path to output folder + + + * **clean :** If activated, returns a light version: Interferogram.tif + Coregistrated.tif + multilook.tif (activated by default) + + + * **burst_index :** Burst index, format('0-4') ('0-8' by default) + + + * **optram :** Available RAM (mb), by default the value is 4000 + + +* Pre_Processing : + + + * **doppler_file :** Output file to store Doppler0 result + + + * **ML_range :** MultLook factor on range dimension + + + * **ML_azimut :** MultLook factor on azimut dimension + + + * **ML_gain :** Gain applied on MultiLooked images + + +* Ground : + + +* DIn_SAR : + + + * **GridStep_range :** Step for the deformation grid on range dimension + + + * **GridStep_azimut :** Step for the deformation grid on azimut dimensio + + + * **GridStep_Threshold :** Threshold for the correlation grid (applied on correlation rate) + + + * **Grid_Gap :** Maximum gap between DEM grid values and the mean value. If the difference betwwen a value of the DEM grid ans the mena is superior to this gap then the value is set to the mean. (Avoid incoherent shift) + + + * **Interferogram_gain :** Gain applied on amplitude band of output inteferegram. + + + * **Activate_Interferogram :** Activate or deactivate interferogram output (Interferogram.rif). Activated by default. + + + * **roi :** Define the lat lng ROI coordinates. Format : 'ulx uly lrx lry' + + + * **ESD_iter :** Number of iterations for ESD loop. An automatic mode is possible by passing "auto" as value for this parameter. + + + +* Post_Processing : + + * **Activate_Ortho :** Activate or deactivate Orthorectified interferogram output (Orth_Interferogram.tif) + + + * **Spacingxy :** Set the spatial resolution for OrthRectification in degrees. Default value is 0.0001 + + + * **Activate_Filtering :** Activate or deactivate GoldStein filtering for interferogram output (filtered_interferogram.tif) + + + * **Filtered_Interferogram_mlran :** Ml factor on range for filtered inteferegram + + + * **Filtered_Interferogram_mlazi :** Ml factor on azimut for filtered inteferegram + + + * **Filtered_parameter_alpha :** alpha parameter for Goldstein filtering + + + +The processing chain needs metadata to launch the applications. Thus, input images must be into the native directory for each kind of products (i.e SAFE directory for Sentinel-1 products). diff --git a/doc_cookbook/rst/ProcessingChains/diapOTB_Chain.md b/doc_cookbook/rst/ProcessingChains/diapOTB_Chain.md new file mode 100644 index 0000000000000000000000000000000000000000..ac41be410009fa963e62555b07002f9f665d578b --- /dev/null +++ b/doc_cookbook/rst/ProcessingChains/diapOTB_Chain.md @@ -0,0 +1,126 @@ +<div align="justify"> + +# diapOTB.py + +## Description + +This workflow works on S1 StripMap and Cosmo data. It represents the main processing for this data and needs as inputs : two SLC images and an only DEM file. The inputs should be filled into the configuration file descripted in the next chapter. + +This chain is divided into four parts : + + +* Pre-Processing Chain + + +* Metadata Correction Chain + + +* DIn-SAR Chain + + +* Post-Processing Chain + +## Launch this chain + +This Python script takes a configuration file (.json) as input. +The configuration file has always the same organization : + + + + + +Five sections compose the configuration file : + + +* Global : + + + * **Master_Image_Path :** Path to the Master SAR Image. + + + * **Slave_Image_Path :** Path to the Master SAR Image + + + * **DEM_Path :** Path to the DEM + + + * **output_dir :** Output directory (all images or files created by DiapOTB will be stored inside this directory) + + +* Pre_Processing : + + + * **doppler_file :** Output file to store Doppler0 result + + + * **ML_range :** MultiLook factor on range dimension + + + * **ML_azimut :** MultiLook factor on azimut dimension + + + * **ML_gain :** Gain applied on MultiLooked images + + +* Metadata_Correction : + + + * **fine_metadata_file :** Output file to corrected metadata + + + * **activate :** Boolean to activate this chain (By default false) + + + * **GridStep_range :** Step for the correlation grid on range dimension + + + * **GridStep_azimut :** Step for the correlation grid on azimut dimension + + +* DIn_SAR : + + + * **GridStep_range :** Step for the deformation grid on range dimension + + + * **GridStep_azimut :** Step for the deformation grid on azimut dimensio + + + * **GridStep_Threshold :** Threshold for the correlation grid (applied on correlation rate) + + + * **Grid_Gap :** Maximum gap between DEM grid values and the mean value. If the difference betwwen a value of the DEM grid ans the mena is superior to this gap then the value is set to the mean. (Avoid incoherent shift) + + + * **Interferogram_gain :** Gain applied on amplitude band of output inteferegram. + + + * **Interferogram_mlran :** ML factor on range for output inteferegram (only for interferogram). + + + * **Interferogram_mlazi :** ML factor on azimut for output inteferegram (only for interferogram). + + +* Post_Processing : + + * **Activate_Ortho :** Activate or deactivate Orthorectified interferogram output (Orth_Interferogram.tif) + + + * **Spacingxy :** Set the spatial resolution for OrthRectification in degrees. Default value is 0.0001 + + + * **Activate_Filtering :** Activate or deactivate GoldStein filtering for interferogram output (filtered_interferogram.tif) + + + * **Filtered_Interferogram_mlran :** ML factor on range for filtered inteferegram + + + * **Filtered_Interferogram_mlazi :** ML factor on azimut for filtered inteferegram + + + * **Filtered_parameter_alpha :** alpha parameter for Goldstein filtering + + + +The processing chain needs metadata to launch the applications. Thus the path to the input images must be into the native directory for each kind of products (i.e SAFE directory for Sentinel-1 products). The DEM has to be a unique file but can be built with several tiles by using some gdal commands, for example. +For that moment the Metadata_Correction is not used (activate always sets to false) and the ground geometry for interferogram does not provide satisfactory results. diff --git a/doc_cookbook/rst/ProcessingChains/diapOTB_Chain.rst b/doc_cookbook/rst/ProcessingChains/diapOTB_Chain.rst deleted file mode 100644 index f4f96b2930a56e84717687617d6a89d3bf9cc65e..0000000000000000000000000000000000000000 --- a/doc_cookbook/rst/ProcessingChains/diapOTB_Chain.rst +++ /dev/null @@ -1,61 +0,0 @@ -.. _diapOTB_Chain: - -For S1 Stripmap mode and Cosmo -============================== - -This workflow works on S1 StripMap and Cosmo data. - -Description ------------ - -This chain is divided into three parts descrided below : - -- Pre-Processing Chain -- Metadata Correction Chain -- DIn-SAR Chain - -Launch this chain ------------------ - -A Python script called diapOTB.py has been developed and takes a configuration file (.json) as input. -The configuration file has always the same organization : - -.. image:: ../../Art/conf_chains/diapOTB_1_chain.png - -Four sections compose the configuration file : - -- Global : - - - **Master_Image_Path :** Path to the Master SAR Image. - - **Slave_Image_Path :** Path to the Master SAR Image - - **DEM_Path :** Path to the DEM - - **output_dir :** Output directory (all images or files created by DiapOTB will be stored inside this directory) - - -- Pre_Processing : - - - **doppler_file :** Output file to store Doppler0 result - - **ML_range :** MultLook factor on range dimension - - **ML_azimut :** MultLook factor on azimut dimension - - **ML_gain :** Gain applied on MultiLooked images - - -- Metadata_Correction : - - - **fine_metadata_file :** Output file to corrected metadata - - **activate :** Boolean to activate this chain (By default false) - - **GridStep_range :** Step for the correlation grid on range dimension - - **GridStep_azimut :** Step for the correlation grid on azimut dimension - - -- DIn_SAR : - - - **GridStep_range :** Step for the deformation grid on range dimension - - **GridStep_azimut :** Step for the deformation grid on azimut dimensio - - **GridStep_Threshold :** Threshold for the correlation grid (applied on correlation rate) - - **Grid_Gap :** Maximum gap between DEM grid values and the mean value. If the difference betwwen a value of the DEM grid ans the mena is superior to this gap then the value is set to the mean. (Avoid incoherent shift) - - **Interferogram_gain :** Gain applied on amplitude band of output inteferegram. - - **Interferogram_ortho :** Boolean to activate the optionnal ouput : inteferogram into ground geometry (By default false) - -The processing chain needs metadata to launch the applications. Thus the path to the input images must be into the native directory for each kind of products (i.e SAFE directory for Sentinel-1 products). -For that moment the Metadata_Correction is not used (activate always sets to false) and the ground geometry for interferogram does not provide satisfactory results. diff --git a/doc_cookbook/rst/ProcessingChains/diapOTB_S1IW_Chain.md b/doc_cookbook/rst/ProcessingChains/diapOTB_S1IW_Chain.md new file mode 100644 index 0000000000000000000000000000000000000000..cede24b2a3e382128aa22145c6518baf3bd6fa2b --- /dev/null +++ b/doc_cookbook/rst/ProcessingChains/diapOTB_S1IW_Chain.md @@ -0,0 +1,114 @@ +<div align="justify"> + +# diapOTB_S1IW.py + +## Description + +This workflow works on S1 IW data. It represents the main processing for this data and needs as inputs : two SLC images and an only DEM file. The inputs should be filled into the configuration file descripted in the next chapter. + +This chain is divided into four parts descrided below : + + +* Pre-Processing Chain + + +* Ground Chain + + +* DIn-SAR Chain + + +* Post-Processing + +## Launch this chain + +This Python script spreads the general processing chain (diapOTB.py) +The input configuration file (.json) has the following organization : + + + + + +Five sections compose the configuration file : + + +* Global : + + + * **Master_Image_Path :** Path to the Master SAR Image. + + + * **Slave_Image_Path :** Path to the Master SAR Image + + + * **DEM_Path :** Path to the DEM + + + * **output_dir :** Output directory (all images or files created by DiapOTB will be stored inside this directory) + + + * **burst_index :** burst index selected form the Master Image + + +* Pre_Processing : + + + * **doppler_file :** Output file to store Doppler0 result + + + * **ML_range :** MultLook factor on range dimension + + + * **ML_azimut :** MultLook factor on azimut dimension + + + * **ML_gain :** Gain applied on MultiLooked images + + +* Ground : + + +* DIn_SAR : + + + * **GridStep_range :** Step for the deformation grid on range dimension + + + * **GridStep_azimut :** Step for the deformation grid on azimut dimensio + + + * **GridStep_Threshold :** Threshold for the correlation grid (applied on correlation rate) + + + * **Grid_Gap :** Maximum gap between DEM grid values and the mean value. If the difference betwwen a value of the DEM grid ans the mena is superior to this gap then the value is set to the mean. (Avoid incoherent shift) + + + * **Interferogram_gain :** Gain applied on amplitude band of output inteferegram. + + + * **ESD_iter :** Number of iterations for ESD loop. An automatic mode is possible by passing “auto†as value for this parameter. + + + +* Post_Processing : + + * **Activate_Ortho :** Activate or deactivate Orthorectified interferogram output (Orth_Interferogram.tif) + + + * **Spacingxy :** Set the spatial resolution for OrthRectification in degrees. Default value is 0.0001 + + + * **Activate_Filtering :** Activate or deactivate GoldStein filtering for interferogram output (filtered_interferogram.tif) + + + * **Filtered_Interferogram_mlran :** Ml factor on range for filtered inteferegram + + + * **Filtered_Interferogram_mlazi :** Ml factor on azimut for filtered inteferegram + + + * **Filtered_parameter_alpha :** alpha parameter for Goldstein filtering + + +The processing chain needs metadata to launch the applications. Thus the path to the input images must be into the native directory for each kind of products (i.e SAFE directory for Sentinel-1 products). The DEM has to be a unique file but can be built with several tiles by using some gdal commands, for example. +For that moment the ground geometry for interferogram does not provide satisfactory results. diff --git a/doc_cookbook/rst/ProcessingChains/diapOTB_S1IW_Chain.rst b/doc_cookbook/rst/ProcessingChains/diapOTB_S1IW_Chain.rst deleted file mode 100644 index e61943bf85d1a0e3b467b4630662e000a8d08540..0000000000000000000000000000000000000000 --- a/doc_cookbook/rst/ProcessingChains/diapOTB_S1IW_Chain.rst +++ /dev/null @@ -1,59 +0,0 @@ -.. _diapOTB_S1IW_Chain: - -For S1 IW mode -============== - -This workflow works on S1 IW data. - -Description ------------ - -This chain is divided into three parts descrided below : - -- Pre-Processing Chain -- Ground Chain -- DIn-SAR Chain - - -Launch this chain ------------------ - -A Python script called diapOTB_S1IW.py spreads the general processing chain (diapOTB.py) -The input configuration file has the following organization : - -.. image:: ../../Art/conf_chains/diapOTB_2_chain.png - -Four sections compose the configuration file : - -- Global : - - - **Master_Image_Path :** Path to the Master SAR Image. - - **Slave_Image_Path :** Path to the Master SAR Image - - **DEM_Path :** Path to the DEM - - **output_dir :** Output directory (all images or files created by DiapOTB will be stored inside this directory) - - **burst_index :** burst index selected form the Master Image - -- Pre_Processing : - - - **doppler_file :** Output file to store Doppler0 result - - **ML_range :** MultLook factor on range dimension - - **ML_azimut :** MultLook factor on azimut dimension - - **ML_gain :** Gain applied on MultiLooked images - - -- Ground : - - -- DIn_SAR : - - - **GridStep_range :** Step for the deformation grid on range dimension - - **GridStep_azimut :** Step for the deformation grid on azimut dimensio - - **GridStep_Threshold :** Threshold for the correlation grid (applied on correlation rate) - - **Grid_Gap :** Maximum gap between DEM grid values and the mean value. If the difference betwwen a value of the DEM grid ans the mena is superior to this gap then the value is set to the mean. (Avoid incoherent shift) - - **Interferogram_gain :** Gain applied on amplitude band of output inteferegram. - - **Interferogram_ortho :** Boolean to activate the optionnal ouput : inteferogram into ground geometry (By default false) - - **ESD_iter :** Number of iterations for ESD loop. An automatic mode is possible by passing "auto" as value for this parameter. - - -The processing chain needs metadata to launch the applications. Thus the path to the input images must be into the native directory for each kind of products (i.e SAFE directory for Sentinel-1 products). -For that moment the ground geometry for interferogram does not provide satisfactory results. diff --git a/doc_cookbook/rst/ProcessingChains/tuto_chains.md b/doc_cookbook/rst/ProcessingChains/tuto_chains.md new file mode 100644 index 0000000000000000000000000000000000000000..9594d55be7f486b4c4aa5eaee5215e70885c6f8c --- /dev/null +++ b/doc_cookbook/rst/ProcessingChains/tuto_chains.md @@ -0,0 +1,25 @@ +<div align="justify"> + +# Use DiapOTB Chains + +To launch processings chains, only one argument is required as inputs : a configuration file (json format). + + +A interactive script was developped into *utils* package to generate a configuration file following a user's Q&A. + + +Thus to run a chain, you can : +* Generate a configuration file. A python script helps you to create a new json file by loading examples (into <install_directory>/python_src/ex_config) and asking for general fields such as input_path or reference image ... + +*python <install_directory>/python_src/utils/generateConfigFile.py* + +* Modify (or keep) the values into your json file (see the description of the selected processing chain) + +* Execute the selected chain : + +*python <install_directory>/python_src/<selected_chain>.py <your_json_file>* + + +` +NB : Others scripts are availble into <install_directory>/python_src/utils. You can use for example, the getEOFFromESA script to retrieve EOF files with right proxy settings. +` diff --git a/doc_cookbook/rst/home.md b/doc_cookbook/rst/home.md new file mode 100644 index 0000000000000000000000000000000000000000..5c06552f6ca79f0b043bd614091e3d2dc9bee36c --- /dev/null +++ b/doc_cookbook/rst/home.md @@ -0,0 +1,15 @@ +<div align="justify"> + +# Welcome to DiapOTB remote module!  + +This is a module implements a legacy processing chain for SAR interferometry called Diapason as an OTB remote module. + +The differential SAR interferometry (DInSAR) technique relies on the processing of two SAR images of the same portion of the Earth’s surface taken at different time. The aim is to analyze potential events (earthquake, destruction …) by highlighting differences between SAR images. DInSAR involves a set of tools such as creation of deformation grids , coregistration or building of interferograms. DiapOTB contains all necessary steps and allows to launch a complete DInSAR chain. The DiapOTB module were used with Sentinel-1 and Cosmo data with satisfactory results. + +# Table of Contents + + +* [All Applications](Applications) + + +* [Processing Chains](ProcessingChains) diff --git a/doc_cookbook/rst/index.rst b/doc_cookbook/rst/index.rst deleted file mode 100644 index 7d81226b47dac4bfbfe2f49320fe237612294b92..0000000000000000000000000000000000000000 --- a/doc_cookbook/rst/index.rst +++ /dev/null @@ -1,17 +0,0 @@ -Welcome to DiapOTB remote module! -================================= -This is a module implements a legacy processing chain for SAR interferometry called Diapason as an OTB remote module. - - -The differential SAR interferometry (DInSAR) technique relies on the processing of two SAR images of the same portion of the Earth's surface taken at different time. The aim is to analyze potential events (earthquake, destruction …) by highlighting differences between SAR images. DInSAR involves a set of tools such as creation of deformation grids , coregistration or building of interferograms. DiapOTB contains all necessary steps and allows to launch a complete DInSAR chain. The DiapOTB module were used with Sentinel-1 ans Cosmo data with satisfactory results. - - - -Table of Contents -================= - -.. toctree:: - :maxdepth: 1 - - Applications.rst - ProcessingChains.rst diff --git a/doc_cookbook/rst/templates/application.rst b/doc_cookbook/rst/templates/application.rst deleted file mode 100644 index bbe15bceff737e5f165a2bdea7d4ea17771fcaab..0000000000000000000000000000000000000000 --- a/doc_cookbook/rst/templates/application.rst +++ /dev/null @@ -1,44 +0,0 @@ -.. _{label}: - -{heading} - -{deprecation_string} - -{description} - -Description ------------ - -{longdescription} - -Parameters ----------- - -.. contents:: :local: - -.. |br| raw:: html - - <br /> - -.. |em| raw:: html - -   - -{parameters} - -Examples --------- - -From the command-line: - -.. code-block:: bash - -{examples_cli} - -From Python: - -{examples_python} - -{limitations} - -{see_also} diff --git a/doc_cookbook/rst/templates/example.rst b/doc_cookbook/rst/templates/example.rst deleted file mode 100644 index ed844cd23975bb12e4d4c769255504c2bd8a12bc..0000000000000000000000000000000000000000 --- a/doc_cookbook/rst/templates/example.rst +++ /dev/null @@ -1,13 +0,0 @@ -.. _{label}: - -{heading} - -{description} - -{usage} - -Example source code (`{link_name} <{link_href}>`__): - -.. code-block:: cpp - -{code} diff --git a/doc_cookbook/rst/templates/example_usage.rst b/doc_cookbook/rst/templates/example_usage.rst deleted file mode 100644 index d481b28659224566c953f2274e3fffdbe697ee21..0000000000000000000000000000000000000000 --- a/doc_cookbook/rst/templates/example_usage.rst +++ /dev/null @@ -1,6 +0,0 @@ -Example usage: - -.. code-block:: bash - -{} - diff --git a/doc_cookbook/rst/templates/examples_license_header.txt b/doc_cookbook/rst/templates/examples_license_header.txt deleted file mode 100644 index 5a2da0dcdb19bbcb60e8b40d120f330b7dfb5fe8..0000000000000000000000000000000000000000 --- a/doc_cookbook/rst/templates/examples_license_header.txt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ diff --git a/doc_cookbook/rst/templates/parameter.rst b/doc_cookbook/rst/templates/parameter.rst deleted file mode 100644 index 2182bcf2bf4a9657e4266c089ea453d8a5dcd698..0000000000000000000000000000000000000000 --- a/doc_cookbook/rst/templates/parameter.rst +++ /dev/null @@ -1,3 +0,0 @@ -**{name}** :code:`-{key} {value}` {flags}|br| -{description} - diff --git a/doc_cookbook/rst/templates/parameter_choice.rst b/doc_cookbook/rst/templates/parameter_choice.rst deleted file mode 100644 index 0add118a800affaf524a97125fb3a2f7ec0ca337..0000000000000000000000000000000000000000 --- a/doc_cookbook/rst/templates/parameter_choice.rst +++ /dev/null @@ -1,5 +0,0 @@ -**{name}** :code:`-{key} {value}` {flags}|br| -{description} - -{choices} - diff --git a/doc_cookbook/rst/templates/parameter_choice_entry.rst b/doc_cookbook/rst/templates/parameter_choice_entry.rst deleted file mode 100644 index e835a8c2d70ea36c0bc829366d5a13c8bda6855a..0000000000000000000000000000000000000000 --- a/doc_cookbook/rst/templates/parameter_choice_entry.rst +++ /dev/null @@ -1,2 +0,0 @@ -* **{name}** |br| {description} - diff --git a/doc_cookbook/rst/templates/parameter_group.rst b/doc_cookbook/rst/templates/parameter_group.rst deleted file mode 100644 index 0869424eb0787fbf68936bcdbab51d1094741a5e..0000000000000000000000000000000000000000 --- a/doc_cookbook/rst/templates/parameter_group.rst +++ /dev/null @@ -1,4 +0,0 @@ -{name} - -{description} - diff --git a/doc_cookbook/script_doc_sphinx.sh b/doc_cookbook/script_doc_sphinx.sh new file mode 100755 index 0000000000000000000000000000000000000000..7e32e8fe4883d44456d9fee920476ca70145ce72 --- /dev/null +++ b/doc_cookbook/script_doc_sphinx.sh @@ -0,0 +1,28 @@ +# Output Path where the wiki for the diapotb will be generated +wiki_output_path=$1 +# Creation if non existant of the repository used to generate the wiki +mkdir -p rst_tmp +# Copy of the C++ source files and the static files to the temporary repository from which will be generated the wiki +cp -R rst/* rst_tmp +# Generate the source files for the python scripts of the processing chains +sphinx-apidoc -f -o ./rst_API_Python/ ../python_src/ +# Copy of the interesting source files to rst_tmp +# Deletion of some lines uninteresting inside utils.rst +line_submodule_utils_start=$(grep -wn 'Submodules' ./rst_API_Python/utils.rst | cut -d: -f1) +line_submodule_utils_end=$(($line_submodule_utils_start + 1)) +line_modcont_utils_start=$(grep -wn 'Module contents' ./rst_API_Python/utils.rst | cut -d: -f1) +line_modcont_utils_end=$(($line_modcont_utils_start + 6)) +# Copy of the modified utils.rst to rst_tmp +sed "${line_submodule_utils_start},${line_submodule_utils_end}d;${line_modcont_utils_start},${line_modcont_utils_end}d" rst_API_Python/utils.rst > rst_tmp/PythonAPI/utils.rst + +# Deletion of some lines uninteresting inside processings.rst +line_submodule_processing_start=$(grep -wn 'Submodules' ./rst_API_Python/processings.rst | cut -d: -f1) +line_submodule_processing_end=$(($line_submodule_processing_start + 1)) +line_modcont_processing_start=$(grep -wn 'Module contents' ./rst_API_Python/processings.rst | cut -d: -f1) +line_modcont_processing_end=$(($line_modcont_processing_start + 6)) +# Copy of the modified processings.rst to rst_tmp +sed "${line_submodule_processing_start},${line_submodule_processing_end}d;${line_modcont_processing_start},${line_modcont_processing_end}d" rst_API_Python/processings.rst > rst_tmp/PythonAPI/processings.rst +# Generate the wiki repository from the source repository +sphinx-build -M markdown ./rst_tmp/ $wiki_output_path/diapotb_wiki/ -c . +#sphinx-build -b html ./rst_tmp/ $wiki_output_path/diapotb_wiki_html/ -c . +rm -r rst_tmp