Confusing error when requesting only dataMask

When requesting only dataMask in Sentinel-5P CLOUD there is a confusing error.
The script can only use one product type at once! Instead it uses: [].
Adding a data band avoids the error.


function setup() {
   return {
    input: [
      // uncomment to avoid error:
      // "CLOUD_BASE_HEIGHT", 
    output: [{ id: "default", bands: 1 }],

function evaluatePixel(samples) {
   return {
      default: [samples.dataMask],

Is it possible to change the error to something like:
The script can't only request dataMask. Please add another input product.
Or making it possible to only request the dataMask

Emile Sonneveld

Since the datamask in its current form returns 0 for all data which is outside a tile boundary and for all pixels which are equal to the no data value for the collection, it does not work without also specifying some data band.

However I do agree that the Error message can be improved. Thanks for pointing that out, I’ll forward that request.

1 Like