Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Changed
- Improved `UVBeam` azimuth/zenith spline interpolation performance by sharing the
tensor-product basis across beam data slices and using vectorized domain checks.
`scipy.interpolate.NdBSpline` is now used whenever `spline_opts` requests only the
spline orders `kx`/`ky` (the default), independent of `reuse_spline`;
`scipy.interpolate.RectBivariateSpline` remains in use for smoothing (`s != 0`) and
for any other RectBivariateSpline-only option. Both engines solve the same
interpolating spline for a given `kx`/`ky` with `s = 0`.
- Updated minimum dependency versions: scipy>=1.15

### Fixed
- A bug where the longitudinal coordinate (e.g., RA) of "ephem" phase centers was not
unwrapped, leading to potential discontinuities when performing interpolation.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Required:
* pyerfa >= 2.0.1.1
* python >= 3.11
* pyyaml >= 5.4.1
* scipy >= 1.9
* scipy >= 1.15
* setuptools_scm >= 8.1

Optional:
Expand Down
2 changes: 1 addition & 1 deletion ci/pyuvdata_min_deps_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ dependencies:
- pytest-cov
- pytest-xdist
- pyyaml>=5.4.1
- scipy>=1.9
- scipy>=1.15
- setuptools_scm>=8.1
- sybil>=8.0
2 changes: 1 addition & 1 deletion ci/pyuvdata_min_versions_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:
- pytest-xdist
- python-casacore==3.5.2
- pyyaml==5.4.1
- scipy==1.9.*
- scipy==1.15.*
- setuptools==65.*
- setuptools_scm==8.1
- sybil==8.0
Expand Down
2 changes: 1 addition & 1 deletion ci/pyuvdata_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:
- pytest-xdist
- python-casacore>=3.5.2
- pyyaml>=5.4.1
- scipy>=1.9
- scipy>=1.15
- setuptools_scm>=8.1
- sybil>=8.0
- pip:
Expand Down
2 changes: 1 addition & 1 deletion ci/pyuvdata_tests_mac_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:
- pytest-xdist
- python-casacore>=3.5.2
- pyyaml>=5.4.1
- scipy>=1.9
- scipy>=1.15
- setuptools_scm>=8.1
- sybil>=8.0
- pip:
Expand Down
2 changes: 1 addition & 1 deletion ci/pyuvdata_tests_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies:
- pytest-cov
- pytest-xdist
- pyyaml>=5.4.1
- scipy>=1.9
- scipy>=1.15
- cython>=3.0
- setuptools_scm>=8.1
- sybil>=8.0
Expand Down
2 changes: 1 addition & 1 deletion environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
- pytest-xdist
- python-casacore>=3.5.2
- pyyaml>=5.4.1
- scipy>=1.9
- scipy>=1.15
- setuptools_scm>=8.1
- sphinx
- sybil>=8.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies = [
"numpy>=1.23",
"pyerfa>=2.0.1.1",
"pyyaml>=5.4.1",
"scipy>=1.9",
"scipy>=1.15",
"setuptools_scm>=8.1",
]
requires-python = ">=3.11"
Expand Down
32 changes: 26 additions & 6 deletions src/pyuvdata/beam_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,33 @@ def compute_response(
the specified tolerance then return the beam at each nearest neighbor,
otherwise interpolate the beam. Only applies if beam is a UVBeam.
reuse_spline : bool
Save the interpolation functions for reuse. Only applies if beam is
a UVBeam and interpolation_function is "az_za_simple".
Save the fitted splines on the beam for reuse. Only applies if beam is
a UVBeam and interpolation_function is "az_za_simple", where it applies
to both of the engines described under `spline_opts`. The cache holds
spline coefficients, so it costs roughly as much memory as the beam
data it was fit to.
spline_opts : dict
Provide options to numpy.RectBivariateSpline. This includes spline
order parameters `kx` and `ky`, and smoothing parameter `s`. Only
applies if beam is a UVBeam and interpolation_function is "az_za_simple"
or "az_za_map_coordinates".
Options for the spline fit: the spline orders `kx` (zenith angle axis)
and `ky` (azimuth axis), and the smoothing parameter `s`. Only applies
if beam is a UVBeam. For "az_za_simple" this dict is also what selects
the interpolation engine:

- **Default** (`spline_opts` is None, or contains only `kx`, `ky`
and/or `s=0`): :class:`scipy.interpolate.NdBSpline`. The
tensor-product basis is built once and every vector/feed/frequency
slice is evaluated against it together, which is substantially
faster.
- **Fallback** (`s` is nonzero, or any other
:class:`scipy.interpolate.RectBivariateSpline` keyword such as
`bbox` is given): RectBivariateSpline, fit and evaluated one slice
at a time. Smoothing is only available on this path.

For the same `kx` and `ky` with `s=0` the two engines solve the same
interpolating spline and agree to floating point rounding (of order
1e-15 relative), so this choice affects speed rather than results.

For "az_za_map_coordinates" this dict is instead passed to
:func:`scipy.ndimage.map_coordinates` (e.g. `order`, `mode`, `cval`).
check_azza_domain : bool
Whether to check the domain of az/za to ensure that they are covered by the
intrinsic data array. Checking them can be quite computationally expensive.
Expand Down
Loading
Loading