Dear community,
I would like to interpolate my 3D Vector Field with DIVAnd.jl (GitHub - gher-uliege/DIVAnd.jl: DIVAnd performs an n-dimensional variational analysis of arbitrarily located observations) without any success. I have the following data: MPCDF DataShare
When I plot the data with PlotlyJS I get the following picture:
(Dots color and size the length of the vectors)
(Vectors size and color length of vectors)
I am now trying to use the example found here which is 2D: https://gher-ulg.github.io/DIVAnd.jl/latest/index.html#Examples
I get stuck when I am trying to use DIVAndrun. Here is my code:
using CSV
using DataFrames
using DIVAnd, PyPlot
data = DataFrame(CSV.File("211107_2025 LOGGER04.mod.csv",header=["X","Y","Z","U","V","W","Mod"]))
x = range(minimum(data[:,1]),stop=maximum(data[:,1]),length=393)
y = range(minimum(data[:,2]),stop=maximum(data[:,2]),length=398)
z = range(minimum(data[:,3]),stop=maximum(data[:,3]),length=300)
mask,(pm,pn,po),(xi,yi,zi) = DIVAnd_rectdom(x,y,z)
# normalized obs. error variance and correlation length
epsilon2 = 1 / 200
len = 0.2
# call DIVAnd
fi, s = DIVAndrun(mask,
(pm,pn,po),
(xi,yi,zi),
(data[:,1],data[:,2],data[:,3]),
data[:,7],
len,epsilon2;
velocity = (data[:,4]data[:,5],data[:,6])
)
The error is:
MethodError: no method matching *(::Vector{Float64}, ::Vector{Float64})
Closest candidates are:
*(::Any, ::Any, ::Any, ::Any…) at operators.jl:560
*(::StridedMatrix{T}, ::StridedVector{S}) where {T<:Union{Float32, Float64, ComplexF32, ComplexF64}, S<:Real} at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/matmul.jl:44
*(::StridedVecOrMat{T} where T, ::LinearAlgebra.Adjoint{var"#s814", var"#s813"} where {var"#s814", var"#s813"<:LinearAlgebra.LQPackedQ}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/lq.jl:254
…
Stacktrace:
[1] top-level scope
@ In[13]:2
[2] eval
@ ./boot.jl:360 [inlined]
[3] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base ./loading.jl:1116
I know that the Problem lies with the structure of the location of my observation
(data[:,1],data[:,2],data[:,3])
and the velocities
velocity = (data[:,4]data[:,5],data[:,6])
I do not know how to transform them into tuples with n elements which says the documentation. Has anybody a clue?
If there is a smarter way to do this, please let me know.
Thanks