Watershedding Segmentation Parameters
Appropriate parameters must be chosen to properly use the watershedding segmentation module in tobac. This page gives a brief overview of parameters available in watershedding segmentation.
A full list of parameters and descriptions can be found in the API Reference: tobac.segmentation.segmentation()
.
Basic Operating Procedure
The tobac watershedding segmentation algorithm selects regions of the data field
with values greater than threshold
and associates those regions with the features features
detected by feature detection (see Feature Detection Basics). This algorithm uses a watershedding approach, which sets the individual features as initial seed points, and then has identified regions grow from those original seed points. For further information on watershedding segmentation, see the scikit-image documentation <https://scikit-image.org/docs/stable/auto_examples/segmentation/plot_watershed.html>.
Note that you can run the watershedding segmentation algorithm on any variable that shares a grid with the variable detected in the feature detection step. It is not required that the variable used in feature detection be the same as the one in segmentation (e.g., you can detect updraft features and then run segmentation on total condensate).
Segmentation can be run on 2D or 3D input data, but segmentation on 3D data using a 2D feature detection field requires careful consideration of where the vertical seeding will occur (see Level).
Target
The target
parameter works similarly to how it works in feature detection (see Threshold Feature Detection Parameters). To segment areas that are greater than threshold
, use target='maximum'
. To segment areas that are less than threshold
, use target='minimum'
.
Threshold
Unlike in multiple threshold detection in Feature Detection, Watershedding Segmentation only accepts one threshold. This value will set either the minimum (for target='maximum'
) or maximum (for target='minimum'
) value to be segmented. Note that the segmentation is not inclusive of the threshold value, meaning that only values greater than (for target='maximum'
) or smaller than (for target='minimum'
) the threshold are included in the segmented region.
Where the 3D seeds are placed for 2D feature detection
When running feature detection on a 2D dataset and then using these detected features to segment data in 3D, there is clearly no information on where to put the seeds in the vertical. This is currently controlled by the level
parameter. By default, this parameter is None
, which seeds the full column at every 2D detected feature point. As tobac does not run a continuity check, this can result in undesired behavior, such as clouds in multiple layers being detected as one large object.
level
can also be set to a slice <https://docs.python.org/3/c-api/slice.html>, which determines where in the vertical dimension (see `Vertical Coordinate`_) the features are seeded from. Note that level
operates in array coordinates rather than physical coordinates.
Maximum Distance
tobac’s watershedding segmentation allows you to set a maximum distance away from the feature to classify as a segmented region belonging to that figure. max_distance
sets this distance in meters away from the detected feature to allow it to be considered part of the point. To turn this feature off, set max_distance=None
.