问题
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