Click or drag to resize
CVVURollingStats Method
Calculate a statistic in a rolling window.

Available since Oasis montaj version: 5.1
License: Available to anyone with an Oasis Montaj license.  

Namespace: Geosoft.Desktop.GXNetX
Assembly: geosoft.desktop.gxnetx (in geosoft.desktop.gxnetx.dll)
Notes
If the input VVs are not REAL, copies are made to temporary REALs for processing. If the window size is even, it is increased by 1 so that the output value is put at the exact center index of the window. Statistics are calculated on the values in a window surrounding the individual data points. By shrinking the window at the ends, one-sided effects can be eliminated. For instance, if the data is linear to begin with, a rolling mean will not alter the original data. However, if the window size is kept constant, then values near the ends tend to be pulled up or down. With shrinking, the window is shrunk so that it always has the same width on both sides of the data point under analysis; at the end points the window width is 1, at the next point in it is 3, and so on, until the full width is reached. The median value is calculated by sorting the valid data in the window, then selecting the middle value. If the number of valid data points is even, then the average of the two central values is returned. The mode value is defined as the value which occurs most frequently in the data. This value may not even exist, or may not be unique. In this implementation, the following algorithm is used: The valid data in the window is sorted in ascending order. The number of occurrences of each data value is tracked, and if it occurs more times than any value, it becomes the modal value. If all values are different, this procedure returns the smallest value. If two or more values each have the same (maximum) number of occurrences, then the smallest of these values is returned.
Syntax
public static void RollingStats(
	CGXNETCore gxNetShared,
	CVV vv_i,
	CVV vv_o,
	int stat,
	int window,
	int shrink
)

Parameters

gxNetShared
Type: GeoEngine.Core.GXNetXCGXNETCore
A shared CGXNETCore
vv_i
Type: GeoEngine.Core.GXNetXCVV
Input VV
vv_o
Type: GeoEngine.Core.GXNetXCVV
Output VV
stat
Type: SystemInt32
<define>ST_INFO</define>
window
Type: SystemInt32
Window size (>0, increased to nearest odd value)
shrink
Type: SystemInt32
Shrink window at ends (1:Yes, 0:No)
See Also