From 006a495abe239a5fe3f6f5a380e0b5fe1aed5503 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ga=C3=ABlle=20USSEGLIO?= <gaelle.usseglio@cnes.fr>
Date: Thu, 6 Feb 2020 09:09:46 +0000
Subject: [PATCH] ENH : Update doc generation for our new Python API and news
 chains

---
 doc_cookbook/generate_cookbook.txt            |  2 +-
 doc_cookbook/rst_API_Python/SAR_MultiSlc.rst  |  7 ++++
 .../rst_API_Python/SAR_MultiSlc_IW.rst        |  7 ++++
 .../rst_API_Python/coRegistation_S1IW.rst     |  7 ----
 .../rst_API_Python/diapOTB_S1IW_TEST.rst      |  7 ----
 doc_cookbook/rst_API_Python/modules.rst       |  4 +-
 doc_cookbook/rst_API_Python/processings.rst   | 10 ++++-
 python_src/SAR_MultiSlc.py                    | 16 +++++++-
 python_src/SAR_MultiSlc_IW.py                 | 19 +++++++--
 python_src/diapOTB.py                         | 10 ++++-
 python_src/diapOTB_S1IW.py                    | 10 ++++-
 python_src/processings/DInSar.py              |  6 +--
 python_src/processings/Ground.py              |  8 ++--
 python_src/processings/Metadata_Correction.py |  8 ++--
 python_src/processings/Pre_Processing.py      |  8 ++--
 python_src/utils/DiapOTB_applications.py      | 39 ++++++++++---------
 16 files changed, 106 insertions(+), 62 deletions(-)
 create mode 100644 doc_cookbook/rst_API_Python/SAR_MultiSlc.rst
 create mode 100644 doc_cookbook/rst_API_Python/SAR_MultiSlc_IW.rst
 delete mode 100644 doc_cookbook/rst_API_Python/coRegistation_S1IW.rst
 delete mode 100644 doc_cookbook/rst_API_Python/diapOTB_S1IW_TEST.rst

diff --git a/doc_cookbook/generate_cookbook.txt b/doc_cookbook/generate_cookbook.txt
index 86a00c4..797d74f 100644
--- a/doc_cookbook/generate_cookbook.txt
+++ b/doc_cookbook/generate_cookbook.txt
@@ -16,7 +16,7 @@ NB:
 
 Pour générer à partir pour l'API Python (générer depuis les commentaires des .py):
 	_ Environnement vierge dans le conda qui va bien.
-	_ Commenter provisoirement les import sur jsonshema et otbApplication
+	_ Commenter provisoirement les import sur jsonshema, gdal, h5py, ogr et otbApplication
 	_ Les fichiers n'ont pas besoins d'être touchés normalement car font appel à des "automodule" via autotoc mais si il le faut alors : sphinx-apidoc -f -o rst_API_Python/ ../python_src/
 	_ Générer les Markdown : sphinx-build -M markdown ./rst_API_Python/ build_API_Python/ -c .
 
diff --git a/doc_cookbook/rst_API_Python/SAR_MultiSlc.rst b/doc_cookbook/rst_API_Python/SAR_MultiSlc.rst
new file mode 100644
index 0000000..1a156ee
--- /dev/null
+++ b/doc_cookbook/rst_API_Python/SAR_MultiSlc.rst
@@ -0,0 +1,7 @@
+SAR\_MultiSlc module
+====================
+
+.. automodule:: SAR_MultiSlc
+   :members:
+   :undoc-members:
+   :show-inheritance:
diff --git a/doc_cookbook/rst_API_Python/SAR_MultiSlc_IW.rst b/doc_cookbook/rst_API_Python/SAR_MultiSlc_IW.rst
new file mode 100644
index 0000000..bea668c
--- /dev/null
+++ b/doc_cookbook/rst_API_Python/SAR_MultiSlc_IW.rst
@@ -0,0 +1,7 @@
+SAR\_MultiSlc\_IW module
+========================
+
+.. automodule:: SAR_MultiSlc_IW
+   :members:
+   :undoc-members:
+   :show-inheritance:
diff --git a/doc_cookbook/rst_API_Python/coRegistation_S1IW.rst b/doc_cookbook/rst_API_Python/coRegistation_S1IW.rst
deleted file mode 100644
index e8a7705..0000000
--- a/doc_cookbook/rst_API_Python/coRegistation_S1IW.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-coRegistation\_S1IW module
-==========================
-
-.. automodule:: coRegistation_S1IW
-   :members:
-   :undoc-members:
-   :show-inheritance:
diff --git a/doc_cookbook/rst_API_Python/diapOTB_S1IW_TEST.rst b/doc_cookbook/rst_API_Python/diapOTB_S1IW_TEST.rst
deleted file mode 100644
index 3b7b3ad..0000000
--- a/doc_cookbook/rst_API_Python/diapOTB_S1IW_TEST.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-diapOTB\_S1IW\_TEST module
-==========================
-
-.. automodule:: diapOTB_S1IW_TEST
-   :members:
-   :undoc-members:
-   :show-inheritance:
diff --git a/doc_cookbook/rst_API_Python/modules.rst b/doc_cookbook/rst_API_Python/modules.rst
index 3dd3dc1..3177c31 100644
--- a/doc_cookbook/rst_API_Python/modules.rst
+++ b/doc_cookbook/rst_API_Python/modules.rst
@@ -4,9 +4,9 @@ python_src
 .. toctree::
    :maxdepth: 4
 
