pyuvdata
pyuvdata copied to clipboard
Add AnalyticBeam objects and a unified interface for UVBeams and AnalyticBeams
Description
This is a refactor of some code that has existed in pyuvsim for some time with some new functionality to make it easier to work with analytic beams.
Major changes:
- Add a new AnalyticBeam base class and several specific analytic beam objects (Airy, Gaussian, Short dipole, Uniform) that support evaluating either the E-field or power response in any direction and frequency.
- Add a BeamInterface object which can have either a UVBeam or an Analytic Beam attached to it and which can be used to get beam responses in any direction and frequency via a unified method that either calls
UVBeam.interpor the appropriate AnalyticBeam eval method.
There are also a couple of minor changes:
- Fix a bug in the the new beam initializer method where it makes data_arrays with the wrong type when cross pols are included.
- Small refactoring in UVBeam
Motivation and Context
This will substantially clean up code in pyuvsim, make the analytic beams more accessible for other users and make it easier for simulators by providing a unified interface for UVBeam and Analytic Beam objects.
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation change (documentation changes only)
- [ ] Version change
- [ ] Build or continuous integration change
Checklist:
- [x] I have read the contribution guide.
- [x] My code follows the code style of this project.
New feature checklist:
- [x] I have added or updated the docstrings associated with my feature using the numpy docstring format.
- [ ] I have updated the tutorial to highlight my new feature (if appropriate).
- [x] I have added tests to cover my new feature.
- [x] All new and existing tests pass.
- [x] I have updated the CHANGELOG.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.93%. Comparing base (
e2b73b4) to head (afa5f69).
Additional details and impacted files
@@ Coverage Diff @@
## main #1383 +/- ##
========================================
Coverage 99.92% 99.93%
========================================
Files 61 63 +2
Lines 21319 21660 +341
========================================
+ Hits 21304 21645 +341
Misses 15 15
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.