# Direct Fourier Transform¶

Functions used to compute the discretised direct Fourier transform (DFT) for an ideal unpolarised interferometer. The DFT for an ideal interferometer is defined as

$V(u,v,w) = \int I(l,m) e^{-2\pi i \left( ul + vm + w(n-1)\right)} \frac{dl dm}{n}$

where $$u,v,w$$ are data (visibility $$V$$) space coordinates and $$l,m,n$$ are signal (image $$I$$) space coordinates. We adopt the convention where we absorb the fixed coordinate $$n$$ in the denominator into the image. Note that the data space coordinates have an implicit dependence on frequency and time and that the image has an implicit dependence on frequency. The discretised form of the DFT can be written as

$V(u,v,w) = \sum_s e^{-2 \pi i (u l_s + v m_s + w (n_s - 1))} \cdot I_s$

where $$s$$ labels the source (or pixel) location. This can be cast into a matrix equation as follows

$V = R I$

where $$R$$ is the operator that maps an image to visibility space. This mapping is implemented by the im_to_vis() function. An imaging algorithm also requires the adjoint denoted $$R^\dagger$$ which is simply the complex conjugate transpose of $$R$$. The dirty image is obtained by applying the adjoint operator to the visibilities

$I^D = R^\dagger V$

This is implemented by the vis_to_im() function. Note that an imaging algorithm using these operators will actually reconstruct $$\frac{I}{n}$$ but that it is trivial to obtain $$I$$ since $$n$$ is known at each location in the image.

## Numpy¶

 im_to_vis(image, uvw, lm, frequency[, dtype]) Computes the discrete image to visibility mapping of an ideal unpolarised interferometer : vis_to_im(vis, uvw, lm, frequency[, dtype]) Computes visibility to image mapping of an ideal unpolarised interferometer:
africanus.dft.im_to_vis(image, uvw, lm, frequency, dtype=None)[source]

Computes the discrete image to visibility mapping of an ideal unpolarised interferometer :

${\Large \sum_s e^{-2 \pi i (u l_s + v m_s + w (n_s - 1))} \cdot I_s }$
Parameters: image : numpy.ndarray image of shape (source, chan) The Stokes I intensity in each pixel (flatten 2D array per channel). uvw : numpy.ndarray UVW coordinates of shape (row, 3) with U, V and W components in the last dimension. lm : numpy.ndarray LM coordinates of shape (source, 2) with L and M components in the last dimension. frequency : numpy.ndarray frequencies of shape (chan,) dtype : np.dtype, optional Datatype of result. Should be either np.complex64 or np.complex128. Defaults to np.complex128 visibilties : numpy.ndarray complex of shape (row, chan)
africanus.dft.vis_to_im(vis, uvw, lm, frequency, dtype=None)[source]

Computes visibility to image mapping of an ideal unpolarised interferometer:

${\Large \sum_k e^{ 2 \pi i (u_k l + v_k m + w_k (n - 1))} \cdot V_k}$
Parameters: vis : numpy.ndarray visibilities of shape (row, chan) The Stokes I visibilities of which to compute a dirty image uvw : numpy.ndarray UVW coordinates of shape (row, 3) with U, V and W components in the last dimension. lm : numpy.ndarray LM coordinates of shape (source, 2) with L and M components in the last dimension. frequency : numpy.ndarray frequencies of shape (chan,) dtype : np.dtype, optional Datatype of result. Should be either np.float32 or np.float64. Defaults to np.float64 image : numpy.ndarray float of shape (source, chan)

 im_to_vis(image, uvw, lm, frequency[, dtype]) Computes the discrete image to visibility mapping of an ideal unpolarised interferometer : vis_to_im(vis, uvw, lm, frequency[, dtype]) Computes visibility to image mapping of an ideal unpolarised interferometer:
africanus.dft.dask.im_to_vis(image, uvw, lm, frequency, dtype=<type 'numpy.complex128'>)[source]

Computes the discrete image to visibility mapping of an ideal unpolarised interferometer :

${\Large \sum_s e^{-2 \pi i (u l_s + v m_s + w (n_s - 1))} \cdot I_s }$
Parameters: image : dask.array.Array image of shape (source, chan) The Stokes I intensity in each pixel (flatten 2D array per channel). uvw : dask.array.Array UVW coordinates of shape (row, 3) with U, V and W components in the last dimension. lm : dask.array.Array LM coordinates of shape (source, 2) with L and M components in the last dimension. frequency : dask.array.Array frequencies of shape (chan,) dtype : np.dtype, optional Datatype of result. Should be either np.complex64 or np.complex128. Defaults to np.complex128 visibilties : dask.array.Array complex of shape (row, chan)
africanus.dft.dask.vis_to_im(vis, uvw, lm, frequency, dtype=<type 'numpy.float64'>)[source]

Computes visibility to image mapping of an ideal unpolarised interferometer:

${\Large \sum_k e^{ 2 \pi i (u_k l + v_k m + w_k (n - 1))} \cdot V_k}$
Parameters: vis : dask.array.Array visibilities of shape (row, chan) The Stokes I visibilities of which to compute a dirty image uvw : dask.array.Array UVW coordinates of shape (row, 3) with U, V and W components in the last dimension. lm : dask.array.Array LM coordinates of shape (source, 2) with L and M components in the last dimension. frequency : dask.array.Array frequencies of shape (chan,) dtype : np.dtype, optional Datatype of result. Should be either np.float32 or np.float64. Defaults to np.float64 image : dask.array.Array float of shape (source, chan)