I have a very interesting Data set to interpolate and I need a bit of help.
I have 5D knots and a Value that I need interpolated. The Columns are (just for you to know)
Temperature Pressure Mineral_%1 Mineral%2 Mineral%_3 Wave_Speed
Now, the interesting thing is that the sum of Mineral_%_N is always 100 %, so you can imagine that the knots of my interpolation are kind of weird. If i initialise some matrix to fill an the interpolate it would look like this:
t=sort(unique(Temperature)); pr=sort(unique(Pressure)); q=sort(unique(Qz)); a=sort(unique(A)); pl=sort(unique(P)); Felsic_Vp_M=zeros(size(t,1),size(pr,1),size(q,1),size(a,1),size(pl,1)); Felsic_Vs_M=zeros(size(t,1),size(pr,1),size(q,1),size(a,1),size(pl,1)); Felsic_Rho_M=zeros(size(t,1),size(pr,1),size(q,1),size(a,1),size(pl,1));
Now, using Interpolations.jl this gives me the problem that there are too many zeros in my data and creates minima where I do not have data when I do:
Felsic_Vp = interpolate((t,pr,q,a,pl), Felsic_Vp_M, Gridded(Linear())); Felsic_Vs = interpolate((t,pr,q,a,pl), Felsic_Vs_M, Gridded(Linear())); Felsic_Rho = interpolate((t,pr,q,a,pl), Felsic_Rho_M, Gridded(Linear()));
I have also tried ScatteredInterpolations.jl with:
samples_Vp=DATA_MAFIC[:,6]; samples_Vs=DATA_MAFIC[:,7]; samples_Rho=DATA_MAFIC[:,8]; points=DATA_MAFIC[:,1:5]'; Mafic_Vp = interpolate(Polyharmonic(), points, samples_Vp); Mafic_Vp = interpolate(MultiQuadratic(), points, samples_Vp);
This is better, but the interpolations creates local minima between nodes that is greatly affecting my computations later on.
So. My question. My data needs to be Linearly interpolated (I know this from a lot of testing). Any idea if I can make any of the methods in ScatteredInterpolation.jl behave like linear interpolations? Or, Maybe there is a way to use Interpolations.jl with this data set in a way I do not know