Skip to main content

Currently, the FISRequest returns mean, min, max, stdev. Can it be extended to return median or better still user-specified percentile?

Not at the moment, but we have this in plans for the next iteration of the FIS API, planned to come in a few months.


Hi @gmilcinski - is this now available via the statistical API? meaning, can we request median or even define custom statistical function?


Indeed, Statistical API does allow for definition of percentiles, including median. Custom statististical function is currently not supported.


See this example:

docs.sentinel-hub.com
6adc0c17c58b09f5b8063eac7b1d8a910040498a.png


Statistical API



Our powerful Statistical API makes it possible to get various statistics for satellite imagery without having to download images.








How can I implement it in Python API?

For example here:



sd = ‘2022-05-10’ # start date

ed = ‘2022-05-11’ # end date

sn2_ndvi_request = SentinelHubStatistical(

aggregation=SentinelHubStatistical.aggregation(

evalscript=sn2_ndvi_evalscript,

time_interval=(sd, ed),

aggregation_interval=“P1D”,

resolution=(0.0001, 0.0001),

),

input_data= SentinelHubStatistical.input_data(DataCollection.SENTINEL2_L2A)],

geometry=poly,

config=config,

)



found it 🙂


sd = '2022-05-10' # start date
ed = '2022-05-11' # end date


calcs = {"ndvi": {"statistics": {"default":{"percentiles":{"k":k50]}}}}}


sn2_ndvi_request = SentinelHubStatistical(
aggregation=SentinelHubStatistical.aggregation(
evalscript=sn2_ndvi_evalscript,
time_interval=(sd, ed),
aggregation_interval="P1D",
resolution=(0.0001, 0.0001),
),
input_data=tSentinelHubStatistical.input_data(DataCollection.SENTINEL2_L2A)],
geometry=poly,
config=config,
calculations=calcs
)

sn2_ndvi_stats = sn2_ndvi_request.get_data()a0]

It is possible to drop the “min” and “max”? would that reduce the number of PU?


No, Statistical API response always contains “min” and “max” values. However, this does not impact your PU consumption.


Reply