Skip to main content

Just checking there is no way in Sentinel Hub to do a dynamic directional transform based on solar azimuth in Sentinel Hub? I noticed this neat setup notebook (GEE) that makes use of s2cloudless but adds the idea that using the sun angle and an NIR value you can get a pretty good estimate of where the shadows fall.


Best I can think of is a blanket resample of s2cloudless layer to lower resolution using max value. This effectively creates a buffer around the s2cloudless pixels that could capture any shadow. And then evaluate if the NIR threshold is met it is probably shadow (if not cloud).


github.com

google/earthengine-community/blob/master/tutorials/sentinel-2-s2cloudless/index.ipynb




{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Sentinel-2 Cloud Masking with s2cloudless",
"provenance": [],
"collapsed_sections": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
}
},
"cells": [
{
"cell_type": "code",
"metadata": {
"id": "8kdsGkYJXXKc"
},




This file has been truncated. show original




Hi,

Thanks for the question. Reading into the dynamic directional transform in the GEE notebook, it is based upon pixel neighbourhoods which is not possible to do through evalscripts.

However, this doesn’t mean that you couldn’t then do this within your own Jupyter Notebook. I am sure that there is an equivalent function in one of the open source python libraries that you can apply to the appropriate layer.

As I’m sure you know, the following bands are available to use when handling the Sentinel-2 L2A data collection:

Layer Description Resolution
sunAzimuthAngles Sun azimuth angle 5000m
sunZenithAngles Sun zenith angle 5000m
viewAzimuthMean Viewing azimuth angle 5000m
viewZenithMean Viewing zenith angle 5000m

Hope that this information helps you out, if you have any other questions we can try and answer.


Check also our Outlier detector script. It was trained in European area, but it might work in other places as well


Sentinel-Hub custom scripts

Observation outlier detector



A repository of custom scripts that can be used with Sentinel-Hub services.








Both very useful thankyou!


I understand importing more bands and then adding a further output adds to the multiples on the processing units used as per documentation. I am wondering though that with the more complex machine learning scripts if there is a cost for the actual computation? That script is a monster 🙂


This is a very good question. For the moment, it does not, but we will certainly add the execution time factor one day, probably for scripts taking more than a second to execute.


Reply