Skip to content

Commit

Permalink
StatsBase.midpoints for histogram edges
Browse files Browse the repository at this point in the history
  • Loading branch information
theHenks committed Feb 25, 2025
1 parent 97d7b83 commit fcdd598
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sipm_simple_calibration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function sipm_simple_calibration(pe_uncal::Vector{<:Real};

# use SavitzkyGolay filter to smooth the histogram
sg_uncal_cut = savitzky_golay(h_uncal_cut.weights, ifelse(isodd(peakfinder_σ_scaled), peakfinder_σ_scaled, peakfinder_σ_scaled + 1), 3)
edges = (h_uncal_cut.edges[1][1:end-1] .+ h_uncal_cut.edges[1][2:end]) ./ 2
edges = StatsBase.midpoints(first(h_uncal_cut.edges)) # use midpoints as x values
counts_sg = sg_uncal_cut.y
# get local maxima
min_i_prominence = round(Int, peakfinder_σ_scaled / 2)
Expand Down

0 comments on commit fcdd598

Please sign in to comment.