Skip to content
Snippets Groups Projects
Commit c2508daa authored by Paolo Veglio's avatar Paolo Veglio
Browse files

fixes to scenes and imports

parent afb0a50f
No related branches found
No related tags found
No related merge requests found
Pipeline #58644 failed
......@@ -133,7 +133,7 @@ class IdentifyPixels:
coast_scene,
)
coast_scene = xr.where(uniformity < 0, 1, coast_scene)
coast_scene = xr.where(uniformity <= 0, 1, coast_scene)
logger.info(f"scene: Memory usage: {proc.memory_info().rss / 1e6} MB")
return coast_scene.astype(np.ubyte)
......@@ -178,7 +178,7 @@ class IdentifyPixels:
water_scene,
)
water_scene = xr.where(uniformity < 0, 0, water_scene).astype(np.ubyte)
water_scene = xr.where(uniformity <= 0, 0, water_scene).astype(np.ubyte)
logger.info(f"scene: Memory usage: {proc.memory_info().rss / 1e6} MB")
return water_scene
......@@ -358,7 +358,7 @@ class IdentifyPixels:
land_scene,
)
land_scene = xr.where(uniformity < 0, 1, land_scene).astype(np.ubyte)
land_scene = xr.where(uniformity <= 0, 1, land_scene).astype(np.ubyte)
logger.info(f"scene: Memory usage: {proc.memory_info().rss / 1e6} MB")
return land_scene
......
......@@ -6,6 +6,8 @@ import numpy as np
import xarray as xr
from numpy.lib.stride_tricks import sliding_window_view
from mvcm.constants import ConstantsNamespace
logger = logging.getLogger(__name__)
......@@ -26,6 +28,7 @@ def cloud_mask_spi(data: xr.Dataset):
m07.coarsen(number_of_lines=2, number_of_pixels=2).std()
/ m07.coarsen(number_of_lines=2, number_of_pixels=2).mean()
)
spi = xr.where(np.isnan(spi), ConstantsNamespace.BAD_DATA, spi)
return spi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment