Skip to content

Commit

Permalink
More fixes to transioplane
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed Oct 30, 2024
1 parent e688860 commit 88b5d85
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/empirical/transioplane.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function EmpiricalTransioplane(
data::AbstractGeoTable,
var;
normal=Vec(0, 0, 1),
nangs=100,
nangs=50,
ptol=0.5u"m",
dtol=0.5u"m",
kwargs...
Expand All @@ -51,8 +51,8 @@ function EmpiricalTransioplane(
throw(ArgumentError("transioplane only supported in 2D or 3D"))
end

# polar angles for half plane (variogram is symmetric)
θs = collect(range(0, stop=π, length=nangs))
# polar angles for full plane (transiogram is asymmetric)
θs = collect(range(0, stop=2π, length=2nangs))

# estimate directional transiograms across planes
ts = map(θs) do θ
Expand Down
20 changes: 20 additions & 0 deletions test/empirical/transioplane.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@testset "EmpiricalTransioplane" begin
img = readdlm(joinpath(datadir, "anisotropic.tsv"))
data = georef((c=[v < 0 ? 1 : 2 for v in img],))
t = EmpiricalTransioplane(data, :c, maxlag=50.0)
@test sprint(show, t) == "EmpiricalTransioplane"
@test sprint(show, MIME"text/plain"(), t) == """
EmpiricalTransioplane
100 angles
└─0.00°
└─3.64°
└─7.27°
└─10.91°
└─14.55°
└─345.45°
└─349.09°
└─352.73°
└─356.36°
└─360.00°"""
end
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ testfiles = [
# empirical
"empirical/matrices.jl",
"empirical/variogram.jl",
"empirical/varioplane.jl",
"empirical/transiogram.jl",
"empirical/transioplane.jl",

# theoretical
"theoretical/variogram.jl",
Expand Down

0 comments on commit 88b5d85

Please sign in to comment.