ensemble.load

Load the used variables and members of a saved ensemble


Syntax



Description

[X, metadata] = obj.load

Loads a saved ensemble into memory. Only loads the variables and ensemble members being used by the ensemble object. By default, the ensemble object uses all variables and ensemble members saved in the .ens file. Use the “useVariables”, “useMembers”, and “evolving” commands to instead load a subset of the saved variables and ensemble members.

If the ensemble object implements a static ensemble, then the first output is a matrix with one row per state vector element, and one column per ensemble member. The second output is a scalar ensembleMetadata object that holds the metadata for this ensemble.

If the ensemble object implements an evolving ensemble, then the first output is a 3D array. The third dimension holds the different ensembles in the evolving set. The second output is a vector of ensembleMetadata objects, each holding the metadata for a particular ensemble in the evolving set.

[X, metadata] = obj.load(labels)
[X, metadata] = obj.load(e)
[X, metadata] = obj.load(-1)

Loads specific ensembles in the evolving set. The first output will be a 3D matrix and the length of the third dimension will match the number of requested ensembles. The second output will be a vector with one ensembleMetadata object per requested ensemble. If the input is -1, selects all ensembles in the evolving set.


Input Arguments

e

-1 | vector, linear indices | logical vector
Indicates the ensembles to load. If -1, loads all ensembles in the evolving set. If a logical vector, must have one element per ensemble in the evolving set. Otherwise, use the linear indices of ensembles in the evolving set.

labels

string vector
The labels of specific ensembles in the evolving set. You can only use labels to reference ensembles that have unique labels. Use linear indices to reference ensembles that share the same label.

Output Arguments

X

numeric array, [nState x nMembers x nEvolving]
The loaded ensemble. Each row is a particular element along the state vector, and each column is an ensemble member. The third dimension holds different ensembles in an evolving set. The loaded ensembles will only include variables and ensemble members that are being used by the ensemble object.

metadata

ensembleMetadata vector [nEnsembles]
Metadata for the loaded ensemble(s). Each element corresponds to the metadata for the associated ensembles along the third dimension of the first output.