WVOperation
Compute one or more registered WVTransform variables.
Declaration
classdef WVOperation < handleOverview
A WVOperation adds computed variables to a WVTransform by
defining one or more variables and creating an operation for computing
those variables.
If the operation is simple and can be computed in one line, you can directly instantiate the WVOperation class and pass a function handle. For example,
outputVar = WVVariableAnnotation('zeta_z',{'x','y','z'},'s-1', 'vertical component of relative vorticity');
f = @(wvt) wvt.diffX(wvt.v) - wvt.diffY(wvt.u);
wvt.addOperation(WVOperation('zeta_z',outputVar,f));
will enable direct calls to wvt.zeta_z to compute the vertical
vorticity.
A WVOperation that computes a single variable must have the
same name as the variable, as specified in WVVariableAnnotation.
More involved calculations may require subclassing WVOperation and
overriding the compute method. Note that every variable returned by the
compute operation must be described with a WVVariableAnnotation.
Topics
- Create operations and annotations
WVOperationcreate a new WVOperation for computing a new variable
- Evaluate an operation
computethe promised variable
- Inspect dependencies and outputs
detailedDescriptionnameof the operationoutputVariablesarray of WVVariableAnnotations describing the outputs of the computation
Developer Topics
These items document internal implementation details and are not part of the primary public API.
- Operation internals