Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to fitting for faint traces. #35

Merged
merged 5 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.13.0 (2024-12-13)
-------------------
- Updated how we fit the profile center/width to better fit faint traces

0.12.0 (2024-12-11)
-------------------
- We now have prefer calibrations in the following order: same block, same proposal, any public calibration.
Expand Down
10 changes: 8 additions & 2 deletions banzai_floyds/matched_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def matched_filter_hessian(theta, data, error, weights_function, weights_jacobia


def optimize_match_filter(initial_guess, data, error, weights_function, x, weights_jacobian_function=None,
weights_hessian_function=None, args=None, minimize=False, bounds=None):
weights_hessian_function=None, args=None, minimize=False, bounds=None, covariance=False):
"""
Find the best fit parameters for a match filter model

Expand All @@ -329,6 +329,8 @@ def optimize_match_filter(initial_guess, data, error, weights_function, x, weigh
Any other static arguments that should be passed to the weights function.
minimize: Boolean
Minimize instead of maximize match filter signal?
covariance: Boolean
Return the covariance matrix of the fit?

Returns
-------
Expand Down Expand Up @@ -365,4 +367,8 @@ def optimize_match_filter(initial_guess, data, error, weights_function, x, weigh
hess=lambda *params: sign * matched_filter_hessian(*params),
jac=lambda *params: sign * matched_filter_jacobian(*params),
options={'eps': 1e-5}, bounds=bounds)
return best_fit.x

if covariance:
return best_fit.x, best_fit.hess_inv.todense()
else:
return best_fit.x
Loading
Loading