Can't get correct CLM and CLP mean values through Statistical Info Service

Hi to all,

I am trying to follow this guide: https://www.sentinel-hub.com/faq/best-way-do-cloud-filtering-specific-aoi/
in order to get statistics for Cloud Coverage for specific AOIs with no luck. I can’t find the CLM and CLP bands as a product in the configuration layer. Thus I am using the “s2cloudless pseudoprobabilities” product. Also, the statistical info service is giving me NaN values. Maybe because I am using the wrong product? Could anyone advise me on this?

Thank you in advance.

Not sure I understand the problem, but you can easily configure a new layer and put the following script in:
return [CLM];
or
return [CLP];

Thank you very much for your response. Let me rephrase. In order to get all the images which have less than 20% cloud coverage for a time period and for a certain AOI, I am using this guide https://www.sentinel-hub.com/faq/best-way-do-cloud-filtering-specific-aoi/ . I am trying to get the CLM mask and compute the mean value as proposed in the above guide. In this guide it’s written:

“4. Output of the service will give you array of all dates along with mean value of “cloud” for each of the dates. Mean value “0” means there are no clouds, “1” fully covered, “0.7” 70% covered.”

but still with the return [CLM]; I am getting NaN values. for example:

{‘date’: ‘2020-07-30’, ‘basicStats’: {‘min’: ‘NaN’, ‘max’: ‘NaN’, ‘mean’: ‘NaN’, ‘stDev’: ‘NaN’}}

So, the question remains, which layer configuration is suitable in order to get valid and true cloud mask values so that I can use them as threshold when I will download the images I want, without downloading fully cloudy images and waste all my processing units in data that I can’t work with. If this is not clear enough please ask me to clarify it further.

Can you post here an example of the FIS request that you are making? You can mask a part of the instance ID.
This will help us to figure out the issue you are facing.

Thank you for your reply. Here is a fis request:

http://services.sentinel-hub.com/ogc/fis/{Instance ID}?LAYER=CLOUD-MASK&STYLE=INDEX&CRS=EPSG:4326&TIME=2020-01-01%2F2020-09-01&BBOX=20.846250546,40.084839572,21.066250546,40.304839572&RESOLUTION=10

Thank you in advance.

RESOLUTION parameter is by definition in the same units as the BBOX. So you are essentially running the request on resolution of 10 degrees. This triggers processing in the top PREVIEW level, at which cloud mask are not precomputed.

The best option would be to calculate resolution to degrees and pass that one. There is also a workaround if you want to avoid that, to add “m” to the resolution, in which case the Sentinel Hub does (the best possible) recalculation to degrees.
E.g.
http://services.sentinel-hub.com/ogc/fis/bb844667-MASKED?LAYER=CLOUD-MASK-CLM&STYLE=INDEX&CRS=EPSG:4326&TIME=2020-01-01%2F2020-09-01&BBOX=40.084839572,20.846250546,40.304839572,21.066250546&RESOLUTION=10m

That being said, as the cloud masks are computed at 160m resolution, we would strongly recommend you use this resolution for processing, e.g.
http://services.sentinel-hub.com/ogc/fis/bb844667-MASKED?LAYER=CLOUD-MASK-CLM&STYLE=INDEX&CRS=EPSG:4326&TIME=2020-01-01%2F2020-09-01&BBOX=40.084839572,20.846250546,40.304839572,21.066250546&RESOLUTION=160m

The results will be statistically the same, but the process will be faster and will consume (significantly) less processing units.

Thank you very much for your response and for the great answer.