• Stars
    star
    126
  • Rank 284,543 (Top 6 %)
  • Language
    Ruby
  • License
    GNU General Publi...
  • Created over 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Web-based tools for collecting, analyzing, and sharing data from a DIY spectrometer

Spectral Workbench

Copyright Public Lab publiclab.org | spectralworkbench.org

Gitpod Ready-to-Code tests View performance data on Skylight

Spectral Workbench is an open-source tool to perform low-cost spectral analysis and to share those results online. It consists of a Ruby on Rails web application for publishing, archiving, discussing, and analyzing spectra online -- running at http://spectralworkbench.org

The core library for analyzing and manipulating spectral data has been spun out into its own self-contained JavaScript module, at https://github.com/publiclab/spectral-workbench.js, which is then included into this application. To use Spectral Workbench on the commandline, try that out!

Read about how to build and use your own spectrometer with this software here: http://publiclab.org/wiki/spectrometer


Simple installation with Cloud9

  1. If you have a GitHub account, visit https://c9.io and log in with the GitHub button.
  2. Fork this repository to your own GitHub account, creating a yourname/spectral-workbench project.
  3. Name your project, then (order important!) choose the Ruby template, THEN enter yourname/spectral-workbench in the "Clone from Git or Mercurial URL" field, and press Create Workspace
  4. In the command line prompt at the bottom of the page, type ./install_cloud9.sh and press enter.
  5. Enter your username when prompted, and click "Run Project" when it's done.
  6. You're done! Go to the URL shown!

Installation

The app now runs on Ruby 2.6.6 up to Ruby 2.6.x (preferred), and Rails 5.2.x, and uses Bundler for gem management and Yarn for static asset management.

Prerequisites:

Recommended; for an Ubuntu/Debian system. Varies slightly for mac/fedora/etc

Install a database, if necessary:

sudo apt-get install mysql-server

Note: You will have to update the config/database.yml file appropriately. The example file assumes usage of SQLite. For which you need not install MySQL.

RMagick dependencies are required for processing uploaded spectrum images: apt-get install imagemagick ruby-rmagick libmagickwand-dev libmagick++-dev

  • On Fedora/centOs: yum install ImageMagick-devel
  • On mac, you can use Homebrew: brew install imagemagick

