xesn.utils.get_samples

Contents

xesn.utils.get_samples#

xesn.utils.get_samples(xda, n_samples, n_steps, n_spinup, random_seed=None, sample_indices=None)#

Pull random samples from macro_training or test dataset

Parameters:
  • xda (xarray.DataArray) – with the full chunk of data to pull samples from

  • n_samples (int) – number of samples to grab

  • n_steps (int) – number of steps to make in sample prediction

  • n_spinup (int) – number of spinup steps before prediction

  • random_seed (int, optional) – RNG seed for grabbing temporal indices of random samples

  • samples_indices (list, optional) – the temporal indices denoting the start of the prediction period (including spinup), if provided then do not get a random sample of indices first

Returns:
  • samples (list of xarray.DataArray) – with each separate sample trajectory

  • sample_indices (list of int) – with the initial conditions for the start of prediction phase, not the start of spinup