-   coRegistation_S1IW
+   SAR_MultiSlc
+   SAR_MultiSlc_IW
    diapOTB
    diapOTB_S1IW
-   diapOTB_S1IW_TEST
    processings
    utils
diff --git a/doc_cookbook/rst_API_Python/processings.rst b/doc_cookbook/rst_API_Python/processings.rst
index b8e5eea..8180b86 100644
--- a/doc_cookbook/rst_API_Python/processings.rst
+++ b/doc_cookbook/rst_API_Python/processings.rst
@@ -16,7 +16,15 @@ processings.Ground module
 -------------------------
 
 .. automodule:: processings.Ground
-   :members: 
+   :members:
+   :undoc-members:
+   :show-inheritance:
+
+processings.Metadata\_Correction module
+---------------------------------------
+
+.. automodule:: processings.Metadata_Correction
+   :members:
    :undoc-members:
    :show-inheritance:
 
diff --git a/python_src/SAR_MultiSlc.py b/python_src/SAR_MultiSlc.py
index 5f7a397..a215814 100644
--- a/python_src/SAR_MultiSlc.py
+++ b/python_src/SAR_MultiSlc.py
@@ -18,7 +18,21 @@
 # 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.
-#
+
+""" 
+    SAR_MultiSlc.py
+    ===============
+
+    Interferometry chain between multitemporal SAR images for S1 Strimap and Cosmo products. 
+    One master image is fixed by users and other images are processed as slave image.
+ 
+"""
+
+__author__ = "Maxime Azzoni"
+__version__ = "0.1"
+__status__ = "Developpement"
+__date__ = "05/02/2020"
+__last_modified__ = "05/02/2020"
 
 # ===============
 # Import section
diff --git a/python_src/SAR_MultiSlc_IW.py b/python_src/SAR_MultiSlc_IW.py
index 8b569ec..43376b9 100644
--- a/python_src/SAR_MultiSlc_IW.py
+++ b/python_src/SAR_MultiSlc_IW.py
@@ -18,8 +18,21 @@
 # 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.
-# Version 3 
 
+""" 
+    SAR_MultiSlc_IW.py
+    ==================
+
+    Interferometry chain between multitemporal SAR images for S1 IW products. 
+    One master image is fixed by users and other images are processed as slave image.
+ 
+"""
+
+__author__ = "Maxime Azzoni"
+__version__ = "0.1"
+__status__ = "Developpement"
+__date__ = "05/02/2020"
+__last_modified__ = "05/02/2020"
 
 # ==================================== #
  #              Imports              # 
@@ -41,8 +54,8 @@ from processings import DInSar
 import utils.DiapOTB_applications as diapOTBApp
 from utils import func_utils
 
-import psutil
-mem_state = dict(psutil.virtual_memory()._asdict())
+#import psutil
+#mem_state = dict(psutil.virtual_memory()._asdict())
 
 
 # ==================================== #
diff --git a/python_src/diapOTB.py b/python_src/diapOTB.py
index 1f57666..2a562a8 100644
--- a/python_src/diapOTB.py
+++ b/python_src/diapOTB.py
@@ -20,11 +20,19 @@
 # limitations under the License.
 #
 
+""" 
+    diapOTB.py
+    ==========
+
+    Interferometry chain between two SAR images (master/slave) for S1 Strimap and Cosmo products
+ 
+"""
+
 __author__ = "POC-THALES"
 __version__ = "0.1"
 __status__ = "Developpement"
 __date__ = "27/10/2017"
-__last_modified__ = "27/10/2017"
+__last_modified__ = "05/02/2020"
 
 # Imports
 import sys
diff --git a/python_src/diapOTB_S1IW.py b/python_src/diapOTB_S1IW.py
index d746839..37cc19b 100644
--- a/python_src/diapOTB_S1IW.py
+++ b/python_src/diapOTB_S1IW.py
@@ -20,11 +20,19 @@
 # limitations under the License.
 #
 
