Replies: 1 comment 1 reply
-
Hey there, the memory issue is of course always a problem with kriging on large data sets. Some thoughts to optimize:
OK.Z = np.atleast_1d(np.squeeze(np.array(z, copy=True, dtype=np.float64))) where Hope this helps. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hiya
I am attempting to use OrdinaryKriging3D with a large set of temperature measurements. These are scattered measurements taken at (longitude,latitude,time) positions, resulting in four very long 1D vector strings. I would then like to interpolate this onto a regular 3D grid of (lon_reg,lat_reg,time_reg) using 3D kriging. This appears to require huge amounts of memory, requiring an array of size len(lon_reg)*len(lat_reg)*len(time_reg)*len(temperature).
A number of other posts have reported on memory issues. To try and get around the large memory requirements, I have been attempting to treat the data arrays using lazy operations and calling the pyKrige commands from within xarray's apply_ufunc functionality. However, I am still running into memory issues.
I have pasted some example code below using randomised data. Can anyone comment on whether I am making a mistake, either in the data creation or in the apply_ufunc call, or whether the problem is more fundamental to the kriging operation itself -- for example, are kriging methods simply incompatible with the concept of dask chunks and lazy operations? The code works on small datasets (e.g. if sample_length is set to 300), but I continue to run out of memory for longer sample lengths (e.g. of about 2000).
Note that I have also tried running the code below on a dask cluster connected to multiple CPUs, but it didn't solve the memory problems.
Thank you for any advice.
Beta Was this translation helpful? Give feedback.
All reactions