Skip to content

Commit

Permalink
Merge pull request #134 from betonr/master
Browse files Browse the repository at this point in the history
fix code -  when noscenes in tile/period
  • Loading branch information
betonr authored Apr 15, 2021
2 parents 6eca05b + 5ce35f6 commit 9c11f1b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cube_builder_aws/cube_builder_aws/maestro.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,13 @@ def prepare_merge(self, datacube, irregular_datacube, datasets, satellite, bands
# Evaluate the number of dates, the number of scenes for each date and
# the total amount merges that will be done
number_of_datasets_dates = 0
first_band = list(self.score['items'][tile_name]['periods'][periodkey]['scenes'].keys())[0]
activity['list_dates'] = []
for dataset in self.score['items'][tile_name]['periods'][periodkey]['scenes'][first_band].keys():
for date in self.score['items'][tile_name]['periods'][periodkey]['scenes'][first_band][dataset].keys():
activity['list_dates'].append(date)
number_of_datasets_dates += 1
if len(self.score['items'][tile_name]['periods'][periodkey]['scenes'].keys()):
first_band = list(self.score['items'][tile_name]['periods'][periodkey]['scenes'].keys())[0]
activity['list_dates'] = []
for dataset in self.score['items'][tile_name]['periods'][periodkey]['scenes'][first_band].keys():
for date in self.score['items'][tile_name]['periods'][periodkey]['scenes'][first_band][dataset].keys():
activity['list_dates'].append(date)
number_of_datasets_dates += 1

activity['instancesToBeDone'] = number_of_datasets_dates
activity['totalInstancesToBeDone'] = number_of_datasets_dates * len(activity['bands'])
Expand Down

0 comments on commit 9c11f1b

Please sign in to comment.