I've ingested some landsat 5 images into a database using the open data cube. The problem is that when I try to run the continous change detection function following the jupyter notebook I get a TypeError: tuple indices must be integers or slices, not str.
%time ccd_product = ccd.process_xarray(landsat_dataset, distributed = True) #Run process xarray on large dataset
---------------------------------------------------------------------------
RemoteTraceback Traceback (most recent call last)
RemoteTraceback:
"""
Traceback (most recent call last):
File "C:\envs\Toronto_ODC\lib\multiprocessing\pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "C:\envs\Toronto_ODC\data_cube_notebooks\utils\data_cube_utilities\dc_ccd.py", line 363, in _ccd_product_from_pixel
ccd_product = _convert_ccd_results_into_dataset(results=ccd_results, model_dataset=pixel)
File "C:\envs\Toronto_ODC\data_cube_notebooks\utils\data_cube_utilities\dc_ccd.py", line 110, in _convert_ccd_results_into_dataset
start_times = [datetime.fromordinal(model['start_day']) for model in results['change_models']]
File "C:\envs\Toronto_ODC\data_cube_notebooks\utils\data_cube_utilities\dc_ccd.py", line 110, in <listcomp>
start_times = [datetime.fromordinal(model['start_day']) for model in results['change_models']]
TypeError: tuple indices must be integers or slices, not str
"""
The above exception was the direct cause of the following exception:
TypeError Traceback (most recent call last)
<timed exec> in <module>
C:\envs\Toronto_ODC\data_cube_notebooks\utils\data_cube_utilities\dc_ccd.py in process_xarray(ds, distributed, process)
459 }
460
--> 461 return processing_options[process]()
462
463
C:\envs\Toronto_ODC\data_cube_notebooks\utils\data_cube_utilities\dc_ccd.py in change_count()
447 return _generate_change_matrix(ds, distributed = distributed)
448 def change_count():
--> 449 return (generate_matrix().sum(dim='time') - 1).rename('change_volume')
450 def first_change():
451 return _nth_occurence_in_ccd_matrix(generate_matrix(),
C:\envs\Toronto_ODC\data_cube_notebooks\utils\data_cube_utilities\dc_ccd.py in generate_matrix()
445 ### Declare several processing outputs.
446 def generate_matrix():
--> 447 return _generate_change_matrix(ds, distributed = distributed)
448 def change_count():
449 return (generate_matrix().sum(dim='time') - 1).rename('change_volume')
C:\envs\Toronto_ODC\data_cube_notebooks\utils\data_cube_utilities\dc_ccd.py in _func(*params, **kwargs)
273 logging.getLogger("ccd").setLevel(logging.WARNING)
274 logging.getLogger("lcmap-pyccd").setLevel(logging.WARNING)
--> 275 result = function(*params, **kwargs)
276 return result
277
C:\envs\Toronto_ODC\data_cube_notebooks\utils\data_cube_utilities\dc_ccd.py in _generate_change_matrix(ds, distributed)
435 ccd_products = _ccd_product_iterator_from_pixels(pixels, distributed=distributed)
436 ccd_products = filter(partial(is_not, None), ccd_products)
--> 437 ccd_change_count_xarray = _rebuild_xarray_from_pixels(ccd_products) # Change matrix
438 return ccd_change_count_xarray
439
C:\envs\Toronto_ODC\data_cube_notebooks\utils\data_cube_utilities\dc_ccd.py in _rebuild_xarray_from_pixels(pixels)
408
409 """
--> 410 return reduce(lambda x, y: x.combine_first(y), pixels)
411
412
C:\envs\Toronto_ODC\lib\multiprocessing\pool.py in next(self, timeout)
729 if success:
730 return value
--> 731 raise value
732
733 __next__ = next # XXX
TypeError: tuple indices must be integers or slices, not str
I thought it might be one of my package issue within python but I've gone through and checked them.
I can load the images and makes rgb from my landsat_dataset so I know that I'm at least on the right track.
Any suggestions on how I can fix this error?