Skip to content

Commit 5f84358

Browse files
authored
Merge pull request #29 from umr-lops/fixesMay24
add missing history for noise_lut_range_raw
2 parents c316c33 + 9c6239c commit 5f84358

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

safe_s1/reader.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def __init__(self, name, backend_kwargs=None):
112112
assert self.dt==self.datatree
113113
else:
114114
print('multidataset')
115-
# raise Exception()
115+
# there is no error raised here, because we want to let the user access the metadata for multidatasets
116116

117117
def load_digital_number(self, resolution=None, chunks=None, resampling=rasterio.enums.Resampling.rms):
118118
"""
@@ -646,6 +646,7 @@ def get_noise_range_raw(self):
646646
"""
647647
tmp = []
648648
pols = []
649+
history = []
649650
for pol_code, xml_file in self.files['noise'].items():
650651
#pol = self.files['polarization'].cat.categories[pol_code - 1]
651652
pol = os.path.basename(xml_file).split('-')[4].upper()
@@ -657,8 +658,10 @@ def get_noise_range_raw(self):
657658
hihi = self.xml_parser.get_var(self.files['noise'].iloc[0], 'noise.range.%s' % varitmp,
658659
describe=True)
659660
noise_lut_range_raw_ds[vari].attrs['description'] = hihi
661+
history.append(self.xml_parser.get_compound_var(xml_file, 'noise_lut_range_raw', describe=True))
660662
tmp.append(noise_lut_range_raw_ds)
661663
ds = xr.concat(tmp, pd.Index(pols, name="pol"))
664+
ds.attrs['history'] = '\n'.join(history)
662665
return ds
663666

664667
def get_noise_azi_initial_parameters(self, pol):

0 commit comments

Comments
 (0)