Commit 870c19b3 authored by Jeff Piollé's avatar Jeff Piollé

added decoding of more possible fill_value attributes in HDFFile class

parent 0dc8c534
......@@ -252,12 +252,17 @@ class HDFFile(AbstractMapper):
count=tuple(slstop),
stride=tuple(slstride))
attrs = self.read_field_attributes(fieldname)
if '_FillValue' in attrs:
fill_value = attrs['_FillValue']
else:
fill_value = None
if not fill_value is None:
values = numpy.ma.array(values, fill_value=fill_value)
# retrieve fill value
fill_value = None
for att in ['bad_value_scaled', '_FillValue']:
if att in attrs:
fill_value = attrs[att]
break
# mask fill values
if fill_value is not None:
values = numpy.ma.masked_equal(values, fill_value)
else:
values = numpy.ma.array(values)
if 'scale_factor' in attrs:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment