Commit fa37d4bc authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Cleaned up.

parent 9429243a
Pipeline #3183 passed with stage
in 17 minutes and 39 seconds
......@@ -1577,13 +1577,6 @@ class RSImage_ClusterPredictor(object):
in case more than one sub-classes are used for prediction
:param CPUs: CPUs to use (default: 1)
:return: 3D array representing the predicted spectral image cube
FIXME:
Wichtig, dass hier der richtige nodata value in image.nodata drin steht.
Beachten:
- classify_image schreibt nodataVal dort in den output wo image.nodata drin steht -> darf nicht None sein!
- predict überspringt sp#ter die postionen, wo nodataval in classif_map steht
-
"""
image = image if isinstance(image, GeoArray) else GeoArray(image, nodata=nodataVal)
......@@ -1603,8 +1596,7 @@ class RSImage_ClusterPredictor(object):
print('Total classification time: %s' % time.strftime("%H:%M:%S", time.gmtime(time.time() - t0)))
else:
self.classif_map = np.full((image.rows, image.cols), classifier.cluster_pixVals[0], np.int8)
# GeoArray(self.classif_map).save('/home/gfz-fe/scheffler/temp/classif_map__%s_%s.bsq'
# % (classifier.src_satellite, classifier.src_sensor))
# adjust classifier
if CPUs is None or CPUs > 1:
# FIXME does not work -> parallelize with https://github.com/ajtulloch/sklearn-compiledtrees?
......@@ -1628,8 +1620,7 @@ class RSImage_ClusterPredictor(object):
image_predicted[rS:rE + 1, cS:cE + 1] = im_tile_pred
print('Total prediction time: %s' % time.strftime("%H:%M:%S", time.gmtime(time.time()-t0)))
# image_predicted.save('/home/gfz-fe/scheffler/temp/image_predicted_before_nodata__%s_%s.bsq'
# % (classifier.src_satellite, classifier.src_sensor))
# re-apply nodata values to predicted result
if image.nodata is not None:
image_predicted[image.mask_nodata[:] == 0] = image.nodata
......@@ -1637,9 +1628,8 @@ class RSImage_ClusterPredictor(object):
% (classifier.src_satellite, classifier.src_sensor))
# copy mask_nodata
image_predicted.mask_nodata = image.mask_nodata
# image_predicted.save('/home/gfz-fe/scheffler/temp/image_predicted_after_nodata__%s_%s.bsq'
# % (classifier.src_satellite, classifier.src_sensor))
# GeoArray(image_predicted).save(
# image_predicted.save(
# '/home/gfz-fe/scheffler/temp/SPECHOM_py/image_predicted_QRclust1_MinDist_noB9.bsq')
# GeoArray(self.classif_map).save(
# '/home/gfz-fe/scheffler/temp/SPECHOM_py/classif_map_QRclust1_MinDist_noB9.bsq')
......
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