Sunday 13 January 2019

cloud cover - Masking out shadows in Sentinel images using Google Earth Engine?


This question is an addition to this answer to Creating Sentinel-2 cloud free, cloud-shadow free composite or scene on Google Earth Engine (GEE)?


There Rodrigo E. Principe showed how to mask out the clouds. I am wondering if there is a way to mask the shadows as well. And, if possible then not only the shadows of the clouds but also, shadows in rugged topography.




Answer



There has been an approach to do this using a decision tree: Ready-to-Use Methods for the Detection of Clouds, Cirrus, Snow, Shadow, Water and Clear Sky Pixels in Sentinel-2 MSI Images.


I have adapted the code to EE, and make it open source in geetools, both for the Python API and for the JavaScript API


var cld = require('users/fitoprincipe/geetools:cloud_masks')
var image = ee.Image('COPERNICUS/S2/20151123T142942_20170221T180430_T19GCN')

Map.centerObject(image)

var mask_shadow = cld.hollstein_S2(['shadow'])(image)


Map.addLayer(mask_shadow, {bands:['B8', 'B11','B4'], min:0, max:5000})

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...