FCS-analysis / multipletau

python multiple-tau correlation algorithm
https://multipletau.readthedocs.io
BSD 3-Clause "New" or "Revised" License
19 stars 9 forks source link

Add handling of NaN in time traces #18

Open aseltmann opened 2 years ago

aseltmann commented 2 years ago

Hi Paul, I worked on arrtifact reduction in FCS time trace data. There, I can predict different artifacts in time traces. Currently I am removing these artifacts by deleting the artifactual parts and contracting the trace, which works quite well, but introduces small "stitching" artifacts where you put the parts of the trace together. When discussing this approach at MAF2022, Thorsten Wohland and others brought up that it should be straight forward to instead assign the artifactual parts of a trace as np.nan and deal with it in the correlation algorithm by ignoring this value in the correlation and then adjusting the normalisation in the end. I have not dealt with the correlation algorithms that deeply yet - have you thought about the handling of NaN values e.g. in multipletau?

paulmueller commented 2 years ago

Hi Alex, no, multipletau does not handle nans properly in such cases. I will not have time to implement this, but I would happily review a pull request. I am not sure how to properly implement this. If nan-handling is not straight-fotward, then using masked arrays might help. But I would also first have to wrap my head around those...