It is now possible to get information from scene classification layer produced by Sen2Cor, for data where L2A is available, of course.
Data can be retrieved by identifier “SCL” (e.g. instead of return [B02]; for blue color one can use return [SCL];).
Data can be then used for e.g. validation of the pixel value, e.g. along the lines:
function validate (samples) {
var scl = Math.round(samples.SCL);
if (scl == 3) { // SC_CLOUD_SHADOW
return true;
} else if (scl == 9) { // SC_CLOUD_HIGH_PROBA
return true;
} else if (scl == 8) { // SC_CLOUD_MEDIUM_PROBA
return true;
} else if (scl == 7) { // SC_CLOUD_LOW_PROBA/UNCLASSIFIED
return true;
} else if (scl == 10) { // SC_THIN_CIRRUS
return true;
} else if (scl == 11) { // SC_SNOW_ICE
return false;
} else if (scl == 1) { // SC_SATURATED_DEFECTIVE
return false;
} else if (scl == 2) { // SC_DARK_FEATURE_SHADOW
// return false;
}
return true;
}
Important remark - it makes sense to use this layer only on full resolution as any interpolation based on classification codelist will not produce reasonable results. You should also use NEAREST upsampling/downsampling setting.
Note that this feature is in prototype mode and its behavior can change a bit in the future, based on lessons learned.