madscatt / zazzie

development branch
GNU General Public License v3.0
2 stars 3 forks source link

Match Point Analysis: need to keep option for user to choose an initial matchpoint guess #167

Closed skrueger111 closed 2 months ago

skrueger111 commented 5 months ago

As originally written, Match Point Analysis required the user to specify an initial matchpoint guess in order to solve the linear equation for sqrt[I(0)/c] vs fraction D2O. This equation isn't linear unless the sign is reversed, i.e., - sqrt[I(0)/c], for the fraction D2O values where the contrast is negative. The initial match point guess was meant to specify the fraction D2O value that divides the positive and negative contrast values. This input was eliminated by fitting I(0)/c vs fraction D2O to a 2nd order polynomial and finding the point where the derivative = 0. This fraction D2O then becomes the initial matchpoint guess for solving the linear equation sqrt[I(0)] vs fraction D2O. This worked well with test data that contained 7 contrast points. However, not all complexes are well-behaved enough to obtain data at 7 (or even 4-5) well-separated contrasts. In recent test data containing only 3 contrast points, the initial match point guess using the polynomial fitting method was way off and, consequently, the fitted match point was incorrect. In such cases, the user needs to be able to override the polynomial fit and input a value for the initial match point guess using, for example, a value obtained from Contrast Calculator. My initial thought is to have a checkbox where the user can set a flag and provide an initial match point guess as input. If the flag isn't set, then the polynomial fit is performed to obtain the initial match point guess.

skrueger111 commented 2 months ago

New version of match_point.py now pushed to Github.