GithubHelp home page GithubHelp logo

caltechlibrary / caltechdata_plot Goto Github PK

View Code? Open in Web Editor NEW
1.0 6.0 1.0 15 KB

Demo interactive plotting tool that uses Bokeh server to produce an interactive plot by calling the caltechDATA (Invenio 3) API

Home Page: http://plots.caltechlibrary.org

License: Other

Python 100.00%
bokeh plot bokeh-server invenio

caltechdata_plot's Introduction

caltechdata_plot

DOI

caltechdata_plot is a demo interactive plotting tool that uses Bokeh server to produce an interactive plot by calling the caltechDATA (Invenio 3) API

This is example is not general and only works with mineral spectra records 208 and 209.

Setup

  • Install the Anaconda python distribution
  • Install Bokeh by typing 'conda install bokeh'
  • bokeh serve --show plot.py

AWS Setup

Instructions for setting up an AWS server that will show plots. This configuration has been tested on Ubuntu 16.04.

  • Install Anaconda by downloading the installer below and following the prompts (you can update the links for new versions).
curl https://repo.continuum.io/archive/Anaconda3-4.3.1-Linux-x86_64.sh > Anaconda3-4.3.1-Linux-x86_64.sh
bash Anaconda3-4.3.1-Linux-x86_64.sh 

(You can also use a preconfigured AWS Anaconda community images, but this limits your choice of servers)

  • Install Bokeh by typing 'conda install bokeh'
  • Install nginx by typing 'sudo apt-get install nginx'
  • Remove default and add configuration at '/etc/nginx/sites-enabled/plot'
server {
    listen 80 default_server;
    server_name plots.caltechlibrary.org;

    access_log  /tmp/bokeh.access.log;
    error_log   /tmp/bokeh.error.log debug;

    location / {
        proxy_pass http://127.0.0.1:5006;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host:$server_port;
        proxy_buffering off;
    }

}
  • Restart web server with 'sudo service nginx restart'
  • Add this configuration to /etc/systemd/system/plot.service
[Unit]
Description=Bokeh Plot
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=simple
WorkingDirectory=/home/ubuntu/caltechdata_plot/
ExecStart=/home/ubuntu/anaconda3/bin/bokeh serve plot.py --allow-websocket-origin plots.caltechlibrary.org
Restart=on-failure

[Install]
WantedBy=multi-user.target
  • Reload by typing 'sudo systemctl daemon-reload'
  • You can start up bokeh with 'sudo systemctl start plot'
  • Start the plotting server on reboot with 'sudo systemctl enable plot'

Command Line Usage

   bokeh serve plot.py

caltechdata_plot's People

Contributors

tmorrell avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

tmorrell

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.