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 AnalyticBeam objects and a unified interface for UVBeams and AnalyticBeams #1383

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

Conversation

bhazelton
Copy link
Member

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.interp or 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)
  • 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:

New feature checklist:

  • 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).
  • I have added tests to cover my new feature.
  • All new and existing tests pass.
  • I have updated the CHANGELOG.

Copy link

codecov bot commented Jan 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.92%. Comparing base (c87c321) to head (a791f16).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main    #1383    +/-   ##
========================================
  Coverage   99.92%   99.92%            
========================================
  Files          37       39     +2     
  Lines       20807    21133   +326     
========================================
+ Hits        20791    21117   +326     
  Misses         16       16            
Files Coverage Δ
pyuvdata/__init__.py 100.00% <100.00%> (ø)
pyuvdata/utils.py 100.00% <100.00%> (ø)
pyuvdata/uvbeam/__init__.py 100.00% <100.00%> (ø)
pyuvdata/uvbeam/analytic_beam.py 100.00% <100.00%> (ø)
pyuvdata/uvbeam/beam_interface.py 100.00% <100.00%> (ø)
pyuvdata/uvbeam/initializers.py 100.00% <100.00%> (ø)
pyuvdata/uvbeam/uvbeam.py 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c87c321...a791f16. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant