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 lru_cache to _calculate_amat_eigenvecs to speed up pswf_operator #10

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

Conversation

tyler-a-cox
Copy link
Collaborator

I added lru_cache to _calculate_amat_eigenvecs to speed up pswf_operator in the case where it's called repeatedly for similar input values. One of the main use cases for pswf_operator is hera_cal.nucal.compute_spatial_filters which computes PSWF basis functions for filtering baselines with the same orientation. Sets of baselines within the same orientation use the same eigenvectors and eigenvalues to compute a set of PSWF basis functions, but they're never explicitly cached even though they're the most expensive part of the computation. I set the maxsize fairly low, since the pswf_operator function is called repeatedly by hera_cal.nucal.compute_spatial_filters for baselines which reuse the output of _calculate_amat_eigenvecs. I also kept the maxsize low because the returned matrix size of this function can get up to nfreqs x nfreqs

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.

1 participant