davidfrantz / force

Framework for Operational Radiometric Correction for Environmental monitoring
GNU General Public License v3.0
172 stars 50 forks source link

Stripes in cloud shadow mask #217

Closed maxfreu closed 2 years ago

maxfreu commented 2 years ago

Hi!

I've just processed some data in Germany and noticed strange stripes in the cloud shadow and water vapour mask of Sentinel2 data. These are definitely wrong, as there are no shadows underneath. Am I doing sth wrong or is there a shortcoming in the detection algorithm? image

I'm using force 3.7.8, ALOS 30m DSM and these parameter settings:

Parameter file ``` ++PARAM_LEVEL2_START++ FILE_QUEUE = /data_hdd/force/l1/queue.txt DIR_LEVEL2 = /data_hdd/force/l2/harz DIR_LOG = /data_hdd/force/log DIR_TEMP = /data_hdd/force/tmp FILE_DEM = /data_hdd/ALOS_DSM/AW3D30_V3_2_Buff10km_Deutschland_EPSG4326.tif DEM_NODATA = -999 DO_REPROJ = TRUE DO_TILE = TRUE FILE_TILE = NULL TILE_SIZE = 12000 BLOCK_SIZE = 600 RESOLUTION_LANDSAT = 30 RESOLUTION_SENTINEL2 = 10 ORIGIN_LON = 4.5 ORIGIN_LAT = 55.5 PROJECTION = PROJCS["ETRS89 / UTM zone 32N",GEOGCS["ETRS89",DATUM["European_Terrestrial_Reference_System_1989",SPHEROID["GRS 1980",6378137,298.257222101],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4258"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","25832"]] RESAMPLING = BL DO_ATMO = TRUE DO_TOPO = TRUE DO_BRDF = TRUE ADJACENCY_EFFECT = TRUE MULTI_SCATTERING = TRUE DIR_WVPLUT = /data_hdd/force/misc/wvplut WATER_VAPOR = NULL DO_AOD = TRUE DIR_AOD = NULL ERASE_CLOUDS = FALSE MAX_CLOUD_COVER_FRAME = 75 MAX_CLOUD_COVER_TILE = 75 CLOUD_BUFFER = 300 SHADOW_BUFFER = 90 SNOW_BUFFER = 30 CLOUD_THRESHOLD = 0.225 SHADOW_THRESHOLD = 0.02 RES_MERGE = IMPROPHE DIR_COREG_BASE = NULL COREG_BASE_NODATA = -9999 IMPULSE_NOISE = TRUE BUFFER_NODATA = FALSE TIER = 1 NPROC = 1 NTHREAD = 1 PARALLEL_READS = FALSE DELAY = 5 TIMEOUT_ZIP = 30 OUTPUT_FORMAT = CUSTOM FILE_OUTPUT_OPTIONS = /data_hdd/force/param/output_options.txt OUTPUT_DST = TRUE OUTPUT_AOD = FALSE OUTPUT_WVP = FALSE OUTPUT_VZN = TRUE OUTPUT_HOT = TRUE OUTPUT_OVV = TRUE ++PARAM_LEVEL2_END++ ```
davidfrantz commented 2 years ago

Hi @maxfreu,

this is intended behavior, although this is admittedly still not optimal. Shadow detection is still a huge todo.

Please see Zhu & Woodcock 2012 for the basic idea of the shadow matching.

The cloud height is unknown, which means that cloud shadow location is unknown, too. We need to shift the cloud up and down and try to match the cloud shape with a "shadow probability" (which is basically highlighting dark patches). In standard FMask, only the best match is flagged as shadow. The disadvantage is that the cloud shadow will be located in the darkest patch along the way of projection. This is often not the true shadow but another feature like a lake, river, or a dark patch of vegetation. This also means, that the true shadow won't be identified, and will cause problems in follow-up applications.

FORCE does not only flag the best match, but any other reasonably high match that occurs along the projection. This causes these stripes. This admittedly decreases cloud shadow user's accuracy, but also increases producer's accuracy. The latter makes the data much safer for use in time series applications.

You can try to modify the cloud shadow probability in the parameter file to see whether you find a more suitable threshold for your scene.

Best, David

maxfreu commented 2 years ago

Ok thanks! I'll try that out and if it doesn't work I'll just go for a higher cloud buffer, as this will also erase some previously undetected clouds in the vicinity of detected clouds.

You can close this at your discretion.