Skip to main content

Using the sentinelhub module, I am trying to visualize some Sentinel-1 data. However, SentinelHubRequest doesn’t seem to like my inputs:


from sentinelhub import SentinelHubRequest, DataSource
SentinelHubRequest.input_data(data_source=DataSource.SENTINEL1_IW)

This generates a KeyError, despite SENTINEL1_IW being an acceptable DataSource. Substituting SENTINEL2_L2A does not generate a KeyError, so there seems to be something about Sentinel-1 that it doesn’t like.


How can I request Sentinel-1 IW data from the API?

Hi,

You are right about Sentinel-1 not being well supported in SentinelHubRequest. For now, you can bypass this by manually building a dictionary that SentinelHubRequest.input_data method would build:

s1_input_data_dict = {
"type": "S1GRD",
"dataFilter": {
"timeRange": {
"from": '2020-06-01T00:00:00Z',
"to": '2020-06-30T00:00:00Z'
},
"mosaickingOrder": "mostRecent",
"acquisitionMode": "IW",
"polarization": "VV",
"orbitDirection": "ASCENDING"
}
}

request = SentinelHubRequest(
evalscript=evalscript,
input_data=[
s1_input_data_dict
],
responses=[
SentinelHubRequest.output_response('default', MimeType.TIFF),
],
bbox=your_bbox,
size=image_size,
config=config
)

The reference on how to build such dictionary is Processing API documentation.

We’ll try to better support Sentinel-1 in SentinelHubRequest in the next iteration.


Thank. I built the dictionary manually and it is working now.


Reply