Cubic interpolation with derivatives in numpy

故事扮演 提交于 2019-12-10 13:59:50

问题


A recent immigrant to Python and scientific computing with Python. This is a question to avoid any duplication of code that might already exist.

I have a field that is sampled as a function of x and y in a regular grid. I would want to interpolate the data to obtain not only the value of the field at any point on the grid, but also the first and second derivatives. If I interpolate it with bicubic interpolation using interp2d, I can obtain the value of the field.

Does anyone have a suggestion on how to obtain the first and second derivatives of the field using an EXISTING numpy or scipy function?

Thanks!


回答1:


The scipy.interpolate.interp2d.__call__ method has options dx and dy to evaluate higher derivatives at point (at least since version 0.14.0).



来源:https://stackoverflow.com/questions/13772817/cubic-interpolation-with-derivatives-in-numpy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!