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

FitTrace should set bin to NaN when a fully masked bin is encountered #206

Closed
cshanahan1 opened this issue Jan 11, 2024 · 0 comments · Fixed by #207
Closed

FitTrace should set bin to NaN when a fully masked bin is encountered #206

cshanahan1 opened this issue Jan 11, 2024 · 0 comments · Fixed by #207

Comments

@cshanahan1
Copy link
Contributor

When FitTrace encounters a fully masked bin (which can also be a fully masked column, if nbins=ncols) one of three things can happen depending on choice of peak_method:

  1. If peak_method is gaussian, the entire fit will fail. If the bin peak were set to nan instead of failing, the rest of the bins could be fit and the fully masked bins could be filtered out of the final fit to bin peaks for the trace.
  2. if peak_method is max, the peak for the fully masked bin will always be 0. This biases the overall fit for the trace, and if they were instead set to nan they could be masked for the final fit.
  3. if peak_method is centroid, the peak for the fully masked bin will always be the number of rows in the image because it is trying to interpolate between nans.

In all three of these cases, the final fit trace for these fully masked bins will have a final value using the all-bin fit, but the fit to the bin peaks itself is biased when there are 0s or 200s (for a 200x100 image for example). Additionally, the total failure for fully masked bins when using gaussian for the peak method can be avoided if that bin is just excluded from the final fit.

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

Successfully merging a pull request may close this issue.

1 participant