[Git][debian-gis-team/xarray-safe-s1][master] 6 commits: New upstream version 2024.11.12

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Mon Nov 25 18:02:49 GMT 2024



Antonio Valentino pushed to branch master at Debian GIS Project / xarray-safe-s1


Commits:
9b8992c3 by Antonio Valentino at 2024-11-25T17:39:50+00:00
New upstream version 2024.11.12
- - - - -
bf89099f by Antonio Valentino at 2024-11-25T17:39:51+00:00
Update upstream source from tag 'upstream/2024.11.12'

Update to upstream version '2024.11.12'
with Debian dir 92afd6f6f6fbe95e0c1cee1f0e11bc173713d6e2
- - - - -
d5ac5cbd by Antonio Valentino at 2024-11-25T17:40:30+00:00
New upstream release

- - - - -
1824303e by Antonio Valentino at 2024-11-25T17:45:16+00:00
Refresh all patches

- - - - -
d0e7127e by Antonio Valentino at 2024-11-25T17:47:38+00:00
Drop dependency on xarray-datatree

- - - - -
174dabf1 by Antonio Valentino at 2024-11-25T17:51:04+00:00
Set distribution to unstable

- - - - -


10 changed files:

- .github/workflows/publish.yml
- debian/changelog
- debian/control
- debian/patches/0001-Remove-set_trace.patch
- docs/index.rst
- + highleveltests/open_GRD_IW.py
- highleveltests/open_SLC_IW.py
- pyproject.toml
- safe_s1/reader.py
- safe_s1/sentinel1_xml_mappings.py


Changes:

