Open briochemc opened 5 years ago
I just ran into this limitation. I would like to fill in holes (missing data) in a 2D sample by interpolating from data around the holes, but the suggestions in the docs for 1D give me the same problems as OP.
Same problem here.
FWIW, for our application (resampling time series at fixed timesteps with interpolation), propagating missing
values is the desired behaviour...
missing
values propagate in the interpolation and the 1D trick suggestion in the documentation of filteringmissing
values out does not generalize to multiple dimensions. Unless I missed something? This begs the question: Is it possible to interpolate data withmissing
values in n dimensions with n>1? Here is a minimal example to illustrate the kind of thing I am thinking about:With the
data
above, I'm not even sure how one should interpolate values near themissing
entries. Currently, as mentioned at the top of this post, themissing
values propagate:Is there a good way to interpolate data close to the
missing
entries? Maybe by applying the filtering trick in each direction as a default? (Of course, one could use theConstant()
interpolation instead of theLinear()
one, but the problem of interpolation near the originalmissing
values remains.)I would also be interested in having interpolation boundaries in the sense that the interpolation should not go across those boundaries. For that, I thought using
nothing
values made sense? Here is an example of what I am thinking about, adding anothing
in place of one of the missing entries:In this case, I feel like querying for values near the remaining
missing
should not use the[2,1]
entry (the1.42532
) because it is separated from the query by anothing
value.Maybe these features are dumb to request, I'm not sure 😅, but I think they could be useful for some applications, like geographic data interpolation. For example, consider a marine tracer for which a
missing
value at location(x,y)
could mean "no data was collected at(x,y)
" whilenothing
could represent "(x,y)
location is an island". In this case it would make sense to be able to interpolate the data in 2D across holes ofmissing
data, while blocking the interpolation through islands where, in terms of the marine tracer data,nothing
is observed.