1515
1616
1717def _vzcheck (iphis , snap , vz_thres ):
18- """Detect plates and check with vz and plate size ."""
18+ """Remove positions where vz is below threshold ."""
1919 # verifying vertical velocity
2020 vzabs = np .abs (snap .fields ['v3' ].values [0 , ..., 0 ])
2121 argdel = []
@@ -28,7 +28,20 @@ def _vzcheck(iphis, snap, vz_thres):
2828
2929@lru_cache ()
3030def detect_plates (snap , vz_thres_ratio = 0 ):
31- """Detect plates using derivative of horizontal velocity."""
31+ """Detect plate limits using derivative of horizontal velocity.
32+
33+ This function is cached for convenience.
34+
35+ Args:
36+ snap (:class:`~stagpy._step.Step`): a step of a StagyyData instance.
37+ vz_thres_ratio (float): if above zero, an addition check based on the
38+ vertical velocities is performed. Limits detected above a region
39+ where the vertical velocity is below vz_thres_ratio * mean(vzabs)
40+ are ignored.
41+ Returns:
42+ tuple of :class:`numpy.array`: itrenches, iridges
43+ 1D arrays containing phi-index of detected trenches and ridges.
44+ """
3245 dvphi = _surf_diag (snap , 'dv2' ).values
3346
3447 # finding trenches
@@ -157,7 +170,15 @@ def _continents_location(snap, at_surface=True):
157170
158171
159172def plot_at_surface (snap , names ):
160- """Plot surface diagnostics."""
173+ """Plot surface diagnostics.
174+
175+ Args:
176+ snap (:class:`~stagpy._step.Step`): a step of a StagyyData instance.
177+ names (str): names of requested surface diagnotics. They are separated
178+ by ``-`` (figures), ``.`` (subplots) and ``,`` (same subplot).
179+ Surface diagnotics can be valid surface field names, field names,
180+ or `"dv2"` which is d(vphi)/dphi.
181+ """
161182 for vfig in list_of_vars (names ):
162183 fig , axes = plt .subplots (nrows = len (vfig ), sharex = True ,
163184 figsize = (12 , 2 * len (vfig )))
@@ -246,7 +267,13 @@ def _write_trench_diagnostics(step, vrms_surf, fid):
246267
247268
248269def plot_scalar_field (snap , fieldname ):
249- """Plot scalar field with plate information."""
270+ """Plot scalar field with plate information.
271+
272+ Args:
273+ snap (:class:`~stagpy._step.Step`): a step of a StagyyData instance.
274+ fieldname (str): name of the field that should be decorated with plate
275+ informations.
276+ """
250277 fig , axis , _ , _ = field .plot_scalar (snap , fieldname )
251278
252279 if conf .plates .continents :
0 commit comments