Skip to content

Add ability to simulate visibilities used a user-supplied beam basis and basis coefficients#66

Draft
tyler-a-cox wants to merge 7 commits into
mainfrom
eigenbeams
Draft

Add ability to simulate visibilities used a user-supplied beam basis and basis coefficients#66
tyler-a-cox wants to merge 7 commits into
mainfrom
eigenbeams

Conversation

@tyler-a-cox
Copy link
Copy Markdown
Owner

This PR builds on the per-antenna beam simulation functionality introduced in #63.

Currently, the scaling of fftvis with the number of unique beams is computationally expensive, scaling between ~N_beams and N_beams^2. This creates a performance bottleneck when running simulations with large arrays of unique beams.

This PR introduces the option to simulate visibilities using a reduced basis formed from a stack of unique beams. Assuming the beams used for simulation are largely similar to one another, we can form a basis using the SVD/PCA of the beam stack to reduce the effective number of unique beams passed to fftvis. This reduces the number of required NUFFTs and beam interpolation from ~N_beams^2 down to N_eigenbeams^2.

Here, we introduce a new function, which accepts a list UVBeam objects and returns a list of "eigenbeams" (also stored as UVBeam objects) and beam coefficients (of size (nants, ncoefs, nfreqs)) that map the eigenbeams to the input UVBeam objects. These beams/coefficients can then be passed to fftvis.simulate_vis via the beam parameter and the new eigenbeam_coefs parameter to produce visibilities with per-antenna beams.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 53.38346% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.40%. Comparing base (1a76fa7) to head (655f10e).

Files with missing lines Patch % Lines
src/fftvis/cpu/cpu_simulate.py 62.22% 28 Missing and 6 partials ⚠️
src/fftvis/core/beam_basis.py 17.24% 24 Missing ⚠️
src/fftvis/wrapper.py 66.66% 2 Missing and 2 partials ⚠️

❗ There is a different number of reports uploaded between BASE (1a76fa7) and HEAD (655f10e). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (1a76fa7) HEAD (655f10e)
unittests 6 5
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #66      +/-   ##
==========================================
- Coverage   95.22%   87.40%   -7.83%     
==========================================
  Files          18       19       +1     
  Lines         566      635      +69     
  Branches       86       97      +11     
==========================================
+ Hits          539      555      +16     
- Misses         17       66      +49     
- Partials       10       14       +4     
Flag Coverage Δ
unittests 87.40% <53.38%> (-7.83%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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