dash.stateVectorVariable.buildMembers

Builds a set of ensemble members for a state vector variable


Syntax



Description

X = obj.buildMembers(dims, subMembers, grid, source, parameters)

Builds ensemble members for a variable given a set of dimensionally-subscripted ensemble members. Attempts to load ensemble members data as efficiently as possible. If gridfile data is pre-loaded, extracts ensemble members from the loaded array. If data is not loaded, attempts to load data for all ensemble members simultaneously. As a last resort, loads data for individual ensemble members from the gridfile.

After data is loaded, reshapes dimensions to split means and sequences. Takes means / weighted means over appropriate dimensions and converts the processed ensemble member to a state vector.


Input Arguments

dims

vector, linear indices [nEnsDims]
The dimension indices for the variable that correspond to the columns of subMembers.

subMembers

matrix, linear indices [nInitial x nEnsDims]
A set of dimensionally-subscripted ensemble members for the variable.

grid

scalar gridfile object
The gridfile object for the variable

source

scalar struct
Data source parameters for the gridfile. Output from stateVector.buildEnsemble/gridSources.

.isloaded (scalar logical): Whether all the data for the variable is loaded

.data (numeric array | []): Loaded data for the variable

.limits (matrix, positive integers [nDims x 2]): The index limits of the loaded data within the overall gridfile.

.dataSources (cell vector [nBuilt]): Successfully built dataSource objects for the gridfile

.indices (vector, linear indices [nBuilt]): The indices of the built dataSource objects within the full set of gridfile sources

parameters

scalar struct
Build-parameters for the variable. Created in stateVector.buildEnsemble

.rawSize (vector, positive integers): The size of a raw ensemble member. This is the size of the ensemble member before any means are taken. Mean and sequence elements are separated from one another.

.meanDims (vector, linear index): The index of the dimension containing mean elements in the raw ensemble member. (Because mean and sequence elements are separated from one another, variable dimensions may actually span 2 dimensions of the loaded ensemble member).

.nState (scalar positive integer): The number of state vector elements in the final ensemble member

.indexLimits (cell vector [nVariables] {index limits [nDims x 2]}): The index limits along each gridfile dimension required to load all ensemble members for a variable.

.loadAllMembers (logical vector [nVariables]): Whether each variable has the data sources necessary to load all members at once. Note that this does not guarantee that a variable actually will load all members at once, only that a variable should attempt the load.

.whichSet (scalar, linear index): The index of the coupling set to which the variable belongs

.dims (vector, linear indices [nDimensions]): The indices of the ensemble dimensions in the variable

precision

single’ | ‘double
The numerical precision of the output data array

Output Arguments

X

numeric matrix
The loaded data array