Commit c8d34ab1 authored by Daniel Scheffler's avatar Daniel Scheffler Committed by Mathias Peters
Browse files

Fixed unexpected value in cloud mask of Sentinel-2

algorithms.L1C_P.AtmCorr:
- _join_results_to_inObjs(): fixed unexpected value in cloud mask of Sentinel-2
- updated __version__
Former-commit-id: 89a43619
Former-commit-id: 93bc4d81
parent 096d38a1
......@@ -15,7 +15,7 @@ from . import config
from .processing.process_controller import process_controller
__version__ = '20170125.03'
__version__ = '20170126.01'
__author__ = 'Daniel Scheffler'
__all__ = ['algorithms',
'io',
......
......@@ -678,6 +678,7 @@ class L1A_object(GMS_object):
def calc_cloud_mask(self,subset=None):
# FIXME Landsat cloud mask pixel values are currently not compatible to definition_dicts.get_mask_classdefinition
# append /<GeoMultiSensRepo>/algorithms to PATH in order to properly import py_tools_ah when unpickling cloud classifiers
sys.path.append(os.path.join(os.path.dirname(__file__))) # FIXME handle py_tools_ah as normal external dependency
......
......@@ -774,9 +774,23 @@ class AtmCorr(object):
# append mask_clouds only to the input GMS object with the same dimensions
if inObj.arr.shape[:2] == mask_clouds_ac.shape:
inObj.mask_clouds = mask_clouds_ac
inObj.mask_clouds.legend = self.results.mask_clouds.mask_legend # dict(value=string, string=value)) # # FIXME this is not used later
inObj.mask_clouds.nodata = self.ac_input['options']['cld_mask']['nodata_value_mask']
# TODO handle nodata value
inObj.mask_clouds.legend = self.results.mask_clouds.mask_legend # dict(value=string, string=value)) # # FIXME this is not used later
# set cloud mask nodata value
tgt_nodata = get_outFillZeroSaturated(mask_clouds_ac.dtype)[0]
ac_out_nodata = self.ac_input['options']['cld_mask']['nodata_value_mask']
if tgt_nodata not in self.results.mask_clouds.mask_legend.keys():
inObj.mask_clouds[inObj.mask_clouds[:]==ac_out_nodata] = tgt_nodata
mask_clouds_nodata = tgt_nodata
else:
warnings.warn('The cloud mask from AC output already uses the desired nodata value %s for the '
'class %s. Using AC output nodata value %s.'
%(tgt_nodata, self.results.mask_clouds.mask_legend[tgt_nodata], ac_out_nodata))
mask_clouds_nodata = ac_out_nodata
inObj.mask_clouds.nodata = mask_clouds_nodata
# set cloud mask confidence array
inObj.mask_clouds_confidence = GeoArray(cfd_arr, inObj.arr.gt, inObj.arr.prj,
nodata=get_outFillZeroSaturated(cfd_arr.dtype)[0])
joined=True
......
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