Install rvm for Ruby management (http://rvm.io)

curl -L https://get.rvm.io | bash -s stable

Note: At this point during the process, you may want to log out and log back in, or open a new terminal window; RVM will then properly load in your environment.

Ubuntu users: You may need to enable Run command as a login shell in Ubuntu's Terminal, under Profile Preferences > Title and Command. Then close the terminal and reopen it.

Then, use RVM to install version 2.6.6 of Ruby:

rvm install 2.6.6

You'll also need yarn which is available through NPM. To install NPM, you can run:

sudo apt-get install npm

However, on Ubuntu, you may need to also install the nodejs-legacy package, as due to a naming collision, some versions of Ubuntu already have an unrelated package called node. To do this, run:

sudo apt-get install nodejs-legacy

Once NPM is installed, you should be able to run:

sudo npm install -g yarn

  • On mac, you can use Homebrew: brew install yarn

Installation steps:

  1. Download a copy of the source with git clone https://github.com/publiclab/spectral-workbench.git
  2. Install gems with bundle install from the rails root folder. You may need to run bundle update if you have older gems in your environment.
  3. Copy and configure database with cp config/database.yml.example config/database.yml. Similarly, configure cp config/config.yml.example config/config.yml
  4. Initialize database with bundle exec rake db:setup
  5. Install static assets (like external javascript libraries, fonts) with yarn install
  6. Start rails with bundle exec passenger start from the Rails root and open http://localhost:3000 in a web browser. (For some, just passenger start will work; adding bundle exec ensures you're using the version of passenger you just installed with Bundler.)

Sign in instructions:

  • Create a account at PublicLab.org and use that username to log in.
  • Then you will be redirected to publiclab.org to "approve" a use of the openid identity.
  • Note that this applies for development environment as well.

Bugs and support

To report bugs and request features, please use the GitHub issue tracker provided at http://github.com/publiclab/spectral-workbench/issues

For additional support, join the Public Laboratory website and mailing list at http://publiclab.org/lists or for urgent requests, email [email protected]

For questions related to the use of this software and your open source spectrometer, the same page links to the "plots-spectrometry" group.

API

Using your secret API token on your SpectralWorkbench.org profile, you can submit spectral via the API in JSON format:

POST to "https://spectralworkbench.org/spectrums.json"

The required parameters are:

{"spectrum": {
  "title": "Test spectrum",
  "data_type": "json",
  "data": [
    {"average": 64.3, "r": 69, "g": 46, "b": 78, "wavelength": 269.089 },
    {"average": 63.3, "r": 71, "g": 45, "b": 74, "wavelength": 277.718 },
    {"average": 64,   "r": 71, "g": 47, "b": 74, "wavelength": 291.524 },
    {"average": 64,   "r": 68, "g": 49, "b": 75, "wavelength": 303.604 }
  ]},
  "token": "00000000"
}

This will return a path (from the root URL by default) to the spectrum, as in: /spectrums/12345

Developers

Development is occurring at https://github.com/publiclab/spectral-workbench/; please fork and submit pull requests; for more guidelines on contributing to Public Lab projects, see http://publiclab.org/wiki/contributing-to-public-lab-software

If you're a developer, consider joining the Public Lab developer list, also at http://publiclab.org/wiki/developers

Testing

Before submitting changes, please run tests with rake test to ensure that your code passes.

Also run rake jasmine and navigate to http://localhost:8888 to check client-side tests.

New tests are also appreciated to increase coverage; Rails tests are in /test and Jasmine tests (JavaScript tests) are in /spec.


License

Spectral Workbench is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Spectral Workbench is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Spectral Workbench. If not, see http://www.gnu.org/licenses/.

More Repositories

1

plots2

a collaborative knowledge-exchange platform in Rails; we welcome first-time contributors! 🎈
Ruby
958
star
2

Leaflet.DistortableImage

A Leaflet extension to distort or "rubber sheet" images
JavaScript
270
star
3

mapknitter

Upload your own aerial images, position (rubbersheet) them in a web interface over existing map data, and share via web or composite and export for print.
Ruby
267
star
4

community-toolbox

Tools to understand and welcome people into a contributor community
JavaScript
141
star
5

webjack

a JavaScript library that uses an audio software modem to communicate with an Arduino via a headphone jack
JavaScript
136
star
6

leaflet-environmental-layers

Collection of different environmental map layers in an easy to use Leaflet library, similar to https://github.com/leaflet-extras/leaflet-providers#leaflet-providers
JavaScript
99
star
7

PublicLab.Editor

A general purpose, JS/Bootstrap UI framework for rich text posting. An author-friendly, minimal, mobile/desktop interface for creating blog-like content, designed for PublicLab.org
JavaScript
79
star
8

spectral-workbench.js

The JavaScript heart of Spectral Workbench; a Public Lab project to record, manipulate, and analyze spectrometric data.
JavaScript
46
star
9

infragram

A minimal core of the Infragram.org project in JavaScript
HTML
44
star
10

simple-data-grapher

Turns CSVs into graphs in a few simple steps; embeds onto other websites!
JavaScript
38
star
11

leaflet-blurred-location

A Leaflet-based interface for selecting a "blurred" or low-resolution location, to preserve privacy
JavaScript
35
star
12

inline-markdown-editor

An inline wysiwyg markdown document editor based on replacing string subsections. WYSIWYG possible via woofmark.
JavaScript
30
star
13

pi-builder

Developing a reproducible build script system for making Raspberry Pi .img files
Ruby
22
star
14

leaflet-multispectral

Multispectral color manipulation and processing (NDVI etc) for Leaflet image overlays with pure JavaScript in Image Sequencer
HTML
22
star
15

plotsbot

A bot for Public Lab
JavaScript
17
star
16

papercraft-spectrometer

An introductory papercraft spectrometry kit
13
star
17

sky-camera

Public Lab's Android Aerial Acquisition App
Java
12
star
18

spectrometer3

Public Lab's open source Desktop Spectrometry Kit
11
star
19

leaflet-blurred-location-display

A library to display points which have been "blurred" for privacy with leaflet-blurred-location
JavaScript
11
star
20

SmART-Form

A community science effort to measure formaldehyde in the home environment
Java
9
star
21

webjack-firmata

A wrapper for WebJack to use as transport layer for firmata.js, for firmata access to an Arduino from a web browser.
JavaScript
9
star
22

mapmill

A Hot-or-Not styled crowdsourcing engine for sorting raw map imagery
HTML
8
star
23

colorimetry

A web-based colorimetry toolkit, using Image Sequencer
JavaScript
8
star
24

infragram-ps

Contents of the SD card to be used on the Infragram Point and Shoot - an open hardware multispectral camera developed by Public Lab: http://infragram.org
7
star
25

image-sequencer-app

An Image Processing server based on image-sequencer
JavaScript
7
star
26

community-microscope

Community Microscope design files
G-code
6
star
27

leaflet-tile-filter

Multispectral color manipulation and processing (NDVI etc) for Leaflet tile layers with pure JavaScript in Image Sequencer
HTML
6
star
28

mapknitter-exporter

The GDAL/ImageMagick-based exporter system from MapKnitter
Ruby
5
star
29

blurred-location

A JavaScript library to help manage variable location privacy through a "blurred location" model
JavaScript
4
star
30

mapknitter-exporter-sinatra

A minimal Sinatra app to run MapKnitter exports in the cloud
Ruby
3
star
31

plots-leaflet-viewer

A leaflet-based TMS viewer which accepts a TMS URL as a GET parameter. Good for fullscreen map viewing and embedding.
HTML
2
star
32

wherewebreathe

JavaScript
2
star
33

spectralchallenge

a website for Public Lab's Spectral Challenge, at http://spectralchallenge.org
JavaScript
1
star
34

lego-spectrometer

Design files for the Public Lab Lego Spectrometer
1
star
35

thermal-flashlight

Files for the Thermal Flashlight project
C++
1
star
36

multibot

A general-purpose Node.js bot library for writing interactive bot behaviors on various platforms
JavaScript
1
star
37

unearthing-pvd

A platform for historical data-driven analyses of industrial land use, story-mapping, and community organizing. (dataset)
1
star
38

publiclab-kits

Tracker for manufacturing issues for Public Lab kits
1
star
39

spectral-workbench-mobile

PhoneGap-based mobile app version of SpectralWorkbench.org, focus on iOS
JavaScript
1
star
40

SWBSearchModule

The spectral search module for the Spectral WorkBench
Python
1
star
41

leaflet-archive

A Leaflet map that displays geocoded images from Archive.org
JavaScript
1
star