Metrics module¶
Module for computing metrics
-
stmetrics.metrics.
get_metrics
(series, metrics_dict={'basics': ['all'], 'fractal': ['all'], 'polar': ['all']}, nodata=-9999, show=False)¶ This function performs the computation of the basic, polar and fractal metrics available in the stmetrics package.
Parameters: - timeseries (numpy.ndarray) – Time series.
- metrics_dict (dictionary) – Dictionary with metrics to be computed.
- nodata (int) – nodata of the time series. Default is -9999.
Returns time_metrics: Dicitionary of metrics.
-
stmetrics.metrics.
sits2metrics
(dataset, metrics={'basics': ['all'], 'fractal': ['all'], 'polar': ['all']}, num_cores=-1)¶ This function performs the computation of the metrics using multiprocessing.
Parameters: - dataset (rasterio dataset, numpy array (ZxMxN) - Z is the time series lenght or xarray.Dataset) – Time series.
- metrics_dict (dictionary) – Dictionary with metrics to be computed.
- num_cores (integer) – Number of cores to be used. Value -1 means all cores available.
Returns image: Numpy matrix of metrics or xarray.Dataset with the metrics as an dataset. The orders of the dimensions, follows the dictionary provided.