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

Add "Temporal" option to pca fullfr #583

Merged
merged 8 commits into from
Mar 30, 2023

Conversation

Sand-jrd
Copy link
Contributor

temporal (boolean) : Whether to use rather left or right singularvectors
image

@codecov-commenter
Copy link

codecov-commenter commented Mar 24, 2023

Codecov Report

Merging #583 (6d107ec) into master (19f9120) will decrease coverage by 0.22%.
The diff coverage is 55.56%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #583      +/-   ##
==========================================
- Coverage   63.78%   63.56%   -0.22%     
==========================================
  Files          56       56              
  Lines       12172    12208      +36     
==========================================
- Hits         7763     7759       -4     
- Misses       4409     4449      +40     
Impacted Files Coverage Δ
vip_hci/psfsub/svd.py 44.19% <23.53%> (-0.78%) ⬇️
vip_hci/var/shapes.py 70.36% <57.69%> (-0.97%) ⬇️
vip_hci/psfsub/pca_fullfr.py 59.77% <80.00%> (+0.30%) ⬆️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

+ add test for the modes
+ add warning for incompatible modes
@Sand-jrd
Copy link
Contributor Author

image

+ Add cases to not compute U if not asked for modes ('eigen', 'eigencupy', 'eigenpytorch')
It always returns the 3 values.
Not taking into account the pixels under the mask when computing temporal pc's required to discard those pixels from the vectorized images.

This is done in prepare_matrix() :

If, discard_mask_pix is set to True,
Then, mask_circle is asked to return a boolean mask instead of a masked array
The array is truncated accordingly to the boolean mask before being flattened.

Then, _svd_wrapper takes into account the spatially truncated vectors to compute the full temporal pc's. Then project the full matrix (with regular 0-filled mask) on the pc's 👍
@Sand-jrd
Copy link
Contributor Author

I changed the way the central mask was applied when computing the time pc's.
Instead of applying a mask of 0 it rather discards them from the vectorized images.
This avoids biasing the estimated time pc's by a series of zeros.
Capture d’écran 2023-03-29 153652

@VChristiaens VChristiaens merged commit 4114d47 into vortex-exoplanet:master Mar 30, 2023
@VChristiaens
Copy link
Contributor

Thanks a lot @Sand-jrd !

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.

3 participants