Support custom beam patterns in AnalyticBeam class #459
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extend
AnalyticBeam
class to support any function of alt, az and frequencyDescription
The
AnalyticBeam
class has been extended to support beam calculations using custom functions.To use, the
type='func'
argument is set, and the new optional argumentfunc=my_custom_function
is set:The function must have exactly three arguments, correspinding to
az_array, za_array
andfreq_array
, as used in the interp class method:Motivation and Context
The
AnalyticBeam
currently supports uniform, airy and Gaussian beam patterns. This PR allows any function of altitude, zenith angle, and frequency to be used, increasing flexibility.My motivation was to add support for beams generated from simple combinations of Numpy ufuncs (e.g. cos, sin, exp) with corresponding analytical functions. However, as long as the function returns a value for any given alt/az/freq, it doesn't strictly need to be an analytical function.
I chose this approach over adding another simple analytic function, e.g.
type='cos_squared'
, as it was far more flexible.Types of changes
Checklist:
For all pull requests:
New feature checklist:
Things I haven't done:
Documentation change checklist: