[GRASS-SVN] r73129 - grass-addons/grass7/imagery/i.sentinel/i.sentinel.download

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 21 08:57:13 PDT 2018


Author: martinl
Date: 2018-08-21 08:57:13 -0700 (Tue, 21 Aug 2018)
New Revision: 73129

Modified:
   grass-addons/grass7/imagery/i.sentinel/i.sentinel.download/i.sentinel.download.py
Log:
i.sentinel.download: catch invalid uuid error

Modified: grass-addons/grass7/imagery/i.sentinel/i.sentinel.download/i.sentinel.download.py
===================================================================
--- grass-addons/grass7/imagery/i.sentinel/i.sentinel.download/i.sentinel.download.py	2018-08-21 12:33:20 UTC (rev 73128)
+++ grass-addons/grass7/imagery/i.sentinel/i.sentinel.download/i.sentinel.download.py	2018-08-21 15:57:13 UTC (rev 73129)
@@ -297,10 +297,17 @@
 
         :param uuid: uuid to download
         """
-        self._products_df_sorted = {}
+        from sentinelsat.sentinel import SentinelAPIError
+                    
+        self._products_df_sorted = { 'uuid': [] }
+        for uuid in uuid_list:
+            try:
+                odata = self._api.get_product_odata(uuid, full=True)
+            except SentinelAPIError as e:
+                gs.error('{0}. UUID {1} skipped'.format(e, uuid))
+                continue
 
-        for uuid in uuid_list:
-            for k, v in self._api.get_product_odata(uuid, full=True).items():
+            for k, v in odata.items():
                 if k == 'id':
                     k = 'uuid'
                 elif k == 'Sensing start':



More information about the grass-commit mailing list