Skip to content

MemoryError: Unable to allocate 3.60 GiB for an array with shape (280000, 1728) and data type float64 #191

Answered by MuellerSeb
douyoujun asked this question in Q&A
Discussion options

You must be logged in to vote

You could try to use smaller chunks for olon for example:

olon = np.linspace(70,140,700)
olon1 = olon[0:100]
olon2 = olon[100:200]
olon3 = olon[200:300]
...
z1, ss1 = OK.execute("grid", olon1, olat)
z2, ss2 = OK.execute("grid", olon2, olat)
z3, ss3 = OK.execute("grid", olon3, olat)
...

And then you can merge the fields z1,z2,... back together.

You could also use the GSTools kriging routines, which provide a separate argument for chunking because of your exact problem:
https://geostat-framework.readthedocs.io/projects/gstools/en/stable/generated/gstools.krige.Ordinary.html#gstools.krige.Ordinary.__call__

Does this help?
Cheers, Sebastian

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MuellerSeb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants