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

GCI_marquardt_fitting_engine incorrectly shifts input when no instrument response provided #47

Open
marktsuchida opened this issue Jul 29, 2021 · 1 comment

Comments

@marktsuchida
Copy link
Contributor

flimlib/src/main/c/EcfSingle.c

Lines 1893 to 1898 in 40b1fb8

if (ninstr <= 0) {
trans = &(trans[fit_start]); // we can change the pointer since it has been passed 'by value'
fit_end -= fit_start;
ndata -= fit_start;
fit_start = 0;
}

These lines don't work. The fitted parameters end up being for the data shifted to the left by fit_start, and no correction is performed. The amplitude of the fit ends up being scaled down as a result.

The workaround of providing an ideal instrument response of length 1, containing 1.0, appears to work.

One question is why the GCI_marquardt (as opposed to GCI_marquardt_instr) function is not used in the case of no instrument response, despite being present.

@marktsuchida
Copy link
Contributor Author

(It turns out that this problem was already pointed out in the commit that introduced it.)

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

No branches or pull requests

1 participant