From f91ec3898e1b8e31d2549d60e4672f25b075467b Mon Sep 17 00:00:00 2001 From: davemlz Date: Sun, 21 Jan 2024 17:00:41 +0100 Subject: [PATCH] FEAT: Added stackstack_kw --- cubo/cubo.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cubo/cubo.py b/cubo/cubo.py index f75e4c4..fd96319 100644 --- a/cubo/cubo.py +++ b/cubo/cubo.py @@ -22,6 +22,7 @@ def create( resolution: Union[float, int] = 10.0, stac: str = "https://planetarycomputer.microsoft.com/api/stac/v1", gee: bool = False, + stackstac_kw: Optional[dict] = None, **kwargs, ) -> xr.DataArray: """Creates a data cube from a STAC Catalogue as a :code:`xr.DataArray` object. @@ -58,6 +59,11 @@ def create( .. versionadded:: 2024.1.0 + stackstac_kw : dict, default = None + Keyword arguments for :code:`stackstac` as a dictionary. + + .. versionadded:: 2024.1.0 + kwargs : Additional keyword arguments passed to :code:`pystac_client.Client.search()`. @@ -189,6 +195,10 @@ def create( if not isinstance(bands, list) and bands is not None: bands = [bands] + # Add stackstac arguments + if stackstac_kw is None: + stackstac_kw = dict() + # Create the cube cube = stackstac.stack( items, @@ -196,6 +206,7 @@ def create( resolution=resolution, bounds=bbox_utm, epsg=epsg, + **stackstac_kw, ) # Delete attributes