ggebbie / TMI.jl

Total Matrix Intercomparison for Julia
MIT License
8 stars 3 forks source link

3D linear interpolation uses workaround for land points #49

Open ggebbie opened 2 years ago

ggebbie commented 2 years ago

e.g., https://github.com/ggebbie/TMI.jl/blob/e3aa8bba05e2da79213e6e66602b93d1b4f745de/src/TMI.jl#L967

Interpolations.jl has support for cases where land points exist, but I didn't manage to use it. Instead I add code that drops NaN points (by setting to zero) and then dividing by the sum of ocean weights so that the interpolation remains a true weighted average.

Ideally we can use built-in Interpolations.jl features instead.

This workaround comes into play for the function sample_observations.

The workaround is correct is in the sense that it does linear extrapolation over a maximum length of one grid cell.

ggebbie commented 1 year ago

Interpolations.jl updated to v0.14.6 in TMI.jl v0.1.20. Doesn't affect this issue directly.