Module lib.generate_data
Helper functions to generate synthetic datasets such as those considered in [Abdulaziz2019, Thouvenin2021].
- lib.generate_data.generate_cube(file_name, f, emission_lines)
Script to generate a fully synthetic image cube as in [Abdulaziz2019].
- Parameters
file_name (string) – Name of a reference monochromatic image in
.fits
format.f (double[:]) – Frequencies over which the wideband image is generated.
emission_lines (bool) – If set to true, insert emission lines in the synthetic wideband image.
- Returns
x0 (double[:, :, :]) – Synthetic wideband image (3D) [N(1), N(2), L].
X0 (double[:, :]) – Synthetic wideband image (reshape in 2D format) [N(1)*N*(2), L].
- lib.generate_data.generate_cube_W28(file_name, f, emission_lines)
Script to generate a fully synthetic image cube as in [Abdulaziz2019] tailored to W28.
- Parameters
file_name (string) – Name of a reference monochromatic image in
.fits
format.f (double[:]) – Frequencies over which the wideband image is generated.
emission_lines (bool) – If set to true, insert emission lines in the synthetic wideband image.
- Returns
x0 (double[:, :, :]) – Synthetic wideband image (3D) [N(1), N(2), L].
X0 (double[:, :]) – Synthetic wideband image (reshape in 2D format) [N(1)*N*(2), L].
- lib.generate_data.generate_undersampled_cube(x0, f, Ny, Nx, c, unds)
Function returning a spectrally undersampled version of an input wideband image cube.
- Parameters
x0 (double[:, :, :]) – Synthetic wideband image (3D) [Ny, Nx, c].
f (double[:]) – Frequencies over which the wideband image x0 is defined.
Ny (int) – Spatial dimension of x0 along axis y.
Nx (int) – Spatial dimension of x0 along axis y.
c (int) – Spectrsl dimension of x0.
unds (int) – Spectral downsampling factor.
- Returns
x0_new (double[:, :, :]) – Output wideband image.
X0_new (double[:, :, :]) – Matrix-format version of x0_new.
f_new (double[:]) – Frequencies over which x0_new is defined.
c_new (int) – Number of spectral channels after spectral downsmapling.
- lib.generate_data.stationary_Gaussian_process(m, n, rho)
Draw a realization of a stationary random Gaussian field over an :math`m times n` grid, following [Kroese2015].
- Parameters
m (int) – Image dimension (y axis).
n (int) – Image dimension (x axis).
rho (anonymous function) – Function handle, function of a matrix \(h\) such that \(\text{cov}(X_t, Y_s) = \rho(t-s)\) is the covariance of a 2-dimensional stationary Gaussian field.
- Returns
field1, field2 (double[:, :]) – Two independent realization over the :math`m times n` grid considered.
tx, ty (double[:]) – Two vectors such that each field can be displayed using the command
imagesc(tx, ty, field1)
(idem for field2).
Example
Note
The size of covariance matrix is
m^2*n^2
.By default, when the function is called without assigning the output, field1 is drectly display using the
imagesc
MATLAB function.
- lib.generate_data.util_gen_measurements(x, G, W, A, input_snr)
Generate noisy visibilities over several spectral channels.
- Parameters
x (double[:, :, :]) – Input wodeband image.
G (cell of cell of sparse complex[:, :]) – Degridding matrix (per channel, per block).
W (cell of cell of int[:]) – Selection vector to extract data blocks from the full Fourier plane.
A (anonymous function.) – Function handle implementing the NUFFT.
input_snr (double) – Target input SNR taken over all channels.
- Returns
y0 (cell of cell of complex[:]) – Clean (i.e., noiseless) visibilities.
y (cell of cell of complex[:]) – Noisy visibilities.
Nm (int) – Total number of visbilities (across all data blocks and channels).
sigma_noise (double) – Overall noise level.
- lib.generate_data.util_gen_measurements_sigma(x, G, W, A, sigma_noise, seed)
Generate noisy synthetic viasilities using a predefined noise level.
- Parameters
x (double[:, :, :]) – Input wodeband image.
G (cell of cell of sparse complex[:, :]) – Degridding matrix (per channel, per block).
W (cell of cell of int[:]) – Selection vector to extract data blocks from the full Fourier plane.
A (anonymous function.) – Function handle implementing the NUFFT.
sigma_noise (double) – Overall noise level.
seed (int) – Seed to initialize the random number generator.
- Returns
y0 (cell of cell of complex[:]) – Clean (i.e., noiseless) visibilities.
y (cell of cell of complex[:]) – Noisy visibilities.
Nm (int) – Total number of visbilities (across all data blocks and channels).
- lib.generate_data.util_gen_measurements_snr(x, G, W, A, input_snr, rng_stream)
Generate noisy synthetic viasilities using a predefined per-channel input SNR.
- Parameters
x (double[:, :, :]) – Input wodeband image.
G (cell of cell of sparse complex[:, :]) – Degridding matrix (per channel, per block).
W (cell of cell of int[:]) – Selection vector to extract data blocks from the full Fourier plane.
A (anonymous function.) – Function handle implementing the NUFFT.
input_snr (double[:]) – Input SNR for each spectral channel.
rng_stream (random number generator) – Random number generator.
- Returns
y0 (cell of cell of complex[:]) – Clean (i.e., noiseless) visibilities.
y (cell of cell of complex[:]) – Noisy visibilities.
Ml (int[:]) – Number of data points in each spectral channel.
Nm (int) – Total number of visbilities (across all data blocks and channels).
sigma_noise (double[:]) – Noise level in each spectral channel.
norm_noise (double[:]) – Euclidean norm of the Gaussian noise affecting each data channel.
- lib.generate_data.util_gen_measurements_snr_new(x, G, W, A, input_snr, rng_stream)
Generate noisy synthetic viasilities using a predefined per-channel input SNR.
- Parameters
x (double[:, :, :]) – Input wodeband image.
G (cell of cell of sparse complex[:, :]) – Degridding matrix (per channel, per block).
W (cell of cell of int[:]) – Selection vector to extract data blocks from the full Fourier plane.
A (anonymous function.) – Function handle implementing the NUFFT.
input_snr (double[:]) – Input SNR for each spectral channel.
rng_stream (random number generator) – Random number generator.
- Returns
y0 (cell of cell of complex[:]) – Clean (i.e., noiseless) visibilities.
y (cell of cell of complex[:]) – Noisy visibilities.
Ml (int[:]) – Number of data points in each spectral channel.
Nm (int) – Total number of visbilities (across all data blocks and channels).
sigma_noise (double[:]) – Noise level in each spectral channel.
norm_noise (double[:]) – Euclidean norm of the Gaussian noise affecting each data channel.
G (cell of cell of sparse complex[:, :]) – Degridding matrix (per channel, per block) including noise whitening contribution.
- lib.generate_data.util_gen_sampling_pattern(pattern, param)
Function to generate a synthetic \(uv\)-coverage as in [Onose2017].
- Parameters
pattern (string) – Type of \(uv\)-coverage. Available options are …
param (struct) – Configuration options for the generation of the synthetic sampling pattern (to be completed).
- Returns
u – [description]
v – [description]
uw – [description]
vw – [description]
Nm – [description]