Width/height mixup
@@ -138,7 +138,7 @@ class AddCloudMaskTask(EOTask):
hr_res_x, hr_res_y = int(meta_info['size_x'].strip('m')), int(meta_info['size_y'].strip('m'))
lr_res_x, lr_res_y = int(self.cm_size_x.strip('m')), int(self.cm_size_y.strip('m'))
- rescale = (hr_res_y / lr_res_y, hr_res_x / lr_res_x)
+ rescale = (hr_res_x / lr_res_x, hr_res_y / lr_res_y)
return rescale
@@ -156,7 +156,7 @@ class AddCloudMaskTask(EOTask):
if (self.cm_size_y is None) and (self.cm_size_x is None):
return hr_array, None
- # Rescaling factor in spatial (height, width) dimensions
+ # Rescaling factor in spatial (width, height) dimensions
rescale = self._get_rescale_factors(hr_array.shape[1:3], meta_info)
lr_array = resize_images(hr_array,
@@ -183,8 +183,8 @@ class AddCloudMaskTask(EOTask):
if rescale is None:
return lr_array.reshape(lr_shape)
- # Resize to reference shape
- output_size = reference_shape[1:]
+ # Resize to reference shape (width, height)
+ output_size = (reference_shape[2], reference_shape[1])
hr_array = resize_images(lr_array.reshape(lr_shape),
new_size=output_size,
interpolation=interp)
