diff --git a/dep_tools/Processor.py b/dep_tools/Processor.py index 75bbc4e..e28101a 100644 --- a/dep_tools/Processor.py +++ b/dep_tools/Processor.py @@ -61,6 +61,7 @@ class Processor: storage_account: str = os.environ["AZURE_STORAGE_ACCOUNT"] container_name: str = "output" credential: str = os.environ["AZURE_STORAGE_SAS_TOKEN"] + convert_output_to_int16: bool = True output_value_multiplier: int = 10000 output_nodata: int = -32767 color_ramp_file: Union[str, None] = None @@ -116,9 +117,11 @@ def process_by_scene(self) -> None: item_xr = scale_and_offset(item_xr, scale=[scale], offset=offset) results = self.scene_processor(item_xr, **self.scene_processor_kwargs) - results = scale_to_int16( - results, self.output_value_multiplier, self.output_nodata - ) + if self.convert_output_to_int16: + # Must be DA! + results = scale_to_int16( + results, self.output_value_multiplier, self.output_nodata + ) try: write_to_blob_storage( diff --git a/dep_tools/utils.py b/dep_tools/utils.py index 24b827d..7413b54 100644 --- a/dep_tools/utils.py +++ b/dep_tools/utils.py @@ -14,7 +14,7 @@ import rioxarray from tqdm import tqdm import xarray as xr -from xarray import DataArray +from xarray import DataArray, Dataset def scale_and_offset( diff --git a/pyproject.toml b/pyproject.toml index a257fc9..ab5a607 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ geopandas = "^0.12.2" dask = {extras = ["complete"], version = "^2023.3.2"} dask-gateway = "^2023.1.1" geocube = "^0.4.0" -gdal = "^3.6.3" +gdal = "3.5.1" pystac-client = "^0.6.1" planetary-computer = "^0.4.9" pygeos = "^0.14"