Skip to content

Commit cd004a4

Browse files
authored
Merge pull request #93 from kthyng/updates_select_interp
Updates select interp
2 parents 45faaf4 + aa5a819 commit cd004a4

File tree

10 files changed

+1011
-383
lines changed

10 files changed

+1011
-383
lines changed

docs/whats_new.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
:mod:`What's New`
22
-----------------
33

4+
v1.2.0 (September 13, 2023)
5+
===========================
6+
* Improvements to interpolation
7+
8+
49
v1.1.4 (January 27, 2023)
510
=========================
611
* fixed docs to run fully

extract_model/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
import extract_model.accessor # noqa: F401
1010

1111
from .extract_model import sel2d, sel2dcf, select, selZ # noqa: F401
12-
from .utils import filter, order, preprocess, sub_bbox, sub_grid # noqa: F401
12+
from .preprocessing import preprocess
13+
from .utils import filter, guess_model_type, order, sub_bbox, sub_grid # noqa: F401
1314

1415

1516
try:

extract_model/accessor.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,28 +262,34 @@ def interp2d(
262262
latitude=lats,
263263
locstream=locstream,
264264
weights=weights,
265+
horizontal_interp=True,
266+
horizontal_interp_code="xesmf",
265267
iT=iT,
266268
T=T,
267269
iZ=iZ,
268270
Z=Z,
269271
extrap=extrap,
270272
extrap_val=extrap_val,
273+
return_info=True,
271274
)
272275
else:
273-
da, weights = em.select(
276+
da, kwargs_out = em.select(
274277
self.da.to_dataset(),
275278
longitude=lons,
276279
latitude=lats,
277280
locstream=locstream,
278281
weights=weights,
282+
horizontal_interp=True,
283+
horizontal_interp_code="xesmf",
279284
iT=iT,
280285
T=T,
281286
iZ=iZ,
282287
Z=Z,
283288
extrap=extrap,
284289
extrap_val=extrap_val,
290+
return_info=True,
285291
)
286-
self.weights_map[hashenc] = weights
292+
self.weights_map[hashenc] = kwargs_out["weights"]
287293

288294
return da[varname]
289295

0 commit comments

Comments
 (0)