Skip to content

Commit

Permalink
adding regrid option
Browse files Browse the repository at this point in the history
  • Loading branch information
gtramonte committed Jan 27, 2025
1 parent 6523f30 commit 628a233
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions datastore/datastore/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ def _process_query(kube, query: GeoQuery, compute: None | bool = False):
if query.resample:
Datastore._LOG.debug("Applying resample...")
kube = kube.resample(**query.resample)
if query.regrid:
if query.regrid == 'regular':
kube = kube.to_regular()
return kube.compute() if compute else kube

@staticmethod
Expand Down
1 change: 1 addition & 0 deletions datastore/geoquery/geoquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class GeoQuery(BaseModel, extra="allow"):
filters: Optional[Dict]
format: Optional[str]
format_args: Optional[Dict]
regrid: Optional[str]

# TODO: Check if we are going to allow the vertical coordinates inside both
# `area`/`location` nad `vertical`
Expand Down

0 comments on commit 628a233

Please sign in to comment.