convolve_uv
pip install convolve-uv
import astropy.units as u
from convolve_uv import convolve_uv
from radio_beam import Beam
from spectral_cube import SpectralCube
cube = SpectralCube.read("my_cube.fits")
target_beam = Beam(major=0.86 * u.arcsec, minor=0.86 * u.arcsec, pa=0 * u.deg)
cube_conv = convolve_uv(image=cube,
target_beam=target_beam,
)
convolve-uv is a small Python package that allows for image convolution without loss of resolution.
When using something like convolve_fft in astropy, you generate a kernel in the image domain, Fourier
transform (FT) it and the input image, and then perform the multiplication in the Fourier domain to carry out
the convolution. Whilst this works well for arbitrary kernels, when the kernel is small enough that the
pixel scale does not properly sample it, artefacts can be introduced or the convolution can fail. The way
around this is to pad out the kernel slightly so it is properly sampled, but this results in a loss of
resolution.
convolve-uv takes a different approach, one that is useful for radio data when the beam of your data and
the convolution kernel are both Gaussian (which is almost always the case). This instead builds a transfer
function directly in $uv$-space, and multiplies the FT of the image by this transfer function.
This means we can generate kernels that are not limited by the pixel scale of the image, and e.g. convolve
an elliptical to a round beam without any unnecessary loss of resolution.
To illustrate this, the Figure below shows a demonstration of convolve-uv compared to the astropy
convolve_fft. The original beam here is elliptical ($0.86^{\prime\prime} \times 0.65^{\prime\prime}$),
and so the round beam is $0.86^{\prime\prime} \times 0.86^{\prime\prime}$. We see that convolve-uv
successfully convolves the image to the round beam, while convolve_fft fails to do so due to the
undersampling of the kernel. For larger kernels (convolving to a $1^{\prime\prime}$ and $1.5^{\prime\prime}$
beam), the two approaches give the same result.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file convolve_uv-0.1.1.tar.gz.
File metadata
- Download URL: convolve_uv-0.1.1.tar.gz
- Upload date:
- Size: 113.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4452ed4115dee304cc5a4a2976501ae847e968edf44d6c6e611a339d88744f21
|
|
| MD5 |
8777bc843b582263daa9ab79fbae699c
|
|
| BLAKE2b-256 |
a41dbfb082e83317b0b8b9577adabadd4c7c764343a228b47bb9abdf8b504ecb
|
File details
Details for the file convolve_uv-0.1.1-py3-none-any.whl.
File metadata
- Download URL: convolve_uv-0.1.1-py3-none-any.whl
- Upload date:
- Size: 31.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0325293b577de570c6f5499d2cd62dd1fdbf5231fe190c69a21e25d670a94508
|
|
| MD5 |
0468429a684c0340747d34b142449a56
|
|
| BLAKE2b-256 |
d7cfabd6f145b1022526d4fcef07ccb5dc987b7a93c63f05ac98667c35f7c714
|