Adding the cloud cover precentage in sentinel hub request

Hello,

that might be very simple question :slight_smile:
what is the parameter for cloud coverage precentage in sentinel hub request (evalscript)?

I saw examples in the documentation for how to rank it by cloud cover but not how to filter it by the cloud precentage from the evalutate script.
Iā€™m a bit confused with all the different api, if you could even tell me where I can find all the possibles parameters I can put in the evalscript it would be great.

evalscript_sentinel ="""
//VERSION=3
function setup() {
  return {
    input: ['B01', 'B02', 'B03', 'B04', 'B05', 'B06', 'B07','B08','B8A','B09','B11','B12'],
    output: { bands: 12, sampleType: "FLOAT32" }
  }
}
function evaluatePixel(sample) {
  return [ sample.B01,sample.B02,sample.B03,sample.B04,sample.B05,sample.B06,sample.B07,sample.B08,sample.B08A,sample.B09,sample.B11,sample.B12];
}
"""
......
sen_request = SentinelHubRequest(
                evalscript=evalscript_sentinel,
                input_data=[
                    SentinelHubRequest.input_data(
                        data_collection=DataCollection.SENTINEL2_L2A,
                        time_interval=d,
                        maxCloudCoverage=0.2
                    )],
                responses=[
                    SentinelHubRequest.output_response('default', MimeType.TIFF)
                ],
                bbox=b,
                size=dim,
                config=config
            )
            
            data = sen_request.get_data() 

the throw back error that there is no maxCloudCoverage.

My end goal is to get only images that their tile cloud covrage is lower tahn 20%

The parameter for tile cloud coverage is maxcc, not maxCloudCoverage.

1 Like

Hi @reutkeller ,

All possible parameters taken by SentinelHubRequest.input_data can be found in this documentation and the source code. For more details of evalscript please refer to this documentation.

Best,
Chung

1 Like