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 options for the propagation to the next register and to return the pure sum #14

Closed thepith closed 5 years ago

thepith commented 5 years ago

Propagation of Data points

The method of propagating the values to the next register can affect the systematic error introduced by the multiple tau algorithm. Good examples are given in https://doi.org/10.1063/1.3491098 . Therefore there is a need to have a different method than averaging the data points when propagating to the next register. Using only one of the data points completely removes the systematic error at the cost of increasing the statistical error.

This is incorporated by adding the string option compress, where the following values are accepted: "average" (default): average two measurements when pushing to the next level of the correlator. "first": use only the first value when pushing to the next level of the correlator. "second": use only the second value when pushing to the next level of the correlator.

Return Pure Sum

When one wants to use a different normalization, than the one toggled by the normalize option, the problem arises, that one needs the values stored in normstat. Therefore a bool option was added, so that when toggled, the not normalized sum is returned along with the values of normstat. This enables any further normalization by the user.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-6.2%) to 93.814% when pulling a3a0d476adc953a5e2c95284f2d3724b45407b09 on thepith:master into e03b00323319e09c07fe6c0d5bd0075a473dbae8 on FCS-analysis:master.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-6.2%) to 93.814% when pulling a3a0d476adc953a5e2c95284f2d3724b45407b09 on thepith:master into e03b00323319e09c07fe6c0d5bd0075a473dbae8 on FCS-analysis:master.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling f6488fa90d39c708a6aae1730515184b5b7c6e1a on thepith:master into e03b00323319e09c07fe6c0d5bd0075a473dbae8 on FCS-analysis:master.

paulmueller commented 5 years ago

Thank you for this PR. Could you please add test functions such that the coverage remains at 100%? Please also make sure that the documentation renders correctly, e.g. whether the options for compress are displayed correctly as a list or somesuch.

thepith commented 5 years ago

Hi,

i added tests and fixed the documentation.

Furthermore I noticed that when you abort the correlation you call

G = G[:idx - 1]
normstat = normstat[:idx - 1]
normnump = normnump[:idx - 1]

I think that this way you throw out the data at very long lag times. Is that intended? I believe it would be better to have

G = G[:idx]
normstat = normstat[:idx]
normnump = normnump[:idx]
paulmueller commented 5 years ago

regarding your question: I think the "abort"-case is just a special case where there is actually no data in the last row of G. To me it just looks like bad programming. I was just not able to figure out a more elegant solution.

paulmueller commented 5 years ago

Note: I renamed "return_sum" to "ret_sum", to be more consistent with numpy.