Skip to content

Commit

Permalink
Merge pull request #93 from kthyng/updates_select_interp
Browse files Browse the repository at this point in the history
Updates select interp
  • Loading branch information
kthyng authored Sep 13, 2023
2 parents 45faaf4 + aa5a819 commit cd004a4
Show file tree
Hide file tree
Showing 10 changed files with 1,011 additions and 383 deletions.
5 changes: 5 additions & 0 deletions docs/whats_new.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
:mod:`What's New`
-----------------

v1.2.0 (September 13, 2023)
===========================
* Improvements to interpolation


v1.1.4 (January 27, 2023)
=========================
* fixed docs to run fully
Expand Down
3 changes: 2 additions & 1 deletion extract_model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import extract_model.accessor # noqa: F401

from .extract_model import sel2d, sel2dcf, select, selZ # noqa: F401
from .utils import filter, order, preprocess, sub_bbox, sub_grid # noqa: F401
from .preprocessing import preprocess
from .utils import filter, guess_model_type, order, sub_bbox, sub_grid # noqa: F401


try:
Expand Down
10 changes: 8 additions & 2 deletions extract_model/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,28 +262,34 @@ def interp2d(
latitude=lats,
locstream=locstream,
weights=weights,
horizontal_interp=True,
horizontal_interp_code="xesmf",
iT=iT,
T=T,
iZ=iZ,
Z=Z,
extrap=extrap,
extrap_val=extrap_val,
return_info=True,
)
else:
da, weights = em.select(
da, kwargs_out = em.select(
self.da.to_dataset(),
longitude=lons,
latitude=lats,
locstream=locstream,
weights=weights,
horizontal_interp=True,
horizontal_interp_code="xesmf",
iT=iT,
T=T,
iZ=iZ,
Z=Z,
extrap=extrap,
extrap_val=extrap_val,
return_info=True,
)
self.weights_map[hashenc] = weights
self.weights_map[hashenc] = kwargs_out["weights"]

return da[varname]

Expand Down
Loading

0 comments on commit cd004a4

Please sign in to comment.