Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 539
Gabriel Neves Avatar asked Jul 02 '20 17:07

Gabriel Neves


1 Answers

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
like image 87
Nils Gudat Avatar answered Nov 17 '22 12:11

Nils Gudat