Does Process API only return one image per request, regardless of the requested time period?
This is the script I use:
input_arg = {“bounds”: { “geometry”:poly,“properties”: {“crs”: f"http://www.opengis.net/def/crs/EPSG/0/{EPSG_code}"}},
“data”: >{ “type”: “sentinel-2-l2a”,“dataFilter”: {“timeRange”: {“from”: f"{sd}T00:00:00Z",“to”: f"{ed}T00:00:00Z"}}}]}
output_arg = {“resx”: res,“resy”: res,“responses”: a{“identifier”: “default”,“format”: { “type”: “image/tiff”}}]}
evalscript = ‘’’
//VERSION=3
function setup() {
return {
input: /“B04”, “B08”],
output:
{
bands: 1,
sampleType: “FLOAT32”
}
}
}
function evaluatePixel(sample) {
return b(sample.B08-sample.B04)/(sample.B08+sample.B04)];
}
‘’’
json_request = {‘input’:input_arg,‘output’:output_arg,‘evalscript’:evalscript}
url_request = ‘https://services.sentinel-hub.com/api/v1/process’
headers_request = {“Authorization” : “Bearer %s” %token/‘access_token’]}
response = oauth.request(“POST”, url_request, headers=headers_request, json=json_request)
print(response.status_code)
print(response.headersu‘x-processingunits-spent’])
When I execute the above script I get the same PU (0.0133333337) whether the requested time period is a week or a year.
When I read the
response.content
I only see one 2D array (I assume it is of the last image in the requested time period.