Giter VIP home page Giter VIP logo

satellite-rsr's Introduction

satellite-rsr

Purpose

Interactively examine relative spectral response (RSR) curves of spaceborne instruments and ground target reflectances.

Methodology

This work is largely based around improving the exiting (and functional) Landsat Spectral Characteristics Viewer. Here, the same principles are reimplemented using the Plotly (Dash) library in Python. This project aims to:

  1. make the plotting framework open-source,
  2. make it easy for a user/developer to add or remove spectra, and
  3. allow for creation of publication-grade figures using a web UI.

Demo

Screenshot Description
Full application The full application.
Toggle bands Toggle targets and bands by clicking the legend items.
Add sensors Add multiple sensors (top menu items) to compare.
Color by sensor Select 'Color by sensor' to color code by unique sensor, instead of unique band.
Zoom Zoom (hourglass icon) to compare targets and bands up close.

Python environment

Requires the following non-standard Python libraries:

  • dash
  • pandas
  • gunicorn (only required if deploying)

For pip: use the requirements.txt file.

For conda: use the environment.yml file:

conda env create -f environment.yml

or create using the command line (recommended):

conda create --name dash python=3.9.15 
conda install -c conda-forge numpy pandas dash

Usage

  • Script generates the full interface, and calls a local server, which will output its URL in the console. There are some variables hard-coded at the top of the script, but it can be run as-is.

Input data formats

Satellite RSRs

  • Stored in file rsr_ALL.csv
  • Header: wavelength_um,rsr_watts,sensor,band

Environmental RSRs

TODOs

Data Sources

Satellite sensors

Ground spectral features

Dev notes

Create environment.yml

conda env export > environment.yml

Deploy locally

  1. Start local environment (conda, virtualenv, etc.)
  2. Run script python plot_rsr.py.
  3. Browse to webpage URL listed in console.

Deploy to Heroku

This app was previously deployed for free in Heroku, however hosting costs are applied after so many hours of use.

Follow the Plotly Deployment Guide. Notes:

  1. Initial setup on macos (Apple Silicon, requires homebrew and xcode-select):
arch -x86_64 brew install heroku/brew/heroku
  1. To setup the Heroku CLI, follow Heroku's Getting Started With Python guide.
  2. Setup Procfile and add plot_rsr script.
  3. Setup requirements.txt using pip (there's a bug in pip that produces local paths for some libs, so use list --format=freeze arguments to get around it):
pip list --format=freeze > requirements.txt
  • The build failed on mkl* dependencies, the solution was to remove them completely.
  • mkl* can be avoided completely if numpy is installed from conda-forge.
  • The build also failed on setuptools=x.xx, the solution was to remove the version requirement.
  1. Setup runtime.txt to define the deployed Python version. Notes:
  2. Push to Heroku repo with git push heroku main
    • If working from a local branch that is not main, use git push heroku mybranch:main

Deploy from Github repo to Heroku

  • Purpose: Heroku will update deployment every time a commit is made to the target branch.
  • Should ideally do this after the Deploy to Heroku workflow is tested and verified.
  • Enable Github deployment
    • dashboard.heroku.com -> "Deploy" -> "Deployment method" -> "Github"
  • Enable automatic deployment
    • dashboard.heroku.com -> "Deploy" -> "App connected to Github" -> Enable automatic deploys from desired branch.

Licensing

See LICENSE.md.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.