Skip to content

Commit

Permalink
Refactor varioplane.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed Oct 29, 2024
1 parent af692f1 commit 1977ea4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/empirical/varioplane.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,22 @@ function EmpiricalVarioplane(
planes = [data]
u, v = Vec(1.0, 0.0), Vec(0.0, 1.0)
elseif Dim == 3
planes = partition(rng, data, PlanePartition(normal, tol=ptol))
subset = partition(rng, data, PlanePartition(normal, tol=ptol))
planes = collect(subset)
u, v = householderbasis(normal)
else
@error "varioplane only supported in 2D or 3D"
end

# loop over half of the plane
θs = range(0, stop=π, length=nangs)
θs = collect(range(0, stop=π, length=nangs))
γs = map(θs) do θ
dir = DirectionPartition(cos(θ) * u + sin(θ) * v, tol=dtol)

γ(plane) = EmpiricalVariogram(partition(rng, plane, dir), var₁, var₂; kwargs...)
tmapreduce(γ, merge, collect(planes))
tmapreduce(γ, merge, planes)
end

EmpiricalVarioplane(collect(θs), γs)
EmpiricalVarioplane(θs, γs)
end

# -----------
Expand Down

0 comments on commit 1977ea4

Please sign in to comment.