Evaluate the output from scipy 2D interpolation along a curve

前端 未结 3 1399
遥遥无期
遥遥无期 2021-01-14 02:40

I have data z sampled from a 2D function f at grid points x, y, as in z = f(x, y).

It is easy to interpolate

3条回答
  •  一向
    一向 (楼主)
    2021-01-14 03:00

    It seems that interp2d() behaves they way it does because that is how the corresponding Fortran function was conceived. The only workaround to this (that I can think of) is to call f on pairs of coordinates:

    [f(*p)[0] for p in zip(x, y)]
    

提交回复
热议问题