diff --git a/scenes/core.py b/scenes/core.py index dba1971b1f3586d2165fee2e68c6daa1a98f50b2..e1474242997e9d297347748db4115d595587aa58 100644 --- a/scenes/core.py +++ b/scenes/core.py @@ -51,7 +51,7 @@ class Source(pyotb.Output): :return: drilled source """ if utils.open_vector_layer(msk_vec_file): - # Cloud mask is not empty + # Vector data not empty rasterization = pyotb.Rasterization({"in": msk_vec_file, "im": self, "mode": "binary", @@ -64,7 +64,7 @@ class Source(pyotb.Output): """ Return the source masked from an uint8 binary raster (0 or 1..255). Pixels are set to "nodata" where the mask values are 0. - :param binary_mask: input vector data filename + :param binary_mask: input mono-band binary raster filename :param nodata: nodata value for rejected values :return: masked source """ @@ -74,7 +74,7 @@ class Source(pyotb.Output): "mode.apply.ndval": nodata}) return self.new_source(binary_mask, manage_nodata) - def resample_over(self, ref_img, interpolator="nn", nodata=0): + def resample_over(self, ref_img, interpolator="bco", nodata=0): """ Return the source superimposed over the input image :param ref_img: reference image @@ -82,10 +82,11 @@ class Source(pyotb.Output): :param nodata: no data value :return: resampled image source """ - return self.new_source(pyotb.Superimpose({"inm": self, - "inr": ref_img, - "interpolator": interpolator, - "fv": nodata})) + superimpose = pyotb.Superimpose({"inm": self, + "inr": ref_img, + "interpolator": interpolator, + "fv": nodata}) + return self.new_source(ref_img, superimpose) def clip_over_img(self, ref_img): """ @@ -93,9 +94,10 @@ class Source(pyotb.Output): :param ref_img: reference image :return: ROI clipped source """ - return self.new_source(pyotb.ExtractROI({"in": self, - "mode": "fit", - "mode.fit.im": ref_img})) + extract_roi = pyotb.ExtractROI({"in": self, + "mode": "fit", + "mode.fit.im": ref_img}) + return self.new_source(ref_img, extract_roi) def clip_over_vec(self, ref_vec): """ @@ -107,7 +109,7 @@ class Source(pyotb.Output): "mode": "fit", "mode.fit.vec": ref_vec})) - def reproject(self, epsg, interpolator="nn"): + def reproject(self, epsg, interpolator="bco"): """ Reproject the source into the specified EPSG :param epsg: EPSG (int)