credit.ensemble.utils#

Functions#

add_spatially_correlated_noise(x[, correlation_scale])

Add spatially correlated Gaussian noise using a convolutional filter.

hemispheric_rescale(perturbation, latitudes[, ...])

Linearly interpolate scaling in the tropics between 20S and 20N.

Module Contents#

credit.ensemble.utils.add_spatially_correlated_noise(x, correlation_scale=10)#

Add spatially correlated Gaussian noise using a convolutional filter.

Applies correlated noise independently at each time step.

Parameters:
  • x (torch.Tensor) – Input tensor of shape (B, C, T, H, W).

  • correlation_scale (float) – Standard deviation of the Gaussian kernel in pixels.

Returns:

Tensor of the same shape as input with added spatially

correlated noise.

Return type:

torch.Tensor

credit.ensemble.utils.hemispheric_rescale(perturbation, latitudes, north_scale=1.0, south_scale=1.0)#

Linearly interpolate scaling in the tropics between 20S and 20N.

Parameters:

latitudes (torch.Tensor) – Tensor of shape (H,) with latitude values ranging from +90 to -90.