@@ -131,8 +131,8 @@ def vario_estimate(
131131 same points, with the same statistical properties.
132132 bin_edges : :class:`numpy.ndarray`, optional
133133 the bins on which the variogram will be calculated.
134- If :any:`None` are given, standard bins provided by the :any:`standard_bins`
135- routine will be used. Default: :any:`None`
134+ If :any:`None` are given, standard bins provided by the
135+ :any:`standard_bins` routine will be used. Default: :any:`None`
136136 sampling_size : :class:`int` or :any:`None`, optional
137137 for large input data, this method can take a long
138138 time to compute the variogram, therefore this argument specifies
@@ -217,11 +217,18 @@ def vario_estimate(
217217
218218 Returns
219219 -------
220- :class:`tuple` of :class:`numpy.ndarray`
221- 1. the bin centers
222- 2. the estimated variogram values at bin centers
223- 3. (optional) the number of points found at each bin center
224- (see argument return_counts)
220+ bin_center : (n), :class:`numpy.ndarray`
221+ The bin centers.
222+ gamma : (n) or (d, n), :class:`numpy.ndarray`
223+ The estimated variogram values at bin centers.
224+ Is stacked if multiple `directions` (d>1) are given.
225+ counts : (n) or (d, n), :class:`numpy.ndarray`, optional
226+ The number of point pairs found for each bin.
227+ Is stacked if multiple `directions` (d>1) are given.
228+ Only provided if `return_counts` is True.
229+ normalizer : :any:`Normalizer`, optional
230+ The fitted normalizer for the given data.
231+ Only provided if `fit_normalizer` is True.
225232
226233 Notes
227234 -----
@@ -321,12 +328,14 @@ def vario_estimate(
321328 bin_edges = standard_bins (pos , dim , latlon )
322329 bin_centres = (bin_edges [:- 1 ] + bin_edges [1 :]) / 2.0
323330 # normalize field
324- field = remove_trend_norm_mean (
331+ norm_field_out = remove_trend_norm_mean (
325332 * (pos , field , mean , normalizer , trend ),
326333 check_shape = False ,
327334 stacked = True ,
328335 fit_normalizer = fit_normalizer ,
329336 )
337+ field = norm_field_out [0 ] if fit_normalizer else norm_field_out
338+ norm_out = (norm_field_out [1 ],) if fit_normalizer else ()
330339 # select variogram estimator
331340 cython_estimator = _set_estimator (estimator )
332341 # run
@@ -355,9 +364,8 @@ def vario_estimate(
355364 )
356365 if dir_no == 1 :
357366 estimates , counts = estimates [0 ], counts [0 ]
358- if return_counts :
359- return bin_centres , estimates , counts
360- return bin_centres , estimates
367+ est_out = (estimates , counts )
368+ return (bin_centres ,) + est_out [: 2 if return_counts else 1 ] + norm_out
361369
362370
363371def vario_estimate_axis (
0 commit comments