简体   繁体   中英

3D Gridded Data Interpolation in Julia

I'm strugling to convert some MATLAB code into Julia. I have some 3D gridded data (temperature that varies bi-dimensionally and over time) and want to change from a (x,y,t) mesh to a more loose (xi,yi,ti) mesh. In MATLAB it would be a simple interp(x,y,t,T,xi,yi,ti) .

I tried using Interpolations , Dierckx , but both seemed to work only over 2D gridded data. Am I getting something wrong? I'm quite new in Julia programing...

I'm already considering the possibility of solving the problem via PyCall with some NumPy/SciPy funtion.

Thanks!

What led you to believe that Interpolations.jl works only for two-dimensional data?

julia> a = rand(1:100, 10, 10, 10);

julia> using Interpolations

julia> itp = interpolate(a, BSpline(Linear()));

julia> v = itp(1.4, 2.3, 3.7)
55.24

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