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

fix bugged TV denoising tests #100

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

fix bugged TV denoising tests #100

wants to merge 4 commits into from

Conversation

tjlane
Copy link
Collaborator

@tjlane tjlane commented Feb 8, 2025

Some unit tests targeting the TV denoising code were broken or flakey.

The idea behind these tests is to take a simple "ground truth" map, add some Gaussian noise, and then run TV denoising. Ideally, the output should be closer to the noise-free "ground truth" than the input.

But these tests were not faithfully reporting this because the map comparison was done by computing a normalized RMS between the two maps. The Pearson correlation, computed in real space, appears to provide a more robust signal, and this PR implements this change.

During the implementation, I realized that I was confused by the rsmap.Map methods. There is a .to_numpy() method inherited from pandas that provides the F, PHI, SIGF columns as numpy arrays. Useful, but for a moment, I thought I was getting real space maps. Therefore, this PR additionally implements a handy function that computes a 3d_numpy_map, which hopefully will make this easier and clearer going forward.

@tjlane tjlane self-assigned this Feb 13, 2025
@tjlane tjlane changed the title [WIP] fix bugged TV denoising tests fix bugged TV denoising tests Feb 13, 2025
@codecov-commenter
Copy link

codecov-commenter commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.63%. Comparing base (6f0ab62) to head (343d73d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #100   +/-   ##
=======================================
  Coverage   95.63%   95.63%           
=======================================
  Files          15       15           
  Lines         940      940           
=======================================
  Hits          899      899           
  Misses         41       41           
Flag Coverage Δ
unittests 95.63% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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 this pull request may close these issues.

2 participants