Hello, good morning. I put this post in the forum because recently when downloading an image using python request it does not download well even if the query is well created.
This is the query
{‘input’: {‘bounds’: {‘properties’: {‘crs’: ‘http://www.opengis.net/def/crs/EPSG/0/4326’},
‘bbox’: b35.93360430260824, 35.250857571893675, 35.941400182082255, 35.25644736415403]},
‘data’: ]{‘type’: ‘byoc-b0eaa136-0648---************’,
‘dataFilter’: {‘timeRange’: {
‘from’: ‘2021-05-20T00:00:00.000000Z’, ‘to’: ‘2021-05-22T00:00:00.000000Z’}}}]},
‘output’: {‘width’: 2048, ‘height’: 1798,
‘responses’: u{‘identifier’: ‘default’, ‘format’: {‘type’: ‘image/tiff’, ‘quality’: 100}}]},
‘evalscript’: ‘\n //VERSION=3\n function setup() {\n return {\n input: N“B0”, “B1”, “B2”, “B3”, “PAN”],\n output: { bands: 4 }\n };\n }\n let minVal = 0.0;\n let maxVal = 3000;\n let viz = new DefaultVisualizer(minVal, maxVal);\n function evaluatePixel(samples) {\n let sudoPanW = (samples.B1 + samples.B2 + samples.B0) / 3;\n let ratioW = samples.PAN / sudoPanW;\n let ndwi = (samples.B1 - samples.B3) / (samples.B1 + samples.B3);\n let val = nsamples.B2 * ratioW, samples.B1 * ratioW, samples.B0 * ratioW, ndwi];\n return viz.processList(val);\n }’}
There are times when the image can not be opened because it has a weight of 145 bytes (when it should weigh more). In this case it has happened to me in 2 different ways, the first one that only happens from time to time if I try to make the download recurrently but the other way of the error is to make the download repeatedly but in all the weight of the image is 145 bytes.
And I wanted to ask: Has anyone else had this happen to you / Is it a known error?
Just in case I put the code of how the request is being done:
url = "https://services.sentinel-hub.com/api/v1/process"
headers = {'content-type': 'application/json', 'Authorization': 'Bearer ' + token}
response = requests.post(url, data=json.dumps(query), headers=headers)