Skip to content

Commit

Permalink
FEAT: Added stackstack_kw
Browse files Browse the repository at this point in the history
  • Loading branch information
davemlz committed Jan 21, 2024
1 parent f0bb7a3 commit f91ec38
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cubo/cubo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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()`.
Expand Down Expand Up @@ -189,13 +195,18 @@ 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,
assets=bands,
resolution=resolution,
bounds=bbox_utm,
epsg=epsg,
**stackstac_kw,
)

# Delete attributes
Expand Down

0 comments on commit f91ec38

Please sign in to comment.