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 (Float[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:

Float[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: str = '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 (Float[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”. Defaults to “normal”.

Returns:

The noise cube.

Return type:

Float[Array, “n_x n_y n_wave_bins”]

rubix.telescope.noise.noise.sample_noise(shape: tuple, type: str = 'normal', key: Array | None = None) Array[source]#

Sample noise from a normal or uniform distribution.

Parameters:
  • shape (tuple) – The shape of the noise array.

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

  • key (Optional[jnp.ndarray], optional) – The random key to use for sampling. Defaults to None.

Returns:

The sampled noise.

Return type:

jnp.ndarray

Raises:

ValueError – If an unsupported noise distribution is requested.

Module contents#