Skip to content

Commit

Permalink
Fix old geomedian nodata issue (#69)
Browse files Browse the repository at this point in the history
- Fix crash when `hdmedians` GeoMedian statistics is run

NOTES:
- The crash reports that all the bands do not have the same `nodata` value
- This was caused by `nodata` being set to NaNs (and the fact that NaN != NaN)
- Output measurement type of GeoMedian should be the same as the input
  • Loading branch information
uchchwhash authored Feb 23, 2018
1 parent f3c30b2 commit 15058ca
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
13 changes: 0 additions & 13 deletions datacube_stats/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,19 +805,6 @@ def compute(self, data):

return data.transpose(*to).to_dataset(dim='variable')

def measurements(self, input_measurements):
"""
Outputs will have the same name as inputs, but dtype will always be float32.
"""
output_measurements = [
{attr: measurement[attr] for attr in ['name', 'dtype', 'nodata', 'units']}
for measurement in input_measurements]
for measurement in output_measurements:
measurement['dtype'] = 'float32'
measurement['nodata'] = np.nan

return output_measurements

@staticmethod
def _vars_to_transpose(data):
"""
Expand Down
2 changes: 1 addition & 1 deletion datacube_stats/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
dependencies imported in datacube_stats/__init__.py that are not present until after
install. Do not import anything into this module."""

__version__ = '0.9a7'
__version__ = '0.9a8'

0 comments on commit 15058ca

Please sign in to comment.