hyri.interface.sim_hs_img_cube#
Simulate hyperspectral image cubes from a reference intensity image.
This module provides Gaussian-field helpers and a power-law spectral model used to generate synthetic hyperspectral radio images for package-level tutorials and simulation experiments.
Functions
Return a callable unnormalised rotated 2D Gaussian. |
|
Generate a normalised rotated 2D Gaussian kernel. |
|
Generate a spectral-curvature map from a Gaussian random field. |
|
Simulate a hyperspectral image cube from a reference image. |
|
Generate a spectral-index map from image structure and a random field. |
|
Blur an image and map it to base-10 logarithmic scale. |
|
Draw stationary Gaussian fields on an image grid. |
- hyri.interface.sim_hs_img_cube.gauss_2d_func(sig_x, sig_y, theta)#
Return a callable unnormalised rotated 2D Gaussian.
- Parameters:
- Returns:
Function that evaluates the Gaussian on an array of coordinates with shape
(N, 2).- Return type:
Callable[[np.ndarray], np.ndarray]
- hyri.interface.sim_hs_img_cube.gauss_2d_kernel(sig_x, sig_y, theta, kernel_size)#
Generate a normalised rotated 2D Gaussian kernel.
- Parameters:
- Returns:
Normalised Gaussian kernel with shape
(kernel_size, kernel_size).- Return type:
np.ndarray
- hyri.interface.sim_hs_img_cube.stationary_gaussian_process(im_size, rho)#
Draw stationary Gaussian fields on an image grid.
- Parameters:
- Returns:
Two independent Gaussian fields followed by the x and y grid coordinates.
- Return type:
Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]
- Raises:
ValueError – If the circulant embedding has negative eigenvalues below the numerical tolerance.
Note
This implementation follows the block-circulant embedding used in the Faceted-HyperSARA MATLAB code.
- hyri.interface.sim_hs_img_cube.log_blur(img, kernel)#
Blur an image and map it to base-10 logarithmic scale.
- Parameters:
img (np.ndarray) – Two-dimensional reference image.
kernel (np.ndarray) – Convolution kernel.
- Returns:
Log-scaled blurred image.
- Return type:
np.ndarray
- hyri.interface.sim_hs_img_cube.gen_spectral_idx(im_log_blur, gauss_field)#
Generate a spectral-index map from image structure and a random field.
- Parameters:
im_log_blur (np.ndarray) – Log-scaled blurred reference image.
gauss_field (np.ndarray) – Gaussian random field with the same spatial shape as
im_log_blur.
- Returns:
Spectral-index map with weak-region values set to zero.
- Return type:
np.ndarray
- hyri.interface.sim_hs_img_cube.gen_curvature_map(gauss_field, curv_scale)#
Generate a spectral-curvature map from a Gaussian random field.
- Parameters:
gauss_field (np.ndarray) – Gaussian random field.
curv_scale (float) – Maximum absolute curvature scale.
- Returns:
Curvature map with negative outliers clipped to zero.
- Return type:
np.ndarray
- hyri.interface.sim_hs_img_cube.gen_img_cube(img: ndarray, freqs: ndarray, sig_blur: float = 10, sig_gauss_field: float = 10, curv_scale: float = 0.5)#
Simulate a hyperspectral image cube from a reference image.
The cube follows a spatially varying power-law model with curvature,
\[I_\nu = I_{\nu_0} \left(\frac{\nu}{\nu_0}\right)^{ \alpha + \beta \log(\nu / \nu_0) },\]where the first frequency in
freqsis used as the reference frequency \(\nu_0\).- Parameters:
img (np.ndarray) – Two-dimensional reference image.
freqs (np.ndarray) – Frequency samples in Hz.
sig_blur (float, optional) – Standard deviation of the Gaussian kernel used to blur
imgbefore spectral-index generation. Default: 10.sig_gauss_field (float, optional) – Standard deviation of the Gaussian covariance used for the random spectral fields. Default: 10.
curv_scale (float, optional) – Curvature-map amplitude scale. Default: 0.5.
- Returns:
Simulated image cube with frequency as the first axis, spectral-index map, and curvature map.
- Return type:
Tuple[np.ndarray, np.ndarray, np.ndarray]
References
Thouvenin, P.-A., Abdulaziz, A., Dabbech, A., Repetti, A., & Wiaux, Y. (2023). Parallel faceted imaging in radio interferometry via proximal splitting (Faceted HyperSARA): I. Algorithm and simulations. MNRAS, 521(1), 1-19.