ContinuumIO / elm

Phase I & part of Phase II of NASA SBIR - Parallel Machine Learning on Satellite Data
http://ensemble-learning-models.readthedocs.io
43 stars 27 forks source link

fix data type issue in set_na_from_meta #104

Closed PeterDSteinberg closed 7 years ago

PeterDSteinberg commented 7 years ago

While writing some docs for set_na_from_meta, a function which searches for keys like valid_range, invalid_range and missing_value in an ElmStore's attrs to set NaNs accordingly, I found it was failing when the values attaches to these keys needed to be converted to float from string. I also found that valid_range, when in the attrs at the ElmStore level, rather than band level (DataArray attrs), was incorrect.

This PR fixes the data type issues in searching the metadata and also changes the set_na_from_meta function to just look at band metadata (the DataArrays) rather than the attrrs at the ElmStore level. The PR also improves test coverage on set_na_from_meta.