for xx=1:xlong
for yy = 1:ylong
U_alturas(xx,yy,:) = interp1(squeeze(NivelAltura_int(xx,yy,:)),squeeze(U(xx,yy,:)), interpolar_a);
V_alturas(xx,yy,:) = interp1(squeeze(NivelAltura_int(xx,yy,:)),squeeze(V(xx,yy,:)), interpolar_a);
end
end.
Uinterp = interpolate((squeeze(NivelAltura_int[xx,yy,1:end],(1,2)),),squeeze(U[xx,yy,1:end],(1,2)),Gridded(Linear()));
Vinterp = interpolate((squeeze(NivelAltura_int[xx,yy,1:end],(1,2)),),squeeze(V[xx,yy,1:end],(1,2)),Gridded(Linear()));
Uextrap = extrapolate(Uinterp,NaN);
Vextrap = extrapolate(Vinterp,NaN);
U_alturas[xx,yy,1:end] = Uinterp[Alturas[1:end]];
V_alturas[xx,yy,1:end] = Vinterp[Alturas[1:end]];
If you want to avoid this, you can of course do both interpolation and extrapolation in one step:
itp = extrapolate(interpolate(...), NaN)
itp[-3.5] # NaN
// T
Indexing into an extrapolation object like that should work - if you haven't already solved that problem, could you please file an issue with a complete (runnable) code sample?
Regarding the comprehension, did you do that in the repl or in a script? Does it still yield Any[] if you wrap it in a function? If so, it might indicate a type stability issue in extrapolate - please file an issue for that too then.
Thanks!
// T