This repository contains a collection of custom scripts for Sentinel Hub, which can be fed to the services via the URL.
Custom scripts are a piece of Javascript code, used to visualize satellite imagery and to control what values the Sentinel Hub services will return. Any visualization of any constellation (e.g. Sentinel-2 satellite), even a simple true color composite, is dictated by a custom script.
See here for more information on how to write your own evalscript.
Have a look at the template for an example of how a script page can be structured.
You can also have a look at other scripts to see how they are structured.
For instructions on how custom scripts are structured have a look at this tutorial, or at the official documenation.
example
directory to proper directory, based on which datasource (satellite) you are publishing the product for, to something that describes what the product is about, say my_algorithm
._README.md
file.README.md
files to see how to include images, format the text and generally use the GitHub markdown (e.g. here for mathematical formulas or here for adding images)._script.js
file.example
folder includes an empty custom script with comments that will hopefully help you build your own custom script.sentinel-2.md
in the folder sentinel-2
).Publishing your product should be easy, nevertheless, any feedback and ideas how to improve or make the process simpler is very appreciated.
This is optional but makes Pull Requests quicker to handle since they should have less mistakes.
Before you create the PR you can check if everything looks right on the website. To do this follow these steps which are based on Testing your GitHub Pages site locally with Jekyll page:
sudo apt install ruby ruby-dev
gem install bundler
sudo
_config.yml
file is) create a new file Gemfile
.touch Gemfile
source 'https://rubygems.org'
gem "github-pages", "~> GH_VERSION", group: :jekyll_plugins
gem "just-the-docs"
Replace GH_VERSION
with the version number that is displayed next to github-pages here.
bundle install
bundle exec jekyll serve
127.0.0.1:4000
In the root directory of your fork open a terminal
Install ruby
brew install chruby ruby-install xz
If homebrew hasn't been installed yet, intall homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
ruby-install ruby 3.1.3
echo "source $(brew --prefix)/opt/chruby/share/chruby/chruby.sh" >> ~/.zshrc
echo "source $(brew --prefix)/opt/chruby/share/chruby/auto.sh" >> ~/.zshrc
echo "chruby ruby-3.1.3" >> ~/.zshrc # run 'chruby' to see actual version
ruby -v
Install Jekyll
gem install jekyll
Install bundler
gem install bundler
Following the Create a Gemfile step in the Linux section
Serve the page
First install all necessary gems with bundle install
Add the missing webrick package with bundle add webrick
Run this command again when the following error message pops out:
bundler: failed to load command: jekyll
bundle exec jekyll serve
127.0.0.1:4000