=====================================
.github/workflows/publish.yml
=====================================
@@ -28,7 +28,7 @@ jobs:
           twine check dist/*
           pip install dist/*.whl
       - name: Publish to PyPI
-        uses: pypa/gh-action-pypi-publish at 81e9d935c883d0b210363ab89cf05f3894778450
+        uses: pypa/gh-action-pypi-publish at 15c56dba361d8335944d31a2ecd17d700fc7bcbc
         with:
           password: ${{ secrets.pypi_token }}
           repository_url: https://upload.pypi.org/legacy/


=====================================
debian/changelog
=====================================
@@ -1,9 +1,16 @@
-xarray-safe-s1 (2024.05.16-2) UNRELEASED; urgency=medium
+xarray-safe-s1 (2024.11.12-1) unstable; urgency=medium
 
-  * Team upload.
+  [ Bas Couwenberg ]
   * Bump Standards-Version to 4.7.0, no changes.
 
- -- Bas Couwenberg <sebastic at debian.org>  Sun, 28 Jul 2024 20:07:17 +0200
+  [ Antonio Valentino ]
+  * New upstream release.
+  * debian/patches:
+    - Refresh all patches.
+  * debian/control:
+    - Drop dependency on xarray-datatree and require xarray (>= 2024.10.0).
+
+ -- Antonio Valentino <antonio.valentino at tiscali.it>  Mon, 25 Nov 2024 17:50:43 +0000
 
 xarray-safe-s1 (2024.05.16-1) unstable; urgency=medium
 


=====================================
debian/control
=====================================
@@ -22,8 +22,7 @@ Build-Depends: debhelper-compat (= 13),
                python3-setuptools,
                python3-setuptools-scm,
                python3-shapely,
-               python3-xarray,
-               python3-xarray-datatree
+               python3-xarray (>= 2024.10.0)
 Standards-Version: 4.7.0
 Testsuite: autopkgtest-pkg-pybuild
 Rules-Requires-Root: no


=====================================
debian/patches/0001-Remove-set_trace.patch
=====================================
@@ -8,7 +8,7 @@ Forwarded: not-needed
  1 file changed, 2 deletions(-)
 
 diff --git a/highleveltests/open_SLC_IW.py b/highleveltests/open_SLC_IW.py
-index 2f0f930..097d496 100644
+index 802e018..088eee6 100644
 --- a/highleveltests/open_SLC_IW.py
 +++ b/highleveltests/open_SLC_IW.py
 @@ -1,4 +1,3 @@
@@ -19,5 +19,5 @@ index 2f0f930..097d496 100644
 @@ -12,4 +11,3 @@ dt = sub_reader.datatree
  print('out of the reader')
  print(dt)
- print('time to read the SAFE through S3: %1.2f sec'%elapse_t)
+ print('time to read the SAFE through nfs: %1.2f sec'%elapse_t)
 -pdb.set_trace()


=====================================
docs/index.rst
=====================================
@@ -13,12 +13,12 @@ Overview
 ........
 
     **safe_s1** rely on `xarray.open_rasterio` and `rasterio` to read *digital_number* from SAFE
-    product to return an xarray-datatree.
+    product to return an xarray.datatree.
 
     Luts are decoded from xml files following `ESA Sentinel-1 Product Specification`_.
 
 
-    `safe_s1.metadata.Sentinel1reader` is the main class and contains a xarray-datatree with the useful data. In the following example, you will find some additional functions and properties that can be useful.
+    `safe_s1.metadata.Sentinel1reader` is the main class and contains a xarray.datatree with the useful data. In the following example, you will find some additional functions and properties that can be useful.
 
 Examples
 ........


=====================================
highleveltests/open_GRD_IW.py
=====================================
@@ -0,0 +1,23 @@
+import pdb
+from safe_s1 import Sentinel1Reader, getconfig
+import time
+import logging
+logging.basicConfig(level=logging.DEBUG)
+logging.debug('start GRD test')
+conf = getconfig.get_config()
+subswath = conf['product_paths'][0]
+print(subswath)
+t0 = time.time()
+if 'GRD' in subswath:
+    sub_reader = Sentinel1Reader(subswath)
+else:
+    sub_reader = Sentinel1Reader('SENTINEL1_DS:'+subswath+':IW3')
+elapse_t = time.time()-t0
+
+dt = sub_reader.datatree
+print('out of the reader')
+print(dt)
+print('time to read the SAFE through nfs: %1.2f sec'%elapse_t)
+DN = sub_reader.load_digital_number(chunks={'pol':'VV','line':6000,'sample':8000})
+print('DN',DN)
+# pdb.set_trace()


=====================================
highleveltests/open_SLC_IW.py
=====================================
@@ -11,5 +11,5 @@ elapse_t = time.time()-t0
 dt = sub_reader.datatree
 print('out of the reader')
 print(dt)
-print('time to read the SAFE through S3: %1.2f sec'%elapse_t)
+print('time to read the SAFE through nfs: %1.2f sec'%elapse_t)
 pdb.set_trace()


=====================================
pyproject.toml
=====================================
@@ -5,8 +5,7 @@ license = {text = "MIT"}
 dependencies = [
     "geopandas",
     "numpy",
-    "xarray",
-    "xarray-datatree",
+    "xarray>=2024.10.0",
     "lxml",
     "rioxarray",
     "jmespath",


=====================================
safe_s1/reader.py
=====================================
@@ -8,11 +8,10 @@ import rasterio
 import yaml
 from affine import Affine
 from rioxarray import rioxarray
-
-from . import sentinel1_xml_mappings
-from .xml_parser import XmlParser
+import logging
+from safe_s1 import sentinel1_xml_mappings
+from safe_s1.xml_parser import XmlParser
 import xarray as xr
-import datatree
 import pandas as pd
 import warnings
 
@@ -20,6 +19,7 @@ import warnings
 class Sentinel1Reader:
 
     def __init__(self, name, backend_kwargs=None):
+        logging.debug('input name: %s',name)
         if not isinstance(name, (str, os.PathLike)):
            raise ValueError(f"cannot deal with object of type {type(name)}: {name}")
         # gdal dataset name
@@ -29,13 +29,19 @@ class Sentinel1Reader:
         """Gdal dataset name"""
         name_parts = self.name.split(':')
         if len(name_parts) > 3:
+            logging.debug('windows case')
             # windows might have semicolon in path ('c:\...')
             name_parts[1] = ':'.join(name_parts[1:-1])
             del name_parts[2:-1]
         name_parts[1] = os.path.basename(name_parts[1])
         self.short_name = ':'.join(name_parts)
+        logging.debug('short_name : %s',self.short_name)
         """Like name, but without path"""
-        self.path = ':'.join(self.name.split(':')[1:-1])
+        if len(name_parts) == 2:
+            self.path = self.name.split(':')[1]
+        else:
+            self.path = ':'.join(self.name.split(':')[1:-1])
+        logging.debug('path: %s',self.path)
         # remove trailing slash in the safe path
         if self.path[-1]=='/':
             self.path = self.path.rstrip('/')
@@ -108,7 +114,7 @@ class Sentinel1Reader:
                 'antenna_pattern':self.antenna_pattern,
                 'swath_merging': self.swath_merging
             }
-            self.dt = datatree.DataTree.from_dict(self._dict)
+            self.dt = xr.DataTree.from_dict(self._dict)
             assert self.dt==self.datatree
         else:
             print('multidataset')
@@ -341,7 +347,7 @@ class Sentinel1Reader:
 
         Returns
         -------
-        datatree.DataTree
+        xr.DataTree
             Contains data from the reader
         """
         return self.dt


=====================================
safe_s1/sentinel1_xml_mappings.py
=====================================
@@ -151,6 +151,7 @@ xpath_mappings = {
         
         'aux_cal': (scalar, '//metadataSection/metadataObject/metadataWrap/xmlData/safe:processing/safe:resource/safe:processing/safe:resource[@role="AUX_CAL"]/@name'),
         'aux_pp1': (scalar, '//metadataSection/metadataObject/metadataWrap/xmlData/safe:processing/safe:resource/safe:processing/safe:resource[@role="AUX_PP1"]/@name'),
+        'aux_ins': (scalar, '//metadataSection/metadataObject/metadataWrap/xmlData/safe:processing/safe:resource/safe:processing/safe:resource[@role="AUX_INS"]/@name'),
 
         'aux_cal_sl2': (scalar,'//metadataSection/metadataObject/metadataWrap/xmlData/safe:processing/safe:resource[@role="AUX_CAL"]/@name'),
         'annotation_files': (
@@ -182,6 +183,9 @@ xpath_mappings = {
         'xsd_overlay_file': (
             normpath,
             '/xfdu:XFDU/metadataSection/metadataObject[@ID="s1Level1MapOverlaySchema"]/metadataReference/@href'),
+        'instrument_configuration_id': (scalar, 
+            '//s1sarl1:standAloneProductInformation/s1sarl1:instrumentConfigurationID/text()', 
+            )
     },
     'calibration': {
         'polarization': (scalar, '/calibration/adsHeader/polarisation'),
@@ -901,7 +905,9 @@ compounds_vars = {
         'stop_date': 'manifest.stop_date',
         'footprints': 'manifest.footprints',
         'aux_cal': 'manifest.aux_cal',
-        'aux_pp1': 'manifest.aux_pp1'
+        'aux_pp1': 'manifest.aux_pp1',
+        'aux_ins': 'manifest.aux_ins',
+        'icid' : 'manifest.instrument_configuration_id'
     },
     'safe_attributes_sl2': {
         'ipf_version': 'manifest.ipf_version',



View it on GitLab: https://salsa.debian.org/debian-gis-team/xarray-safe-s1/-/compare/33a421483964e26aa547a386b24cd239478d8dc2...174dabf10a7d21a4cc33a389bc26bcdbc53e36fc

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/xarray-safe-s1/-/compare/33a421483964e26aa547a386b24cd239478d8dc2...174dabf10a7d21a4cc33a389bc26bcdbc53e36fc
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20241125/2ba7ec85/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list