Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarros committed Sep 25, 2024
1 parent 340325c commit d9554b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
15 changes: 12 additions & 3 deletions src/Binning/Binning.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,11 @@ end
"""
unit_resolution_binning_parameters(sc::SampledCorrelations)
Create [`BinningParameters`](@ref) which place one histogram bin centered at each possible `(q,ω)` scattering vector of the crystal.
This is the finest possible binning without creating bins with zero scattering vectors in them.
Create [`BinningParameters`](@ref) which place one histogram bin centered at
each possible `(q,ω)` scattering vector of the crystal. This is the finest
possible binning without creating bins with zero scattering vectors in them.
"""
function unit_resolution_binning_parameters(sc; negative_energies=true)
function unit_resolution_binning_parameters(sc::SampledCorrelations; negative_energies=true)
ωvals = available_energies_including_zero(sc; negative_energies)

good_qs = available_wave_vectors(sc)
Expand Down Expand Up @@ -221,6 +222,14 @@ function unit_resolution_binning_parameters(sc; negative_energies=true)
params
end

function Sunny.unit_resolution_binning_parameters(isc::SampledCorrelationsStatic; kwargs...)
params = Sunny.unit_resolution_binning_parameters(isc.parent; kwargs...)
# Integrate over all energies
params.binstart[4] = -Inf
params.binwidth[4] = Inf
params
end

function Base.copy(p::BinningParameters)
BinningParameters(copy(p.binstart), copy(p.binend), copy(p.binwidth), copy(p.covectors))
end
Expand Down
9 changes: 0 additions & 9 deletions test/test_binning.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ end
sys = System(cryst, [1 => Moment(s=1/2, g=2)], :dipole; dims=(5,5,1))
randomize_spins!(sys)

# This should be added to Sunny (oops)
function Sunny.unit_resolution_binning_parameters(isc::SampledCorrelationsStatic; kwargs...)
params = Sunny.unit_resolution_binning_parameters(isc.parent; kwargs...)
# Integrate over all energies
params.binstart[4] = -Inf
params.binwidth[4] = Inf
params
end

static_corrs = SampledCorrelationsStatic(sys; measure=ssf_trace(sys))
add_sample!(static_corrs,sys)

Expand Down

0 comments on commit d9554b9

Please sign in to comment.