简体   繁体   中英

python function to interpolate the value at a point in a 2D field

I have a 2D pressure field and I would like to interpolate the value at particular set of singular points or locations. I'm suspect downscaling is a solution but before I try and write the functions for python, I was wondering if there is a way/code already in existence. Perhaps scipy has a function but I'm unaware and cannot find any.

Any help is appreciated

Scipy has a 2-dimensional interpolation function:

    scipy.interpolate.interp2d

Information on how to use this function can be found on http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.interpolate.interp2d.html

    scipy.interpolate.interp2d(x, y, z)

in which x and y are 1-dimensional arrays of coordinates corresponding to the two dimensional array z which is your pressurefield.

x corresponds to the second axis of the z -matrix. y corresponds to the first axis of the z -matrix

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM