manoharan-lab / holopy

Hologram processing and light scattering in python
GNU General Public License v3.0
131 stars 50 forks source link

Re-gold two-color noise test #431

Closed vnmanoharan closed 7 months ago

vnmanoharan commented 7 months ago

test_2_colour_noise_sd is failing for me. I have tried several approaches (using numpy on the raw images in addition to using the code currently in holopy.core.io.io.py) to reproduce the gold values of the noise_sd that are reported in the test, but I can't reproduce these values. This might be related to #430, in that a different method was used to generate the gold values than the one we currently use. In any case, it seems that changing the gold values is the simplest approach here.

This PR also cleans up some of the code in load_average() and the Accumulator class. In particular, I removed the method accumulator.cv() since it does pixel-wise averaging for multiple channels, and the Accumulator class doesn't require a labeled array and so is ignorant of coordinates and channels (as it should be). The calculation of the coefficient of variation is now in load_average(). I removed the tests associated with the accumulator.cv() method and added a new test to verify the numerical accuracy of the Welford algorithm implementation in accumulator.push() (see #276 for why we needed to implement this approach). The new code now takes advantage of xarray coordinate labels.

pep8speaks commented 7 months ago

Hello @vnmanoharan! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2024-01-03 16:52:08 UTC
vnmanoharan commented 7 months ago

commits for this PR moved to #423.