You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Use watershedding to determine region above a threshold
1132
-
value around initial seeding position for all time steps of
1133
-
the input data. Works both in 2D (based on single seeding
1134
-
point) and 3D and returns a mask with zeros everywhere around
1135
-
the identified regions and the feature id inside the regions.
1136
-
1137
-
Calls segmentation_timestep at each individal timestep of the
1138
-
input data.
1139
-
1140
-
Parameters
1141
-
----------
1142
-
features : pandas.DataFrame
1143
-
Output from trackpy/maketrack.
1144
-
1145
-
field : iris.cube.Cube
1146
-
Containing the field to perform the watershedding on.
1147
-
1148
-
dxy : float
1149
-
Grid spacing of the input data.
1150
-
1151
-
statistic : dict, optional
1152
-
Default is None. Optional parameter to calculate bulk statistics within feature detection.
1153
-
Dictionary with callable function(s) to apply over the region of each detected feature and the name of the statistics to appear in the feature output dataframe. The functions should be the values and the names of the metric the keys (e.g. {'mean': np.mean})
1154
-
1155
-
boolean, optional
1156
-
Default is False. If True, bulk statistics for the data points assigned to each feature are saved in output.
1157
-
1158
-
Output:
1159
-
segmentation_out: iris.cube.Cube
1160
-
Cloud mask, 0 outside and integer numbers according to track inside the cloud
1161
-
=======
1162
-
threshold : float, optional
1163
-
Threshold for the watershedding field to be used for the mask. The watershedding is exclusive of the threshold value, i.e. values greater (less) than the threshold are included in the target region, while values equal to the threshold value are excluded.
1164
-
Default is 3e-3.
1165
-
1166
-
target : {'maximum', 'minimum'}, optional
1167
-
Flag to determine if tracking is targetting minima or maxima in
1168
-
the data. Default is 'maximum'.
1169
-
1170
-
level : slice of iris.cube.Cube, optional
1171
-
Levels at which to seed the cells for the watershedding
1172
-
algorithm. Default is None.
1173
-
1174
-
method : {'watershed'}, optional
1175
-
Flag determining the algorithm to use (currently watershedding
1176
-
implemented). 'random_walk' could be uncommented.
1177
-
1178
-
max_distance : float, optional
1179
-
Maximum distance from a marker allowed to be classified as
Name of the vertical coordinate for use in 3D segmentation case
1178
+
1179
+
PBC_flag : {'none', 'hdim_1', 'hdim_2', 'both'}
1180
+
Sets whether to use periodic boundaries, and if so in which directions.
1181
+
'none' means that we do not have periodic boundaries
1182
+
'hdim_1' means that we are periodic along hdim1
1183
+
'hdim_2' means that we are periodic along hdim2
1184
+
'both' means that we are periodic along both horizontal dimensions
1185
+
1186
+
seed_3D_flag: str('column', 'box')
1187
+
Seed 3D field at feature positions with either the full column (default)
1188
+
or a box of user-set size
1189
+
1190
+
seed_3D_size: int or tuple (dimensions equal to dimensions of `field`)
1191
+
This sets the size of the seed box when `seed_3D_flag` is 'box'. If it's an
1192
+
integer (units of number of pixels), the seed box is identical in all dimensions.
1193
+
If it's a tuple, it specifies the seed area for each dimension separately, in units of pixels.
1194
+
Note: we strongly recommend the use of odd numbers for this. If you give
1195
+
an even number, your seed box will be biased and not centered
1196
+
around the feature.
1197
+
Note: if two seed boxes overlap, the feature that is seeded will be the
1198
+
closer feature.
1199
+
segment_number_below_threshold: int
1200
+
the marker to use to indicate a segmentation point is below the threshold.
1201
+
segment_number_unassigned: int
1202
+
the marker to use to indicate a segmentation point is above the threshold but unsegmented.
1203
+
statistic : dict, optional
1204
+
Default is None. Optional parameter to calculate bulk statistics within feature detection.
1205
+
Dictionary with callable function(s) to apply over the region of each detected feature and the name of the statistics to appear in the feature output dataframe. The functions should be the values and the names of the metric the keys (e.g. {'mean': np.mean})
1206
+
1207
+
1208
+
Returns
1209
+
-------
1210
+
segmentation_out : iris.cube.Cube
1211
+
Mask, 0 outside and integer numbers according to track
1212
+
inside the area/volume of the feature.
1213
+
1214
+
features_out : pandas.DataFrame
1215
+
Feature dataframe including the number of cells (2D or 3D) in
1216
+
the segmented area/volume of the feature at the timestep.
1217
+
1218
+
Raises
1219
+
------
1220
+
ValueError
1221
+
If field_in.ndim is neither 3 nor 4 and 'time' is not included
0 commit comments