From 8ae631e28e4643bea84bc9e1964ded9086257931 Mon Sep 17 00:00:00 2001 From: Kenn Cartier Date: Sun, 25 Aug 2024 21:09:55 -0700 Subject: [PATCH] Changed name of post-processing function. --- city_metrix/layers/layer.py | 6 +++--- city_metrix/layers/ndvi_sentinel2_gee.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/city_metrix/layers/layer.py b/city_metrix/layers/layer.py index f3e2174..1c40664 100644 --- a/city_metrix/layers/layer.py +++ b/city_metrix/layers/layer.py @@ -38,7 +38,7 @@ def get_data(self, bbox: Tuple[float]) -> Union[xr.DataArray, gpd.GeoDataFrame]: ... @abstractmethod - def post_processing_adjustment(self, data, **kwargs) -> Union[xr.DataArray, gpd.GeoDataFrame]: + def prepare_for_map_rendering(self, data, **kwargs) -> Union[xr.DataArray, gpd.GeoDataFrame]: """ Applies the standard post-processing adjustment used for rendering of the layer :param are specific to the layer @@ -83,7 +83,7 @@ def write(self, bbox, output_path, tile_degrees=None, **kwargs): file_names = [] for tile in tiles["geometry"]: data = self.aggregate.get_data(tile.bounds) - data = self.post_processing_adjustment(data, **kwargs) + data = self.prepare_for_map_rendering(data, **kwargs) file_name = f"{output_path}/{uuid4()}.tif" file_names.append(file_name) @@ -91,7 +91,7 @@ def write(self, bbox, output_path, tile_degrees=None, **kwargs): write_layer(file_name, data) else: data = self.aggregate.get_data(bbox) - data = self.post_processing_adjustment(data, **kwargs) + data = self.prepare_for_map_rendering(data, **kwargs) write_layer(output_path, data) diff --git a/city_metrix/layers/ndvi_sentinel2_gee.py b/city_metrix/layers/ndvi_sentinel2_gee.py index 3ab36c0..8458cb2 100644 --- a/city_metrix/layers/ndvi_sentinel2_gee.py +++ b/city_metrix/layers/ndvi_sentinel2_gee.py @@ -46,7 +46,7 @@ def calculate_ndvi(image): return xdata - def post_processing_adjustment(self, data, ndvi_threshold=0.4, convert_to_percentage=True, **kwargs): + def prepare_for_map_rendering(self, data, ndvi_threshold=0.4, convert_to_percentage=True, **kwargs): """ Applies the standard post-processing adjustment used for rendering of NDVI including masking to a threshold and conversion to percentage values.