+""" 
+    diapOTB_S1IW.py
+    ===============
+
+    Interferometry chain between two SAR images (master/slave) for S1 IW products
+ 
+"""
+
 __author__ = "POC-THALES"
 __version__ = "0.1"
 __status__ = "Developpement"
 __date__ = "11/12/2018"
-__last_modified__ = "11/12/2018"
+__last_modified__ = "05/02/2020"
 
 # Imports
 import logging
diff --git a/python_src/processings/DInSar.py b/python_src/processings/DInSar.py
index 4988438..54bf010 100644
--- a/python_src/processings/DInSar.py
+++ b/python_src/processings/DInSar.py
@@ -26,11 +26,9 @@
  
     Use the module to launch DInSar processigns.
  
-    main function
-    --------------
+    main function : gridToInterferogram
+    -----------------------------------
  
-    gridToInterferogram
-  
 """
 
 import os
diff --git a/python_src/processings/Ground.py b/python_src/processings/Ground.py
index 10ed049..966699d 100644
--- a/python_src/processings/Ground.py
+++ b/python_src/processings/Ground.py
@@ -26,11 +26,9 @@
  
     Use the module to launch Ground chain.
  
-    main function
-    --------------
- 
-    demProjectionAndCartesianEstimation
- 
+    main function : demProjectionAndCartesianEstimation
+    ----------------------------------------------------
+  
 """
 
 import os
diff --git a/python_src/processings/Metadata_Correction.py b/python_src/processings/Metadata_Correction.py
index 05927e8..7336385 100644
--- a/python_src/processings/Metadata_Correction.py
+++ b/python_src/processings/Metadata_Correction.py
@@ -24,12 +24,10 @@
     The ``Metadata Correction`` chain
     =================================
  
-    Use the module to launch Metadata Correction chain (only available for S1 SM or Cosmo.
+    Use the module to launch Metadata Correction chain (only available for S1 SM or Cosmo).
  
-    main function
-    --------------
- 
-    metadataCorrection
+    main function : metadataCorrection
+    ----------------------------------    
  
 """
 
diff --git a/python_src/processings/Pre_Processing.py b/python_src/processings/Pre_Processing.py
index df68969..3fd1d5b 100644
--- a/python_src/processings/Pre_Processing.py
+++ b/python_src/processings/Pre_Processing.py
@@ -26,11 +26,9 @@
  
     Use the module to launch Pre_Processing chain.
  
-    main function
-    --------------
- 
-    extractToMultilook
- 
+    main function : extractToMultilook
+    ----------------------------------
+
 """
 
 import os
diff --git a/python_src/utils/DiapOTB_applications.py b/python_src/utils/DiapOTB_applications.py
index e9ec507..9da1acf 100644
--- a/python_src/utils/DiapOTB_applications.py
+++ b/python_src/utils/DiapOTB_applications.py
@@ -28,22 +28,23 @@
     Applications are used with ExecuteAndWriteOutput as execute command => I/O on disk and not integrated 
     for a mode In-Memory. 
      
-    Applications list
-    -----------------
-
-    extractROI
-    burstExtraction
-    doppler0
-    multilook
-    demProjection
-    cartesianMeanEstimation
-    fineGridDeformation
-    coRegistration
-    deramp
-    interferogram
-    esd
-    concatenate
-    orthorectification 
+    Applications list :
+    -------------------
+
+    extractROI,
+    burstExtraction,
+    doppler0,
+    multilook,
+    demProjection,
+    cartesianMeanEstimation,
+    fineGridDeformation,
+    coRegistration,
+    deramp,
+    interferogram,
+    esd,
+    concatenate,
+    orthorectification,
+    GridOffset.
 """
 
 import os
@@ -398,17 +399,17 @@ def fineGridDeformation(indem, insarmaster, insarslave, inmlmaster, inmlslave, i
 def coRegistration(insarmaster, insarslave, ingrid, gridsteprange, gridstepazimut, doppler0, nbramps, outPath, ram="4000"):
     """
         Launch SARCoRegistration application (from DiapOTB).
- 
+
         This application does the coregistration between
         two SAR images thanks to a deformation grid.
- 
+
         :param insarmaster: SAR Master Image to extract SAR geometry.
         :param insarslave: SAR Slave Image to extract SAR geometry.
         :param ingrid: Input deformation grid.
         :param gridsteprange: Grid step for range dimension (into SLC/SAR geometry).
         :param gridstepazimut: Grid step for azimut dimension (into SLC/SAR geometry).
         :param doppler0: Doppler 0 in azimut for SAR Slave Image.
-        :param nbramps : Number of ramps for coregistration
+        :param nbramps: Number of ramps for coregistration
         :param outPath: Coregistrated slave image into master geometry.
     
         :type insarmaster: string
-- 
GitLab