You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nt=8772//4ny=489nx=655# chunks like the data is stored on disk# small in time, big in space# because the chunk sizes are -1 along lat, lon;# reshaping this array to (time, latlon) prior to fitting is pretty cheapchunks= (8, -1, -1)
da=xr.DataArray(
dask.array.random.random((nt, ny, nx), chunks=chunks),
dims=("ocean_time", "eta_rho", "xi_rho"),
)
dim="ocean_time"deg=1p=da.polyfit(dim="ocean_time", deg=1, skipna=False)
# create a chunked version of the "ocean_time" dimensionchunked_dim=xr.DataArray(
dask.array.from_array(da[dim].data, chunks=da.chunksizes[dim]), dims=dim, name=dim
)
xr.polyval(chunked_dim, p.polyfit_coefficients)
Describe the solution you'd like
Here's a partial solution. It does not handle datetime inputs (polyval handles this using get_clean_interp_index which computes dask inputs). But I've replaced the call to np.vander and used xr.dot.
Is your feature request related to a problem?
polyval does not handle dask inputs well.
Describe the solution you'd like
Here's a partial solution. It does not handle datetime inputs (polyval handles this using
get_clean_interp_index
which computes dask inputs). But I've replaced the call tonp.vander
and usedxr.dot
.This looks like what I expected
cc @aulemahal
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: