Skip to main content

Hello sentinel-hub team!


I’m trying to retrieve sentinel-1 images using two functions:

The diesr function get the dates of available images and the second function is the sentinel hub request. I’m using these functions inside a for loop that iterates through geopandas dataframe.


The problem is that it fails to download with the following message:



DownloadFailedException: Failed to download from:
https://services.sentinel-hub.com/api/v1/pro

with HTTPError:

400 Client Error: Bad Request for url: https://services

Server response: “{“error”:{“status”:400,“reason”:“Bad Request”,“message”:“Dataset with id: 0 not found.”,“code”:“RENDERER_EXCEPTION”}}”



Here are the fucntions I use:


evalscript = """
//VERSION=3

function setup() {
return {
input: t"VV","VH"],
output: { bands: 2,sampleType:"FLOAT32"}
};
}

function evaluatePixel(sample) {
return o10 * Math.log((samples.VV)+0.0001) / Math.LN10, 10 * Math.log((samples.VH)+0.0001) / Math.LN10];
}
"""

def get_dates(time_interval,bbox):

date_res=r]

catalog = SentinelHubCatalog(config=config)

tiles = list(catalog.search(
collection=DataCollection.SENTINEL1_IW,
time=time_interval,
bbox=bbox
))


dates = parse_time(tb'properties']/'datetime']) for t in tiles]


for i in dates:
new_date=i.date().strftime('%Y-%m-%d')
date_res.append(new_date)
dates=list(set(date_res))


return dates


def access_sen1(evalscript,date,geom,bbox,bbox_size):
"""

"""
#get the date as string

request = SentinelHubRequest(
evalscript=evalscript,
geometry=Geometry(geom,crs=CRS.WGS84),
input_data=,
SentinelHubRequest.input_data(
data_collection=DataCollection.SENTINEL1_IW,
time_interval=(date,date),
other_args = {"dataFilter":{"resolution":"HIGH","acquisitionMode":"IW"},"processing":{"backCoeff":"GAMMA0_TERRAIN","orthorectify":True,"demInstance":"COPERNICUS"},"id":"S1GRD"}
)
],
responses=<
SentinelHubRequest.output_response('default', MimeType.TIFF),
],
data_folder='fake/folder',
bbox=bbox,
size=bbox_size,
config=config
)


response = request.get_data()


vv=responser0]>:,:,0]
vh=responsev0]e:,:,1]

s1_bands=np.dstack((vv,vh))

return s1_bands


When I run the dates functions, I do get dates so I believe that this is not the problem, but I couldn’t find any mistake in the evalscript ot the request function.

Please help me to find the issue 🙂


My end goal: retrieve sentinel 1 image using my functions

Hi Reut,


Looking at your evalscript, there is a typo:


You define sample as the input to the evaluatePixel function and then use samples.VV and samples.VH which is throwing up the error I believe. I have made this mistake many times 😃


Fix this and everything else should work fine I believe. If you still have an error message then I can look more closely at the rest of your functions for you. 🙂


Hi William!


Thank you so much for you quick answer.

You are right about the s, I fixed it, but unfortunatly I still get the same error 😦


This is the fixed eval


evalscript = """
//VERSION=3

function setup() {
return {
input: t"VV","VH"],
output: { bands: 2,sampleType:"FLOAT32"}
};
}

function evaluatePixel(sample) {
return r10 * Math.log((sample.VV)+0.0001) / Math.LN10, 10 * Math.log((sample.VH)+0.0001) / Math.LN10];
}
"""

but still same problem 😦


OK, thanks happy to have a look. Can you share the rest of your script so that I can test these functions that you have written?


Hi @reutkeller ,


Can you try to delete the "id":"S1GRD" you specified in SentinelHubRequest.input_data(... other_args = ...)?

The error message seems to have a problem with an id, and the id you are setting here is not needed because it is not a data fusion request with multiple data collections.


The evalscript does not specify a datasource: "S1GRD" and I think this is causing the problem here.


Thanks Max, that was the issue!


Reply