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: :pytobac.segmentation.segmentation
.
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_overview
). 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).
The target
parameter works similarly to how it works in feature detection (see threshold_detection_parameters
). To segment areas that are greater than threshold
, use target='maximum'
. To segment areas that are less than threshold
, use target='minimum'
.
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.
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.
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
.