WVOperation

Compute one or more registered WVTransform variables.


Declaration

classdef WVOperation < handle

Overview

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
    • WVOperation create a new WVOperation for computing a new variable
  • Evaluate an operation
  • Inspect dependencies and outputs

Developer Topics

These items document internal implementation details and are not part of the primary public API.

  • Operation internals
    • f function handle to be called when computing the operation
    • nVarOut number of variables returned by the computation


This site uses Just the Docs, a documentation theme for Jekyll.