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

Add ability to fit individually, globally, or both #63

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jess-farmer
Copy link
Collaborator

@jess-farmer jess-farmer commented Apr 26, 2023

Description of work:

Add ability to specify whether peaks should be individually fit, globally fit, or both, as mentioned in #59

To do:

  • Add in test for 'Shared' only option and update calculation of L1 for this case

To test:
Run the calibration scripts with the different SharedParameterFitType options: 'Individual', 'Shared', and 'Both'

@jess-farmer
Copy link
Collaborator Author

I've switched the minimizer used for the multifit from Steepest Descent to Levenberg Marquardt - this significantly improves the global E1 estimate for the case where invalid spectra haven't been excluded from the fit, and means that the system test no longer fails.

@jess-farmer jess-farmer marked this pull request as ready for review April 27, 2023 09:26
@jess-farmer jess-farmer changed the base branch from 0_seperate_script_into_modules to 59_5_manually_enter_invalid_detectors May 4, 2023 12:47
@jess-farmer jess-farmer requested a review from MialLewis May 4, 2023 15:02
Base automatically changed from 59_5_manually_enter_invalid_detectors to main May 12, 2023 08:01
Copy link
Collaborator

@MialLewis MialLewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR Jess. I've requested some changes largely related to refactoring of code into smaller functions.

Functions well.

rel_tol_theta, rel_tol_L1 = self._extract_tolerances(deepcopy(tolerances))
theta_errors = self._assert_theta_parameters_match_expected(params_table, rel_tol_theta)
L1_errors = self._assert_L1_parameters_match_expected(params_table, rel_tol_L1)
L1_errors = None
if fit_type != 'Shared':
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remind me, why can't we test L1 parameters if the fit is shared?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried writing tests for the global L1 values (which are calculated using the global E1 values), but found that the values didn't match the expected L1 parameters - I was going to bring this up with Matthew when we next speak to him to check that the global L1 values are being calculated in the correct way

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok sounds good, I'll take another look at this PR when I get a chance, we're currently in our release sprint so I have a bit of a to-do list!

@jess-farmer
Copy link
Collaborator Author

Thanks for the review @MialLewis - I've now addressed most of your comments and have pushed the changes I've made so far. I still need to add more tests, and will aim to get this done by the end of the week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

None yet

2 participants