Skip to content

Commit

Permalink
some fixes, but check the gdal version (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessjaco committed Mar 29, 2023
1 parent ee79b9d commit 21148f0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions dep_tools/Processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion dep_tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 21148f0

Please sign in to comment.