NEDAS.utils.random_perturb module

NEDAS.utils.random_perturb.random_field_gaussian(nx, ny, amp, hcorr)[source]

Random field with a Gaussian spectrum.

Parameters:
  • nx (int) – Number of grid points in x direction.

  • ny (int) – Number of grid points in y direction.

  • amp (float) – Amplitude (standard deviation) of the random field.

  • hcorr (float) – Horizontal decorrelation length (number of grid points).

Returns:

The output random field with shape (ny, nx).

Return type:

np.ndarray

NEDAS.utils.random_perturb.gaussian(k, sig)[source]

gaussian spectrum

NEDAS.utils.random_perturb.get_sig_in_gaussian(nx, ny, hcorr)[source]

Derive the sig parameter in gaussian spectrum. Called by random_field_gaussian, cached the result since in external for loop there will be fixed input

NEDAS.utils.random_perturb.random_field_powerlaw(nx, ny, amp, pwrlaw)[source]
NEDAS.utils.random_perturb.random_displacement(grid, mask, amp, hcorr)[source]
NEDAS.utils.random_perturb.get_velocity_from_press(grid, pres, scale_wind=False, press_amp=None, press_hcorr=None, wind_amp=None)[source]

derive wind velocity from pressure field