• Stars
    star
    1,369
  • Rank 34,342 (Top 0.7 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created almost 7 years ago
  • Updated over 3 years ago

Reviews

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

Repository Details

Open Source Spectrometer Python Scripts

Spetrometer Python

Build Status Gitter

This repository provides scripts for the open spectrometer project to enable practitioners, students and citizen scientists to collect data with their spectrometer and have a good and fun learning experience. Enjoy!

The open spectrometer project consists of a web cam, simple lasercut parts, battery casing and a suitable LED lightning component. The spectrometer connects to a computer via USB, where the user can run the scripts provided in this repository to run experiments and take measurements. The two main components of this repository are analyse.py and calibrate.py. The analyse.py script is used to plot the absorbance spectra of measurements taken with a webcam spectrometer. The calibrate.py is useful for advanced users who want to understand the mechanics of scientific measurements and understand how to assess the quality of the data generated.

Open Science and Background

By definition science should be open and reproducible. So, the outcome of an experiment can be verified by anyone. Unfortunately today this is not always the case. In order to be able to verify experiments all components used should be openly accessible. This includes the software and hardware of scientific instruments. Our spectrometer project follows this path. By giving access to all layers of the device used in a scientific experiment users can develop a deep understanding how scientific measurements are taken and practitioners are able to critically understand the limitations of one particular instrument.

Communication

The spectrometer community is still small. There are overlaps with the Pocket Science Lab team. To stay connected with different community members we continue to use the PSLab Gitter channel for the beginning. We will set up a dedicated channel once the project is more established. Please join us here:

Features and Implementation Status

Feature Description Status
USB Connection Transmit data using USB from a compatible spectrometer to a computer ✔️
Generate PNG Run the software on www.spectralworkbench.org with samples ✔️
Calibration Calibrate using calibrate.py and report in analyse.py ✔️
Scripts in Browers Scripts can be executed in the browser using repl.it ✔️
Scripts Locally Scripts can be executed on the computer without Internet
Generate PNG Locally Generate png images from collected data without Internet service

Services used

  • We use repl.it to run the Python script in the browser repl.it/@DIYanalytics/analysepy to facilitate the use of the spectrometers to non programmers
  • The script takes the png file from the experiment data from the web service of spectralworkbench.org and plots the analysis of those data

How to use analyse.py to do experiments and collect data

  1. Connect the spectrometer via USB to your computer
  2. Transfer the liquid sample in the cuvette (liquid container for spectroscopy) and locate it in the spectrometer. Incase of chlorophyll A and B, you might do your own extraction and separation.
  3. Take measurements with the webcam spectrometer using the spectral workbench mentioned above.
  4. Insert the filename of your reference into the referenceFile slot, and all the filenames of the samples into the samples slot, separated by a comma.
  5. Insert the desired title of the plot below and headers for the legend.
  6. View the outcome of your measurements and the script and compare the plot obtained with the spectral absorbance of chlorophyll A and B found in literature (Search online for absorbance of chlorophyll).

How to calibrate your device with calibrate.py

Calibrating a spectrometer means referencing the values that otherwise would represent pixels, and turning them into wavelengths, which is what the spectrometer is meant to measure. In order to create a correlation between pixels and wavelengths, a mercury light bulb is used, a compact fluorescent light (CFL). Because of its sharp emission peaks, it is possible to assign to some pixels some specific wavelength values and infer all the others.

As a reference you can use Wikipedia to view an image for the fluorescent lightning spectrum here .

Steps to use calibrate.py:

  1. Run the script calibrate.py with the file produced with the compact fluorescent light (CFL).
  2. Use the magnification lens to note at which pixel corresponds which peak in the plot of the wikipedia reference.
  3. Take at least 3 correlations, but the more, the better.
  4. Open the main script, and insert (replace) in increasing order the pixel and wavelenghts previously noted in the respective slots.

Contribution

This project was started by Alessandro Volpato. We welcome new contributors and feedback of users from around the world. Thank you!

License

This projects is licensed under Apache v.2.0.

More Repositories

1

bodyapps-viz

3D body visualizer component for #bodyapps project
JavaScript
1,501
star
2

open-spectrometer-hardware

Open source VIS spectrometer
Python
1,431
star
3

parliament-scraper

Public Data Scraper for Parliament Data for the EU and other Parliaments
Python
1,395
star
4

bodyapps-android

Bodyapps Measurement App
Java
1,394
star
5

ots15-companion

Opentech Event app
Java
1,384
star
6

libredesktop-meta

SoerenX-Plugin for Custom Search, Tiles, Snippets
1,383
star
7

mvisc

Mobile Visual Classification (MVISC) is a project to identify and classify animals.
HTML
1,377
star
8

opentechsummit.de

OpenTechSummit Germany https://opentechsummit.de
CSS
1,376
star
9

2015.opentechsummit.de

Website of OpenTechSummit 2015 http://2015.opentechsummit.de
CSS
1,375
star
10

opntec-artwork

OpnTec Artwork
HTML
1,373
star
11

2016.opentechsummit.de

Website of OpenTechSummit 2016 http://2016.opentechsummit.de
CSS
1,372
star
12

bodyapps-web

Web service and web application components of #bodyapps project
Ruby
1,371
star
13

2017.opentechsummit.de

OpenTechSummit 2017 http://2017.opentechsummit.de
CSS
1,369
star
14

2018.opentechsummit.de

OpenTechSummit 2018 http://2018.opentechsummit.de
CSS
1,369
star
15

open-event-android

Open Tech Events from around the world
Java
1,368
star
16

openxlab-artwork

OpenXlab Artwork
1,366
star
17

opentechsummit.eu

OpenTechSummit Europe https://opentechsummit.eu
Less
1,366
star
18

opentechsummit.in

OpenTechSummit India
HTML
1,365
star
19

hdf

human definition file format
1,363
star
20

parliament-scraper-artwork

Parliament Scraper Artwork
1,362
star
21

2015.opentechsummit.net

OpenTechSummit Meetups 2015 https://2015.opentechsummit.net
HTML
1,362
star
22

2019.opentechsummit.net

OpenTechSummit 2019 https://2019.opentechsummit.net
HTML
1,361
star
23

opentechsummit.net

OpenTechSummit https://opentechsummit.net
HTML
1,361
star
24

2020.opentechsummit.cn

OpenTechSummit Meetups 2010
HTML
1,361
star
25

thai.opentechsummit.asia

OpenTechSummit Thailand 2019 https://thai.opentechsummit.asia
CSS
1,360
star
26

2016.opentechsummit.net

OpenTechSummit Meetups 2016 https://2016.opentechsummit.net
HTML
1,357
star
27

2018.opentechsummit.net

OpenTechSummit 2018 http://2018.opentechsummit.net
HTML
1,357
star
28

2017.opentechsummit.net

OpenTechSummit Meetups 2017 https://2017.opentechsummit.net
HTML
1,355
star
29

opentechsummit.asia

OpenTechSummit Asia https://opentechsummit.asia
HTML
1,355
star
30

fashionmaker

Fashion Robot
1,331
star
31

open-event-server

Python
1,222
star
32

2019.opentechsummit.de

OpenTechSummit 2019 https://2019.opentechsummit.de
Less
1,051
star
33

2018.opentechsummit.cn

OpenTechSummit 2018 https://2018.opentechsummit.cn
CSS
750
star
34

vn.opentechsummit.asia

https://vn.opentechsummit.asia
CSS
713
star
35

2022.opentechsummit.de

OpenTechSummit 2022 https://2022.opentechsummit.de
HTML
637
star
36

pycon.world

Pycon World Conference Series https://pycon.world
611
star
37

vietnam.pycon.world

HTML
597
star
38

singapore.pycon.world

HTML
596
star
39

srilanka.pycon.world

CSS
595
star
40

indochina.pycon.world

HTML
593
star
41

srilanka.opentech.asia

CSS
593
star
42

germany.pycon.world

HTML
592
star
43

china.pycon.world

HTML
590
star
44

opentech.asia

588
star
45

myanmar.opentech.asia

588
star
46

thaiday.opentech.asia

HTML
588
star
47

malaysia.opentech.asia

586
star
48

japan.opentech.asia

HTML
586
star
49

vietnam.opentech.asia

HTML
584
star
50

indochina.opentech.asia

HTML
583
star
51

devopssg.opentech.asia

HTML
583
star
52

cloudsg.opentech.asia

HTML
582
star
53

aisg.opentech.asia

HTML
582
star
54

delhiday.opentechsummit.in

HTML
581
star
55

south.opentechsummit.in

HTML
579
star
56

austria.opentechsummit.eu

HTML
579
star
57

thai.opentech.asia

HTML
578
star
58

2019.opentechsummit.cn

CSS
568
star
59

pycon.cn

Pycon China https://pycon.cn
536
star
60

kiku.ai

https://kiku.ai
HTML
457
star
61

opentechsummit.cn

OpenTechSummit China http://opentechsummit.cn
CSS
426
star
62

mbm.vn

HTML
398
star
63

libregraphics.asia

263
star
64

openxlab

HTML
193
star
65

2023.opentechsummit.de

HTML
19
star