Commit 00f83966 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed TypeError in case the input image for the prediction has no nodata...


Fixed TypeError in case the input image for the prediction has no nodata pixels and no in- and output nodata value is given.
Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 64863b79
......@@ -12,6 +12,8 @@ History
* Added weights attribute to prediction result.
* RSImage_ClusterPredictor.predict now logs the fractions of nodata, global and optimized regressors.
* Added 'progress' keyword to SpectralHomogenizer and RSImage_ClusterPredictor. Improved log output.
* Fixed TypeError in case the input image for the prediction has no nodata pixels and no in- and output nodata
value is given.
0.9.3 (2020-12-15)
------------------
......
......@@ -424,6 +424,8 @@ class RSImage_ClusterPredictor(object):
train_spectra = classifier.cluster_centers
train_labels = classifier.cluster_pixVals
# run classification
# - uses 3 neighbors by default
self.classif_map, self.distance_metrics = classify_image(image, train_spectra, train_labels, **kw_clf)
# compute spectral distance
......@@ -511,7 +513,8 @@ class RSImage_ClusterPredictor(object):
# print(weights[0, 0, :])
# set image_predicted to nodata at nodata positions of the input image
image_predicted[~image.mask_nodata[:]] = out_nodataVal
if out_nodataVal is not None:
image_predicted[~image.mask_nodata[:]] = out_nodataVal
# NOTE:
# - prediction now only runs on the remaining pixels (that contain data)
......
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