Skip to content

Commit

Permalink
Update rescale option in InelasticNeutronScatteringSpectra.
Browse files Browse the repository at this point in the history
  • Loading branch information
waltergu committed Dec 4, 2024
1 parent d1ca9f6 commit f375167
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/src/examples/Phonon.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The inelastic neutron scattering spectra of phonons can also be computed:
# scale: the scale of the intensity
spectra = phonon(
:INSS,
InelasticNeutronScatteringSpectra(path, range(0.0, 2.5, length=501); fwhm=0.05, rescale=log)
InelasticNeutronScatteringSpectra(path, range(0.0, 2.5, length=501); fwhm=0.05, rescale=x->log(1+x))
)
plt = plot()
plot!(plt, spectra)
Expand Down
2 changes: 1 addition & 1 deletion src/Core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ function run!(tba::Algorithm{<:CompositeTBA{Phononic, <:AbstractLattice}}, inss:
end
end
end
inss.data[3][:, :] = get(inss.action.options, :rescale, identity).(inss.data[3].+1)
inss.data[3][:, :] = get(inss.action.options, :rescale, identity).(inss.data[3])
end
@inline function checkpolarizations(qs₁::AbstractMatrix, qs₂::AbstractMatrix, momentum)
inner = mapreduce((e₁, e₂)->norm(conj(e₁)*e₂), +, qs₁, qs₂)/norm(qs₁)/norm(qs₂)
Expand Down
2 changes: 1 addition & 1 deletion test/TightBindingApproximation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ end
energybands = phonon(:EB, EnergyBands(path))
savefig(plot(energybands), "phonon.png")

inelastic = phonon(:INSS, InelasticNeutronScatteringSpectra(path, range(0.0, 2.5, length=501); fwhm=0.05, rescale=log))
inelastic = phonon(:INSS, InelasticNeutronScatteringSpectra(path, range(0.0, 2.5, length=501); fwhm=0.05, rescale=x->log(1+x)))
plt = plot()
plot!(plt, inelastic)
plot!(plt, energybands, color=:white, linestyle=:dash)
Expand Down

0 comments on commit f375167

Please sign in to comment.