Open Sustainable Technology

A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

Browse accepted projects | Review proposed projects | Propose new project | Open Issues

Custom Scripts Sentinel Hub

A repository of custom scripts to be used with Sentinel Hub.
https://github.com/sentinel-hub/custom-scripts

earth-observation remote-sensing sentinel-hub

Last synced: about 1 hour ago
JSON representation

Repository metadata

A repository of custom scripts to be used with Sentinel Hub

README

        

# Sentinel Hub Custom Script Repository

![Examples of visualizations](assets/images/custom-scripts-examples.jpg)

This repository contains a collection of custom scripts for [Sentinel Hub](https://www.sentinel-hub.com/), 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](https://docs.sentinel-hub.com/api/latest/evalscript/v3/) for more information on how to write your own evalscript.

## Contribute to Custom Scripts

Have a look at the [template](/contribute/example) 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](https://www.sentinel-hub.com/explore/education/custom-scripts-tutorial/), or at the [official documenation](https://docs.sentinel-hub.com/api/latest/evalscript/).

---

### How to publish your own product

- Fork the repository to get your own copy of the custom-scripts
_It is easiest to fork the repository on GitHub, but as some of you might not have GitHub account, or don't want to bother with all this versioning and collaboration tools, you can also just download the whole repository as Zip file and work from there._
- Create a new directory entry for your custom script
_Copy the `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`._
_Preferably use ["snake_case"](https://simple.wikipedia.org/wiki/Snake_case) (underscores instead of spaces) if more than one word is used._
- Fill in the details about the project in the `README.md` file.
_Obviously, you'll want to remove this chapter, but use the rest of the file as a template._
_Have a look around at other `README.md` files to see how to include images, format the text and generally use the GitHub [markdown](https://help.github.com/categories/writing-on-github/) (e.g. [here](../sentinel-2/cby_cloud_detection/README.md) for mathematical formulas or [here](../sentinel-2/ndvi_uncertainty/README.md) for adding images)._
- Implement the product in the `script.js` file.
_The most work is of course the JavaScript implementation of the product. The `example` folder includes an empty custom script with comments that will hopefully help you build your own custom script._
- Add an entry pointing to your script to the top level markdown file (i.e. if adding a script for Sentinel 2 add the link to `sentinel-2.md` in the folder `sentinel-2`).
_A link and a short description will do._
- And create a pull request :).
_There is extensive help on creating pull requests on GitHub [help](https://help.github.com/categories/collaborating-with-issues-and-pull-requests/), but if you feel overwhelmed by this step and would still like to contribute, send us the folder you've created and we will take care of it for you._

Publishing your product should be easy, nevertheless, any feedback and ideas how to improve or make the process simpler is very appreciated.

#### Test your changes locally

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](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/testing-your-github-pages-site-locally-with-jekyll) page:

##### Linux

- In the root directory of your fork open a terminal
- Install ruby
- Ubuntu: `sudo apt install ruby ruby-dev`
- Install bundler
- `gem install bundler`
- On Ubuntu you might have to add `sudo`
- Create a Gemfile
- In the root folder of the repository (where the `_config.yml` file is) create a new file `Gemfile`.
- i.e `touch Gemfile`
- and add the following content:

```
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](https://pages.github.com/versions/).

- Serve the page
- First install all necessary gems with `bundle install`
- then the site can be built with `bundle exec jekyll serve`
- The site should then be visible on `127.0.0.1:4000`

##### macOS

- 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`
- After installation run the following codes:

```
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
```

- Quit and relaunch Terminal, then check that everything with `ruby -v`
- It should show ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) or a newer version

- 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
```

- then the site can be built with `bundle exec jekyll serve`
- The site should then be visible on `127.0.0.1:4000`


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: about 4 hours ago

Total Commits: 1,388
Total Committers: 57
Avg Commits per committer: 24.351
Development Distribution Score (DDS): 0.773

Commits in past year: 119
Committers in past year: 14
Avg Commits per committer in past year: 8.5
Development Distribution Score (DDS) in past year: 0.328

Name Email Commits
MonjaSebela 5****a 315
Jonas Viehweger j****r@s****m 188
Sabina Dolenc s****c@s****m 119
Monja Šebela m****a@s****m 98
Matej Batič m****c@s****m 98
gmilcinski g****i@s****m 87
Blaz Sovdat b****t@g****m 64
Dorothyrono r****y@y****m 52
wray w****y@s****m 48
chorng c****g@s****m 30
Maxim Lamare m****e@s****m 30
mkampen m****n@s****m 28
Miha Kadunc m****c@s****m 25
Gergely Padányi-Gulyás f****1@g****m 24
Marjan Sterk m****k@s****m 23
mrepse m****e@s****m 20
dr. Zlinszky András d****a@s****t 11
Lucia Guardamino l****o@s****m 10
Dino Horvat d****t@s****m 10
iespinosa i****a@s****m 10
dkorais d****s@s****m 10
Matt Ballard 9****t 7
MarkWilliamMatthews m****k@c****m 6
Matic Lubej m****j@s****m 6
Klemen Cankar k****r@s****m 5
ESC-QU 8****U 5
pacoNGH 1****H 4
lugeo17 8****7 4
William Ray 4****o 4
Arjan Geers a****s@p****m 4
and 27 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 28
Total pull requests: 285
Average time to close issues: 4 months
Average time to close pull requests: 4 days
Total issue authors: 26
Total pull request authors: 49
Average comments per issue: 2.07
Average comments per pull request: 0.26
Merged pull request: 266
Bot issues: 0
Bot pull requests: 0

Past year issues: 2
Past year pull requests: 49
Past year average time to close issues: 1 day
Past year average time to close pull requests: 1 day
Past year issue authors: 2
Past year pull request authors: 16
Past year average comments per issue: 3.0
Past year average comments per pull request: 0.45
Past year merged pull request: 41
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/sentinel-hub/custom-scripts

Top Issue Authors

  • moussmo (2)
  • maximlamare (2)
  • tommy0827 (1)
  • SOWITMA (1)
  • smaprs (1)
  • NelaJantol (1)
  • Narayana-Rao (1)
  • mslapek (1)
  • mkganyago (1)
  • MirelSIG (1)
  • makovz (1)
  • madi (1)
  • jonasViehweger (1)
  • JoeyFaulkner (1)
  • geom16011 (1)

Top Pull Request Authors

  • MonjaSebela (78)
  • sabinadolenc (37)
  • jonasViehweger (33)
  • maximlamare (16)
  • Dorothyrono (15)
  • Kampen1988 (12)
  • chorng (9)
  • fegyi001 (8)
  • willrayeo (7)
  • TIZNEGAR (6)
  • lugeo17 (5)
  • zcernigoj (5)
  • msterk (4)
  • horvatdino (3)
  • ignasieb (3)

Top Issue Labels

Top Pull Request Labels


Dependencies

sentinel-2/ulyssys_water_quality_viewer/package.json npm
  • fs-extra ^8.1.0
  • linereader ^1.1.0
  • minify ^5.0.0
  • npm-watch ^0.6.0
  • os ^0.1.1
.github/workflows/page.yml actions
  • actions/checkout v3 composite
  • actions/configure-pages v2 composite
  • actions/deploy-pages v1 composite
  • actions/upload-pages-artifact v1 composite
  • ruby/setup-ruby v1 composite
Gemfile rubygems
  • github-pages ~> 228 development
  • html-proofer >= 0
  • just-the-docs = 0.4.2
  • rake >= 0
  • webrick >= 0

Score: 10.510749993938905