Arrays, Batching, and Aggregation
GoPxL supports data structures called arrays to help simplify otherwise complicated applications.
An array is a group of data items bundled into a single structure, such as multiple profiles or surfaces, multiple measurements, or multiple features. Each item, or element, in the array can be processed by other tools in one of two ways:
-
Batching: Tools in batching mode process each array element separately. For more information, see Batching.
-
Aggregating: Aggregating tools combine each element in the array and process it as a single piece of data. For more information, see Aggregating.
Most tools support the batching of array elements. Some tools support both batching and aggregating.
Array data can come from various sources:
-
Outputs from tools like Surface Blob, Surface Segmentation, and Surface Pattern Matching. For more information, see Arrays from Multi-instance Tools.
-
G5 (single- and multi-sensor) multi-layer output. For more information, see Arrays from Multi-layer Output.
-
G2 multi-sensor output. For more information, see G2 Multi-sensor Output.
-
The Array Create tool. For more information, see Array Create.
Arrays from Multi-instance Tools
The Surface Blob, Surface Segmentation, and Surface Pattern Matching tools can identify occurrences of features or parts in scan data. When you check Enable Array Output in the tool's Parameters section, the tool outputs an array containing the occurrences. Otherwise, the tools produce a separate output for each identified feature or part. In the following, a Surface Blob tool has identified five blobs in scan data.
Surface Blob tool identifying blobs in scan data.
When Enable Array Output is checked, the Surface Blob tool outputs an array containing all of the blobs it identifies. An array containing the blobs identified above could be represented in the following way.
Other tools can then take this array as input. For more information, see Batching or Aggregating.
Arrays from Multi-layer Output
When configured for multi-layer scanning, G5 sensors can scan translucent or transparent targets and return a profile or a surface representing each layer. By default, these profiles are output as an array. (Note that you can optionally have GoPxL output the profiles individually by enabling Separate Layer Outputs.)
The following illustration is a representation of multilayer Profile scan data from a G5 sensor, showing four profiles.
The structure of an array containing these profiles could be represented as follows:
Other tools can then take this array as input. For more information, see Batching or Aggregating.
G2 Multi-sensor Output
In G2 multi-sensor systems where sensors are in a top-bottom layout, Profile and Surface data can optionally be output as an array, where top data (from one or more sensors) is one array element, and bottom data (from one or more sensors) is another array element.
Other tools can then take this array as input. For more information, see Batching or Aggregating.
Batching
When a tool is in batching mode, it takes an array as input and processes each item in the input array individually. A tool in batching mode also outputs one or more arrays (such as measurements, Profile or Surface data, geometric features, and so on), where each element of the output arrays corresponds to an element in the input array.
When a tool is in batching mode, there is no limit to the number of elements in the input array (other than any CPU limitations).
Batching is enabled explicitly in tools, by checking the Enable Batching parameter in the tool's Input section.
In the Tools Diagram, you can also hover over a tool's block and click the Batching icon ().
Batching mode is indicated by square bracket ("[]") overlays in the tool list and in the Tools Diagram.
The following shows the Surface Bounding Box tool in batching mode. The tool calculates the bounding box for each element in the input array, and returns the enabled measurements as arrays.
Hovering over batched outputs in the Tools Diagram or in the Tools Configuration panel displays a list of the elements in the array.
When at least one result in the array is a fail, the output is considered a fail and the "Array[n]" label is red. Otherwise, it's green. Outputs within the pop-up list are displayed in green or red, depending on whether they represent pass or fail.
Aggregating
Some tools can take arrays as an input and combine (or "aggregate") the data in the array elements and treat it as a single input (see below for an example). These tools are called "aggregating tools"; see Aggregating Tools for a list of the aggregating tools. In order for a tool to aggregate an array input, its Enable Batching parameter must be disabled. Otherwise, it will process the array elements individually. Note that aggregating tools also take non-array input (such as a single scan of Profile or Surface data), and simply process the data as usual.
Some aggregating tools are limited to a maximum of a 2-element array in their input. Other tools can accept an arbitrary number. See Aggregating Tools to determine the limits of a tool. Note that when a tool is in batching mode, there is no limit to the number of elements in the input array (other than any CPU limitations), regardless of the array size limitations when the tools is aggregating data.
Remember to uncheck Enable Batching if you want a tool to aggregate array inputs. |
Taking the example from above, if batching in the Surface Bounding Box tool is disabled, it will aggregate the scan data in the input array, and fit the bounding around the scan data of all the elements together.
As with other tools, you set a measurement's Min and Max values to produce pass/fail results.