brazil-data-cube / stmetrics

Time Series Metrics
MIT License
23 stars 7 forks source link

Time Metrics example not working #8

Closed marujore closed 3 years ago

marujore commented 3 years ago

https://stmetrics.readthedocs.io/en/latest/examples/TimeMetrics.html

1.3

1.6 Error


StopIteration Traceback (most recent call last) ~/anaconda3/envs/remotesensing/lib/python3.9/site-packages/xarray/core/concat.py in concat(objs, dim, data_vars, coords, compat, positions, fill_value, join, combine_attrs) 219 try: --> 220 first_obj, objs = utils.peek_at(objs) 221 except StopIteration:

~/anaconda3/envs/remotesensing/lib/python3.9/site-packages/xarray/core/utils.py in peek_at(iterable) 192 gen = iter(iterable) --> 193 peek = next(gen) 194 return peek, itertools.chain([peek], gen)

StopIteration:

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last)

in ----> 1 im_metrics = stmetrics.metrics.sits2metrics(xarray) 2 im_metrics /tower/git_hub/marujore/stmetrics/stmetrics/metrics.py in sits2metrics(dataset, metrics, num_cores) 98 return _sits2metrics(image, metrics, num_cores) 99 elif isinstance(dataset, xarray.Dataset): --> 100 return _compute_from_xarray(dataset, metrics, num_cores) 101 else: 102 print("Sorry we can't read this type of file.\ /tower/git_hub/marujore/stmetrics/stmetrics/metrics.py in _compute_from_xarray(dataset, metrics, num_cores) 167 lista.append(c) 168 --> 169 dataset[key+'_metrics'] = xarray.concat(lista, dim='metric') 170 171 band_list = None ~/anaconda3/envs/remotesensing/lib/python3.9/site-packages/xarray/core/concat.py in concat(objs, dim, data_vars, coords, compat, positions, fill_value, join, combine_attrs) 220 first_obj, objs = utils.peek_at(objs) 221 except StopIteration: --> 222 raise ValueError("must supply at least one object to concatenate") 223 224 if compat not in _VALID_COMPAT: ValueError: must supply at least one object to concatenate