pysteps.utils.cleansing.decluster(coord, input_array, scale, min_samples=1, verbose=False)#

Decluster a set of sparse data points by aggregating, that is, taking the median value of all values lying within a certain distance (i.e., a cluster).

  • coord (array_like) – Array of shape (n, d) containing the coordinates of the input data into a space of d dimensions.

  • input_array (array_like) – Array of shape (n) or (n, m), where n is the number of samples and m the number of variables. All values in input_array are required to have finite values.

  • scale (float or array_like) – The scale parameter in the same units of coord. It can be a scalar or an array_like of shape (d). Data points within the declustering scale are aggregated.

  • min_samples (int, optional) – The minimum number of samples for computing the median within a given cluster.

  • verbose (bool, optional) – Print out information.


out – A two-element tuple (out_coord, output_array) containing the declustered coordinates (l, d) and input array (l, m), where l is the new number of samples with l <= n.

Return type

tuple of ndarrays