Skip to content

Commit

Permalink
Allow one sample point on shell
Browse files Browse the repository at this point in the history
It should have correct radius.
  • Loading branch information
kbarros committed Aug 6, 2023
1 parent 787ac46 commit 1a559ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Intensities/PowderAveraging.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ function spherical_shell(radius; density=0.0, minpoints=0, maxpoints=typemax(Int
error("Must specify `density` or `minpoints`.")
end
n = round(Int, 4π*radius^2 * density)
n = min(max(n, minpoints), maxpoints)
return n <= 1 ? [Vec3(0,0,0)] : radius * spherical_points_fibonacci(n)
n = min(max(n, minpoints, 1), maxpoints)
return radius * spherical_points_fibonacci(n)
end

function powder_average_interpolated(sc::SampledCorrelations, q_ias, density; kwargs...)
Expand Down

0 comments on commit 1a559ce

Please sign in to comment.