Skip to content

Commit 628a233

Browse files
committed
adding regrid option
1 parent 6523f30 commit 628a233

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

datastore/datastore/datastore.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,9 @@ def _process_query(kube, query: GeoQuery, compute: None | bool = False):
461461
if query.resample:
462462
Datastore._LOG.debug("Applying resample...")
463463
kube = kube.resample(**query.resample)
464+
if query.regrid:
465+
if query.regrid == 'regular':
466+
kube = kube.to_regular()
464467
return kube.compute() if compute else kube
465468

466469
@staticmethod

datastore/geoquery/geoquery.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class GeoQuery(BaseModel, extra="allow"):
1717
filters: Optional[Dict]
1818
format: Optional[str]
1919
format_args: Optional[Dict]
20+
regrid: Optional[str]
2021

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

0 commit comments

Comments
 (0)