scientimate.interpgrid2xyz#

z = scientimate.interpgrid2xyz(xgrid, ygrid, zgrid, x, y, dispout='no')

Description#

Interpolate 2d gridded data on given scatter point(s) using nearest neighbor method

Inputs#

xgrid

x data as a [M*N] array

ygrid

y data as a [M*N] array

zgrid

z data as z(x,y) as a [M*N] array

x

x of point that nearest point to that is desired to be found

y

y of point that nearest point to that is desired to be found

dispout=’no’

Define to display outputs or not (‘yes’: display, ‘no’: not display)

Outputs#

z

Value of interpolated data at (x,y) as z(x,y)

Examples#

import scientimate as sm
import numpy as np

xgrid,ygrid=np.meshgrid(np.linspace(0,10,100),np.linspace(0,10,100))
zgrid=ygrid*np.sin(xgrid)-xgrid*np.cos(ygrid)
x=10*np.random.rand(100,1)
y=10*np.random.rand(100,1)
z=sm.interpgrid2xyz(xgrid,ygrid,zgrid,x,y,'yes')

References#