Skip to content

Commit

Permalink
Merge pull request #242 from slaclab/projection-fit-bug
Browse files Browse the repository at this point in the history
fixes projection fit bug where the mean is off by one pixel
  • Loading branch information
roussel-ryan authored Feb 23, 2025
2 parents efa644f + 5215c1b commit 134b152
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lcls_tools/common/data/fit/projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ def unnormalize_model_params(
projection_data_range = np.max(projection_data) - np.min(projection_data)
length = len(projection_data)
for key, val in method_params_dict.items():
if "sigma" in key or "mean" in key:
if "sigma" in key:
true_fitted_val = val * length
elif "mean" in key:
true_fitted_val = val * (length - 1)
elif "offset" in key:
true_fitted_val = val * projection_data_range + np.min(projection_data)
else:
Expand Down

0 comments on commit 134b152

Please sign in to comment.