Skip to main content

SentinelHubStatistical -aggregation_interval options

  • April 17, 2024
  • 3 replies
  • 0 views

Hello

I’m trying to use the statistical API requesst and I have question which I didn’t find answer in the documentaion . I wanted to know which values can be inserted in the “aggregation_interval” parameter, I am now using P1D which seems to aggregate by month, but don’t find which string should I use to get the daily average.

aggregation = SentinelHubStatistical.aggregation(
    evalscript=ndvi_evalscript,
    time_interval=yearly_time_interval,
    aggregation_interval='P1D',
    resolution=(10, 10)
)

input_data = SentinelHubStatistical.input_data(
    DataCollection.SENTINEL2_L2A
)

3 replies

Do I understand correctly that P1D means no aggregation in time? In that case the from date is the image acquisition date.


P1D aggregates on daily basis. You can see that in your results, where the interval looks something like

'interval': {'from': '2020-01-14T00:00:00Z', 'to': '2020-01-15T00:00:00Z'}

The aggregation_interval is the duration in ISO 8601 duration format, check here for more details.


P1D is aggregation on a daily basis. Normally, for Sentinel-2, this would indeed mean “one observation”. However, if you go closer to the poles, or you use some other data, i.e. PlanetScope, P1D might as well be more observations…