Hi,
We have Python script and sometime we are getting 504 error, we could not identify any pattern for this issue.
Is there any limitation we should know about ?
code snippet below:
def get_sentinel1_data(dates_df,poly_path,poly_name,res):
'''https://docs.sentinel-hub.com/api/latest/data/sentinel-1-grd/
polygons should be in UTM'''
poly,EPSG_code,sd,ed = get_metadata_for_each_polygon(poly_path,poly_name,dates_df)
evalscript = """
//VERSION=3
function setup() {
return {
input: [{bands: ["VV","VH","dataMask"]}],
output: [{id:"VV",bands:1},{id:"VH",bands:1},{id:"dataMask",bands:1}]}}
function evaluatePixel(samples) {
return {VV: [samples.VV],VH: [samples.VH],dataMask: [samples.dataMask]}}
"""
stats_request = {
"input": {
"bounds": {"geometry": poly,"properties": {"crs": f"http://www.opengis.net/def/crs/EPSG/0/{EPSG_code}"}},
"data": [{"type": "sentinel-1-grd","dataFilter": {},"resolution":"HIGH","acquisitionMode":"IW",
"polarization":"DV","processing": {"orthorectify": "true","backCoeff": "GAMMA0_ELLIPSOID",
"demInstance":"COPERNICUS_30"}}]},
"aggregation":{
"timeRange":{"from": f"{sd}T00:00:00Z","to": f"{ed}T00:00:00Z"},"aggregationInterval":{"of": "P1D"},
"evalscript": evalscript,"resx": res,"resy": res}}
headers = {'Content-Type': 'application/json','Accept': 'application/json'}
url = "https://services.sentinel-hub.com/api/v1/statistics"
return oauth.request("POST", url=url,headers=headers,json=stats_request)