henry2004y / Batsrus.jl

BATSRUS/SWMF Data Processor
https://henry2004y.github.io/Batsrus.jl/dev/
MIT License
5 stars 2 forks source link

`OutOfMemoryError()` when replacing `matplotlib.tri.LinearTriInterpolator` #32

Open henry2004y opened 11 months ago

henry2004y commented 11 months ago

matplotlib.tri.LinearTriInterpolator is pretty slow. However, when I tried to replace that with either ScatteredInterpolations.jl or Dierckx.jl Spline2D, I got OOM errors...

spl = Spline2D(vec(X), vec(Y), vec(W))
#Wi = [evaluate(spl, i, j) for j in yi, i in xi]
ERROR: OutOfMemoryError()
Stacktrace:
 [1] Array
   @ .\boot.jl:475 [inlined]
 [2] Spline2D(x::Base.ReshapedArray{…}, y::Base.ReshapedArray{…}, z::Base.ReshapedArray{…}; w::Vector{…}, kx::Int64, ky::Int64, s::Float64)
   @ Dierckx C:\Users\hyzho\.julia\packages\Dierckx\TDOyl\src\Dierckx.jl:775
 [3] Spline2D(x::Base.ReshapedArray{…}, y::Base.ReshapedArray{…}, z::Base.ReshapedArray{…})
   @ Dierckx C:\Users\hyzho\.julia\packages\Dierckx\TDOyl\src\Dierckx.jl:733
 [4] top-level scope
   @ REPL[31]:1

Related to #14

henry2004y commented 10 months ago

One thing to try might be tripcolor from Matplotlib.