Thanks! Very helpful.
Looks like however evaluating the extrapolation object below on a Array (
itp = extrapolate(interpolate(...), NaN)[-3.5,-3.4] for example ) throws an
error, while this works well with interpolation objects.
A solution would be to use a comprehension
[extrapolate(interpolate(...), NaN)[x] for x in Array]
but for some reason this becomes a type Any array, so it requires
Array{Float64}([extrapolate(interpolate(...), NaN)[x] for x in Array])
Have I missed something, or this is just the way extrapolate works?
Apologies if this has already been posted somewhere, am quite new to Julia
and sometimes I find that documentation seems not too easy to access.
Thanks again!
On Wednesday, January 27, 2016 at 6:15:08 AM UTC, Tomas Lycken wrote:
>
> Yes, that's the correct way to specify the extrapolation behavior, but you
> don't seem to use it afterwards; your last two lines refer to Uinterp and
> Vinterp, rather than Uextrap and Vextrap. To get the desired behavior for
> OOB indices, you must index into the result of extrapolate(...).
>
> 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
>
>