Skip to content

Instantly share code, notes, and snippets.

@Majramos
Last active December 14, 2023 17:47
Show Gist options
  • Save Majramos/5e8985adc467b80cccb0cc22d140634e to your computer and use it in GitHub Desktop.
Save Majramos/5e8985adc467b80cccb0cc22d140634e to your computer and use it in GitHub Desktop.
Simple inverse distance weighted (IDW) interpolation with python
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tawhidhossain13
Copy link

@Majramos how can measure the accuracy of the different power values that I am using (like 1 or 2 or 5), also, is it possible to run the power values in a loop, like one out put for power 1, one for 2 and so on... and then try to understand which power parameters provide best interpolation.

@Enrra44
Copy link

Enrra44 commented Nov 10, 2023

Thank you for the code ! I am not really sure of this but I think that if you want to change the norm you can't use the hypothenus anymore.
distance = (np.abs(d0)**p + np.abs(d1)**p)**(1/p)
would be for the Lp-norm in general

@cody-elhard
Copy link

Now to try and figure out how to avoid memory issues on 1000x1000 image :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment