Signs and Conventions#
This page centralizes the sign and axis conventions used in Pyralysis for image-space and Fourier-space operations. It is intended as a practical reference for users implementing pipelines, custom estimators, or validating equations.
Image Pixel Size Convention (cellsize)#
Internally, Pyralysis enforces a signed 2-element cellsize in radians:
This is implemented by pyralysis.utils.cellsize and used by pyralysis.grids.base.Grid.
cellsize[0]maps to the horizontal image axis (\(l\)) and is stored negative.cellsize[1]maps to the vertical image axis (\(m\)) and is stored positive.
Even when a scalar value is provided, Pyralysis expands it to this signed pair.
Direction Cosines Convention (l, m, n)#
Pyralysis uses the standard radio-interferometry direction-cosine convention relative to a phase center
(pyralysis.utils.coordinate_transforms):
where \((\alpha,\delta)\) is sky position and \((\alpha_0,\delta_0)\) is the phase center.
UV Cell Size and Axis Mapping#
For padded image size \((N_y, N_x)\) and image-space cell sizes \((\Delta l, \Delta m)\), Pyralysis uses:
where:
\(N_x\) is the horizontal (width) pixel count.
\(N_y\) is the vertical (height) pixel count.
\(\Delta l < 0\) and \(\Delta m > 0\) by convention.
Therefore, uvcellsize[0] (du) is usually negative and uvcellsize[1] (dv) positive.
Nyquist Limits (Useful Rules of Thumb)#
Given image-space sampling \(\Delta l, \Delta m\), the approximate Nyquist support in UV is:
And Fourier pixel spacing is:
In practice, padding changes \(N_x, N_y\), so it changes Fourier sampling density (pixel spacing) but not the physical baseline coverage of the observed data.
FFT/IDFT Sign Convention#
Pyralysis exposes both sign conventions via sign_convention:
"negative"(default): forward transform uses \(e^{-2\pi i(\cdot)}\)."positive": forward transform uses \(e^{+2\pi i(\cdot)}\).
In pyralysis.fft._fft2.fft2() / pyralysis.fft._fft2.ifft2(), the inverse uses the corresponding opposite-sign primitive mapping to keep the pair consistent for the selected normalization mode.
Phase-Shift Convention (Grid and Visibilities)#
For shifting Fourier grids or visibilities to a phase-center offset, Pyralysis uses:
specifically in pyralysis.utils.fourier.phase_shift:
This is consistent with the usual Fourier shift theorem for analysis/registration.
IDFT for Visibility to Image#
For direct inversion (pyralysis.dft.idft2()), Pyralysis evaluates:
with sign flipped if sign_convention="positive" is selected (i.e., IDFT uses the opposite sign of the forward DFT convention).
Hermitian Symmetry Convention#
When hermitian_symmetry=True, Pyralysis stores only the non-redundant half-plane in u (via rfft2/irfft2 path):
uis represented as non-negative indices on the stored grid.vremains centered.
This is a storage/computation optimization for real image-domain inputs and should be interpreted with the same sign conventions above.
Sky-Model Source Placement Factor#
When evaluating analytic sky models into visibility space, Pyralysis uses a positive phase factor:
This appears in source modeling utilities (for example, source sky-position factors) and is intentional:
phase-shift operators that move existing data use \(\exp\{-2\pi i(\cdot)\}\)
source forward modeling that synthesizes visibilities from sky components uses \(\exp\{+2\pi i(\cdot)\}\) in this implementation
Keep this distinction in mind when mixing custom source terms and post-FFT/visibility shift operations.