Skip to content

Commit

Permalink
switch interpolation ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
henry2004y committed Jun 17, 2024
1 parent 5fd9040 commit 9364993
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/plot/utility.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function getdata2d(bd::BATLData, var::AbstractString,
if isnothing(varIndex_)
@info "rbody not found in file header parameters; use keyword rbody"
@inbounds @simd for i in CartesianIndices(Wi)
if xi[i[1]]^2 + yi[i[2]]^2 < rbody^2
if xi[i[2]]^2 + yi[i[1]]^2 < rbody^2
Wi[i] = NaN
end
end
Expand Down
15 changes: 8 additions & 7 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,14 @@ end
bd = load(joinpath(datapath, file))
plotdata(bd, "p bx;by", plotmode="contbar streamover")
@test isa(gca(), PyPlot.PyObject)
PyPlot.contourf(bd, "p")
@test isa(gca(), PyPlot.PyObject)
@test_throws ErrorException PyPlot.contourf(bd, "rho", innermask=true)
PyPlot.contour(bd, "rho")
@test isa(gca(), PyPlot.PyObject)
PyPlot.contour(bd, "rho"; levels=[1.0])
@test isa(gca(), PyPlot.PyObject)
c = PyPlot.contourf(bd, "p")
@test c.get_array()[end] == 1.0500000000000003
c = PyPlot.contourf(bd, "rho", innermask=true)
@test c.get_array()[end] == 1.0500000000000003
c = PyPlot.contour(bd, "rho")
@test c.get_array()[end] == 1.0500000000000003
c= PyPlot.contour(bd, "rho"; levels=[1.0])
@test c.get_array()[end] == 1.0
c = PyPlot.tricontourf(bd, "rho")
@static if matplotlib.__version__ < "3.8"
@test c.get_array()[end] == 1.0500000000000003
Expand Down

0 comments on commit 9364993

Please sign in to comment.