Skip to content

Commit

Permalink
Bug fix calibration recipe for unit fitting in partition calibration
Browse files Browse the repository at this point in the history
  • Loading branch information
theHenks committed Nov 18, 2024
1 parent 143524e commit 9bd7a2d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions ext/LegendSpecFitsRecipesBaseExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -962,9 +962,18 @@ end
bottom_margin --> (0, :mm)
if report.type == :cal
additional_pts = if !isempty(additional_pts)
μ_cal = report.f_fit.(additional_pts.μ) .* report.e_unit
(x = additional_pts.μ, y = ustrip.(report.e_unit, additional_pts.peaks),
residuals_norm = (value.(μ_cal) .- additional_pts.peaks) ./ uncertainty.(μ_cal))
μ_cal = if unit(first(additional_pts.μ)) != NoUnits
report.f_fit.(ustrip.(report.e_unit, additional_pts.μ))
else
report.f_fit.(additional_pts.μ)
end
p_cal = if unit(first(additional_pts.μ)) != NoUnits
ustrip.(report.e_unit, additional_pts.peaks)
else
additional_pts.peaks
end
(x = μ_cal, y = p_cal,
residuals_norm = (value.(μ_cal) .- p_cal)./ uncertainty.(μ_cal))
else
NamedTuple()
end
Expand Down

0 comments on commit 9bd7a2d

Please sign in to comment.