argosim.data_utils module

argosim.data_utils module#

Data uils.

This module contains functions to generate synthetic observations for the Argosim project.

Authors:

Ezequiel Centofanti <ezequiel.centofanti@cea.fr> Samuel Gullin <gullin@ia.forth.gr>

argosim.data_utils.gauss_source(nx=512, ny=512, mu=array([0, 0]), sigma=array([[1., 0.], [0., 1.]]), fwhm_pix=64)[source]#

Gauss source.

Function to generate a 2D Gaussian source.

Parameters:
  • nx (int) – The output image first dimension.

  • ny (int) – The output image second dimension.

  • mu (np.ndarray) – The mean of the Gaussian source in the [-1,1]x[-1,1] range.

  • sigma (np.ndarray) – The covariance matrix of the Gaussian source.

  • fwhm_pix (float) – The FWHM of the Gaussian source in pixels.

Returns:

source – Image of size (nx,ny) containing the 2D Gaussian source.

Return type:

np.ndarray

argosim.data_utils.mu2d(seed=None)[source]#

Mu 2D.

Function to generate a random 2D mean vector in the range [-1,1]x[-1,1].

Parameters:

seed (int) – Optional seed to set

Returns:

mu – The 2D mean vector.

Return type:

np.ndarray

argosim.data_utils.n_source_sky(shape_px, fov, deg_size_list, source_intensity_list, seed=None, norm='none')[source]#

N source sky.

Function to generate a sky image with multiple Gaussian sources at random positions.

Parameters:
  • shape_px (tuple) – The image size in pixels (Nx, Ny).

  • fov (float) – the Image size in degrees. Is used with the first dimension of shape to calculate the source sizes.

  • deg_size_list (list) – The size in degrees of the Gaussian sources.

  • source_intensity_list (list) – The intensity of each Gaussian source in the final image. The sum of all the sources should be equal to 1 to have a normalized image.

  • seed (int) – Optional seed to set

  • norm (str) – The normalization method. Options are ‘none’, ‘flux’ and ‘max’. Default is ‘none’.

Returns:

sky – Image of size (nx,ny) containing the sky model.

Return type:

np.ndarray

argosim.data_utils.random_source(shape, pix_size, seed=None)[source]#

Random source.

Function to generate 2D Gaussian source with random mean and covariance.

Parameters:
  • shape (tuple) – The output image shape.

  • pix_size (float) – The size in pixels of the Gaussian source.

  • seed (int) – Optional seed to set

Returns:

source – Image of size (nx,ny) containing the 2D Gaussian source.

Return type:

np.ndarray

argosim.data_utils.sigma2d(min_var=5, cov_lim=0.5, seed=None)[source]#

Sigma 2D.

Function to generate a random 2D covariance matrix.

Parameters:
  • min_var (float) – The minimum variance of both gaussian components.

  • cov_lim (float) – The limit of the covariance between gaussian components.

  • seed (int) – Optional seed to set.

Returns:

sigma – The 2D covariance matrix.

Return type:

np.ndarray