How to get your idea and turn it into a script?
Useful tips from one of the winners of the first two rounds of the Sentinel Hub Custom Script Contest
Foreword by Sentinel Hub
This post is part of a series of guest blog posts written by script authors, talking about their entries to our Contest. Mohor Gartner is one of the participants whose scripts won several awards in the first two rounds. His winning scripts with detailed descriptions are available on our GitHub repository:
- White-water detection
- Land surface temperature (LST) mapping
- Seldom and regular water surface detection
- Satellite Derived Bathymetry Mapping (SDBM)
In this blog post Mohor is focusing on the starting point for all of you, who would like to participate in the next round of the Contest.
How to start?
Do you want to participate in the Sentinel Hub Custom Script Contest and do not know what kind of script to do? Well, then this article might be helpful. Firstly, of course, read carefully all information provided on the third round of the Contest.
Choose an Appropriate Topic
Next, I would recommend you try to find a topic, which checks at least one bullet below. Or all, the more, the better.
- Do a script on a topic which you are interested in and passionate about the most.
- Think about if you observed any interesting phenomenon around you which you want to know more about and could be identified with remote sensing (in this case satellite imagery archive of Sentinel Hub). That could be something which you see every day in your local area or an occurence, which you noticed while travelling around the world.
- A topic on which you have some knowledge of, or it is even related to your education. Or a topic on which you plan to get an education in. It is never too soon to start on that.
- If you can find nothing else, try to do a topic you saw in the news. Or by checking some scientific articles on remote sensing algorithms.
Check Existing Scripts and Scientific Articles
So, did you find a topic on which you would work on? Great! Now formulate a general idea of what you want to find out or identify with the script. Then I would recommend you to do following.
- Check what kind of custom scripts were already done. And even if your idea was already done, well maybe you can improve the existing script.
- Identify appropriate data source in the Sentinel Hub which would best fit to present your idea.
- Optionally, you can also try to find some scientific article with (a simple) algorithm for the implementation of your idea in the script.
Develop Your Script
- Start coding to identify if it will be possible to implement your idea. Try to play around with custom scripting in some area you know well and/or where you expect to identify some phenomena. If needed, check the basics of scripting in Sentinel Hub and already existing custom scripts. For example, you can check Monja`s Custom Barren Soil Script.
- When you identify that it is possible to accomplish your idea on one location, try to use developed script on other areas, which if possible, are known to you.
- If applicable, also try to improve the script. Satellite imagery varies depending on the season, location, weather conditions, etc. If you want the script to work well in diverse conditions, additional trying and testing should be done.
- Finally, when you are satisfied with the script, follow the instructions of the competition on how to send the script and all related data to participate in the Contest.
How I Created My Custom Script
I love to surf. And anybody who surfs must observe the waves and how they break to be in a good position to catch the waves. Otherwise, if you catch the wave unsuccessfully you can for sure feel the power of the white-water when the wave breaks.
In addition to that, water also has some other impact on me. I studied Water Management and Municipal Engineering. And I finished my studies with a thesis related to coastal engineering. Because of my passion for surfing, regular observation of white-water and water environments knowledge, it is no surprise that my first idea for the Custom Script Contest was white-water detection. I checked if there is any existing research or scientific articles on white-water detection. I could not find anything. So, I was even more excited, and motivated to do something which it seems it was not done before.
One can ask, why would anybody want to know where are the white-water areas. Regarding surfing, white-water areas present potential location to surf. Of course, a lot of other conditions need to be met in order to have a (good) surf spot. So the results of white-water detection can give you some potential areas where you can check for waves to surf. In addition, white-water areas present a tool for surf zone habitat identification, coastal engineering works, maritime navigation, detection of new reef or island, etc.
The most obvious choice for data source was Sentinel-2 as it has the best resolution from possible sources (10x10 meters) and 13 bands.
My first location to test my hypothesis and to start writing the algorithm was the Atlantic Ocean coastline around Porto in Portugal. The area is very well known to me as I lived there for almost a year. For the first stage of writing the algorithm, I selected an image where white-water was present with some clouds and shadow. I wanted to have an algorithm that would detect white-water in shadow and would not falsely detect clouds as white-water.
When most of the algorithm was developed, I also started to test it on other locations. So for the second location I selected a surf spot with the highest waves surfed so far, Nazaré in Portugal.
Of course I also had to test the script on the most famous place to surf, Hawaii.
I continued with the script testing on other locations around the world, also in areas with lower waves and it worked pretty well. Snowy coastline might be a problem as areas with snow are falsely identified as white-water. I also got the idea to identify white-water on rivers, but for that resolution of the images (10x10m) is too low. White-water would not be detected. Nevertheless, I was able to identify some white-water on one of the biggest waterfalls on Earth, Victora Falls in Zambia.
In the end I selected the best 5 examples, wrote down all the needed materials and took part in the Sentinel Custom Script Contest.
Of course all of the above is not something you must stick to. It is only to provide you with general guidelines on how to start with the Custom Script Contest if you are stuck. I participated in the first two Contests and I can say that this has been a general framework for me to implement my ideas into scripts for the Contest. If you have some additional tips on how to do the best script possible, just comment below.