Open telegraphic opened 7 months ago
@telegraphic thank you for this. I think we need to think about this in relation to the work going on in https://github.com/RadioAstronomySoftwareGroup/pyuvdata/pull/1383, in which we are trying to generalize the UVBeam objects to have a more uniform interface between analaytic/simulated beams.
@telegraphic As Steven mentioned above, we are currently in the process of overhauling our approach to Analytic Beams, moving them into pyuvdata and trying to have a more flexible and useful API. We'd love your comments on that PR and would be happy to try to incorporate your ideas there as appropriate. The plan is to try to get them in a bit after our upcoming version 3.0 release of pyuvdata. We plan to make a branch of pyuvsim where we'll get the new analytic beams working to make sure everything works well before we merge it into pyuvdata (just as soon as we find the time...).
No worries, take your time, can reassess when beam approach has solidified.
@telegraphic I think we are getting close on the pyuvdata and pyuvsim PRs that will revamp the way the analytic beams are handled. The analytic beam structure was deliberately designed to make it easy for anyone to define their own beam objects by subclassing the AnalyticBeam abstract base class. We'd appreciate your thoughts on the PRs if you have a chance to take a look, both on the actual implementation and API and on the documentation.
The pyuvdata PR is here: https://github.com/RadioAstronomySoftwareGroup/pyuvdata/pull/1383 the pyuvsim PR is #487
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: