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:
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":[50]}}}}}
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,
calculations=calcs
)
sn2_ndvi_stats = sn2_ndvi_request.get_data()[0]
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.