rubix.telescope.noise package#

Submodules#

rubix.telescope.noise.noise module#

rubix.telescope.noise.noise.calculate_S2N(datacube: Float[Array, 'n_x n_y n_wave_bins'], observation_signal_to_noise: float) Float[Array, 'n_y n_y'][source]#

Calculate the signal-to-noise ratio array from a data cube.

Adapted from: kateharborne/SimSpin which implements equation 4 from Nanni et al. 2022

Parameters:
  • datacube (jnp.array (n_x, n_y, n_wave_bins)) – The data cube with dimensions (n_x, n_y, n_wave_bins).

  • observation_signal_to_noise (float) – The signal-to-noise ratio of the observation.

Returns:

The signal-to-noise ratio array.

Return type:

jnp.array (n_x, n_y)

rubix.telescope.noise.noise.calculate_noise_cube(cube: Float[Array, 'n_x n_y n_wave_bins'], signal_to_noise: float, noise_distribution='normal') Float[Array, 'n_x n_y n_wave_bins'][source]#

Calculate the noise cube given the cube and the signal-to-noise ratio.

Adapted from: kateharborne/SimSpin

Parameters:
  • cube (jnp.array (n_x, n_y, n_wave_bins)) – The data cube.

  • signal-to-noise (float) – The signal-to-noise ratio of the observation.

  • noise_distribution (str, optional) – The type of distribution to sample from. Can be either “normal” or “uniform”, by default “normal”.

Returns:

The noise cube.

Return type:

jnp.array (n_x, n_y, n_wave_bins)

rubix.telescope.noise.noise.sample_noise(shape, type='normal', key=None)[source]#

Sample noise from a normal or uniform distribution. :param shape: The shape of the noise array. :type shape: tuple :param type: The type of distribution to sample from. Can be either “normal” or “uniform”, by default “normal”. :type type: str, optional :param key: The random key to use for sampling, by default None. :type key: jnp.array, optional

Returns:

The sampled noise.

Return type:

jnp.array

Module contents#