Hey,
I would like to use the function .ard_normalized_radar_backscatter()
to process Sentinel-1 data over a relatively small catchment (100 km^2) over several years. To not have to large batch jobs, I split up the job per half year. Although my job does run for the year 2015, it fails in the first half of 2016. The job that failed has following job-id: vito-j-d7c5e0dbd1324640acfdcdb01ee43989
The code used is visualised below
connection = openeo.connect("openeo.cloud").authenticate_oidc()
shape_zwalm = gpd.read_file('data/Zwalm_shape/zwalm_shapefile_emma.shp')
shape_zwalm.plot()
extent = shape_zwalm.total_bounds
print(extent) #I include the output of this function below for clarity
[ 3.66751526 50.76325563 3.83821038 50.90341411]
temporal_extent = ["2015-06-07", "2022-11-05"]
list_temp_extent = []
job_title_list = []
job_title = "s1_a_gamma0_2015"
job_title_list.append(job_title)
list_temp_extent.append([temporal_extent[0],"2015-12-31"])
years = np.arange(2016,2023)
for year in np.arange(2016,2023):
if year == 2022:
#print([str(year)+"-01-01",temporal_extent[1]])
list_temp_extent.append([str(year)+"-01-01",str(year)+ "-06-30"])
job_title = "s1_a_gamma0_2022_I"
job_title_list.append(job_title)
list_temp_extent.append([str(year)+"-07-01",temporal_extent[1]])
job_title = "s1_a_gamma0_2022_II"
job_title_list.append(job_title)
else:
#print([str(year)+"-01-01",str(year)+ "-12-31"])
list_temp_extent.append([str(year)+"-01-01",str(year)+ "-06-30"])
job_title = "s1_a_gamma0" + str(year) + "_I"
job_title_list.append(job_title)
list_temp_extent.append([str(year)+"-07-01",str(year) + "-12-31"])
job_title = "s1_a_gamma0" + str(year) + "_II"
job_title_list.append(job_title)
print(list_temp_extent)
print(job_title_list)
collection = 'SENTINEL1_GRD' #Ground Range Detected #Ground Range Detected
spatial_extent = {'west':extent[0],'east':extent[2],'south':extent[1],'north':extent[3]}
bands = ["VV"]#enkel in deze geïnteresseerd
properties = {
"sat:orbit_state": lambda od: od == "ASCENDING", ##filter on ascending vs descending
"sar:instrument_mode":lambda mode: mode == "IW" ## Orbit direction filtering
}
job_id_list = []
if job_exec:
for i, temporal_extent in enumerate(list_temp_extent):
s1a = connection.load_collection(
collection_id = collection,
spatial_extent= spatial_extent,
temporal_extent = temporal_extent,
bands = bands,
properties= properties
)
s1a = s1a.ard_normalized_radar_backscatter(elevation_model = "COPERNICUS_30")
s1a = s1a.mask_polygon(shape_zwalm['geometry'].values[0])
# job_title = "s1_a_gamm0" + str(years[i])
# job_title_list.append(job_title)
job_s1a = s1a.create_job(title = job_title_list[i], out_format= 'NetCDF')
job_s1a_id = job_s1a.job_id
if job_s1a_id:
print("Batch job created with id: ",job_s1a_id)
job_s1a.start_and_wait()
job_id_list.append(job_s1a_id)
else:
print("Error! Job ID is None")
Is there a mistake in my code, or do I simply exceed my allowed processing time with the Early adopter package (90 days) I have?
Update: I used .start_and_wait()
instead of .start_job()
because with the latter method, I surpass my allowance on request from SentinelHub backend.
Kind regards
Olivier Bonte