Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 32 additions & 6 deletions src/eo_processing/utils/catalogue_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import geojson
from typing import TYPE_CHECKING
import pystac_client
import time

if TYPE_CHECKING:
from eo_processing.config.data_formats import openEO_bbox_format
Expand Down Expand Up @@ -217,8 +218,17 @@ def catalogue_check_CDSE_S1(orbit_direction: str, start: str, end: str, bbox: op

# get the dates of all found matches
results = []
for item in search.items_as_dicts():
results.append(item['properties']['datetime'])

for attempt in range(3):
try:
for item in search.items_as_dicts():
results.append(item['properties']['datetime'])
break
except Exception as e:
if attempt < 2:
time.sleep(2 ** attempt) # exponential backoff: 1s, 2s
else:
raise e

# count the number of unique dates on which we have observations (resolved tile overlap)
df = pd.DataFrame(results, columns=['date'])
Expand Down Expand Up @@ -248,8 +258,16 @@ def catalogue_check_CDSE_S1(orbit_direction: str, start: str, end: str, bbox: op

# get the dates of all found matches
results = []
for item in search.items_as_dicts():
results.append(item['properties']['datetime'])
for attempt in range(3):
try:
for item in search.items_as_dicts():
results.append(item['properties']['datetime'])
break
except Exception as e:
if attempt < 2:
time.sleep(2 ** attempt) # exponential backoff: 1s, 2s
else:
raise e

# count the number of unique dates on which we have observations (resolved tile overlap)
df = pd.DataFrame(results, columns=['date'])
Expand Down Expand Up @@ -322,8 +340,16 @@ def catalogue_check_CDSE_S2(start: str, end: str, bbox: openEO_bbox_format,

# get the dates of all found matches
results = []
for item in search.items_as_dicts():
results.append(item['properties']['datetime'])
for attempt in range(3):
try:
for item in search.items_as_dicts():
results.append(item['properties']['datetime'])
break
except Exception as e:
if attempt < 2:
time.sleep(2 ** attempt) # exponential backoff: 1s, 2s
else:
raise e

# count the number of unique dates on which we have observations (resolved tile overlap)
df = pd.DataFrame(results, columns=['date'])
Expand Down
5 changes: 4 additions & 1 deletion src/eo_processing/utils/jobmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,10 @@ def on_job_done(self, job: openeo.BatchJob, row: pd.Series) -> None:
job_metadata = job.describe()

job_dir = self.get_job_dir(job.job_id)
title = os.path.splitext(job_metadata['title'])[0]
#title = os.path.splitext(job_metadata['title'])[0]

title = row["file_prefix"]

file_ext = job_metadata['process']['process_graph']['saveresult1']['arguments']['format'].lower()
metadata_path = self.get_job_metadata_path(job.job_id,title)
job_graph_path = self.get_job_graph_path(job.job_id,title)
Expand Down
Loading