The Stagger Operation
Class: kwave.toolbox.FourierCollocation Package: kwave.toolbox
Shifts the input function in space, either by Fourier methods, or by linear interpolation.
Syntax
f = stagger(obj, f)
fStg = stagger(obj, f, Staggering='forward', Type='Fourier')
Description
Calculates the staggered function of a scalar field in 1D, 2D, or 3D using a Fourier method, staggering in each grid spacing individually.
The vector components of the staggered field are stacked in the 4th dimension of the output. Staggering only in one dimension each. For example, if calling stagger on a matrix of dimensions (10, 10), the output will be of size (10, 10, 1, 2). This is to allow codes to implement multi-dimensional support by always looping over the fourth dimension.
The stagger operations are defined on the padded grid. Thus, the inputs to this function must also be defined on the padded grid. The output can be returned on a spatially staggered grid by setting the optional Staggering argument.
Input Arguments
f- (numeric) Scalar field to compute gradient of.
Name-Value Arguments
Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.
Staggering- ('forward', 'backward') Option to return the output staggered by half a grid point in the specified direction. Default = 'forward'.Type- ('fourier', 'linInterpolate')
Output Arguments
f- (numeric) f but staggered in each coordinate direction.