Commit 7d0bc908 authored by Jeff Piollé's avatar Jeff Piollé

read correct fillvalue in MODIS NASA L2 files

parent 9f61825b
......@@ -194,6 +194,15 @@ class HDFFile(AbstractMapper):
datatype=TYPE_CONVERT[str(typestr)]
)
rec.attach_storage(self.get_field_handler(fieldname))
# retrieve fill value
fill_value = None
for att in ['bad_value_scaled', '_FillValue']:
if att in varattrs:
fill_value = varattrs[att]
rec.fillvalue = fill_value
break
# MetaData
rec.units = None
if 'units' in varattrs:
......@@ -262,7 +271,7 @@ class HDFFile(AbstractMapper):
# mask fill values
if fill_value is not None:
values = numpy.ma.masked_equal(values, fill_value)
numpy.ma.set_fill_value(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