Skip to content

Commit c316c33

Browse files
authored
Merge pull request #28 from umr-lops/fixesMay24
fix multidataset and misintterpreted safe path.
2 parents 2fc774c + 323f09a commit c316c33

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

highleveltests/open_SLC_IW.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import pdb
12
from safe_s1 import Sentinel1Reader, getconfig
23
import time
34
conf = getconfig.get_config()
@@ -11,3 +12,4 @@
1112
print('out of the reader')
1213
print(dt)
1314
print('time to read the SAFE through S3: %1.2f sec'%elapse_t)
15+
pdb.set_trace()

safe_s1/reader.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ def __init__(self, name, backend_kwargs=None):
3636
self.short_name = ':'.join(name_parts)
3737
"""Like name, but without path"""
3838
self.path = ':'.join(self.name.split(':')[1:-1])
39+
# remove trailing slash in the safe path
40+
if self.path[-1]=='/':
41+
self.path = self.path.rstrip('/')
3942
"""Dataset path"""
4043
self.safe = os.path.basename(self.path)
4144

@@ -109,7 +112,7 @@ def __init__(self, name, backend_kwargs=None):
109112
assert self.dt==self.datatree
110113
else:
111114
print('multidataset')
112-
raise Exception()
115+
# raise Exception()
113116

114117
def load_digital_number(self, resolution=None, chunks=None, resampling=rasterio.enums.Resampling.rms):
115118
"""
@@ -519,7 +522,6 @@ def swath_merging(self):
519522
describe=True)
520523
else :
521524
ds = xr.Dataset()
522-
523525
return ds
524526

525527
@property

0 commit comments

Comments
 (0)