Skip to content

Commit

Permalink
remove the Exception for multidataset to allow multids exploration an…
Browse files Browse the repository at this point in the history
…d fix issue with trailing slash in the path
  • Loading branch information
agrouaze committed May 6, 2024
1 parent 2fc774c commit 323f09a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions highleveltests/open_SLC_IW.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pdb
from safe_s1 import Sentinel1Reader, getconfig
import time
conf = getconfig.get_config()
Expand All @@ -11,3 +12,4 @@
print('out of the reader')
print(dt)
print('time to read the SAFE through S3: %1.2f sec'%elapse_t)
pdb.set_trace()
6 changes: 4 additions & 2 deletions safe_s1/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def __init__(self, name, backend_kwargs=None):
self.short_name = ':'.join(name_parts)
"""Like name, but without path"""
self.path = ':'.join(self.name.split(':')[1:-1])
# remove trailing slash in the safe path
if self.path[-1]=='/':
self.path = self.path.rstrip('/')
"""Dataset path"""
self.safe = os.path.basename(self.path)

Expand Down Expand Up @@ -109,7 +112,7 @@ def __init__(self, name, backend_kwargs=None):
assert self.dt==self.datatree
else:
print('multidataset')
raise Exception()
# raise Exception()

def load_digital_number(self, resolution=None, chunks=None, resampling=rasterio.enums.Resampling.rms):
"""
Expand Down Expand Up @@ -519,7 +522,6 @@ def swath_merging(self):
describe=True)
else :
ds = xr.Dataset()

return ds

@property
Expand Down

0 comments on commit 323f09a

Please sign in to comment.