Skip to content

mboufatah/spectraplotpy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spectraplotpy

A spectrum manipulation library.

Getting started

spectraplotpy helps you with common task when analaysing spectral data, it provides functionalities for reading and writing several data formats, process and plot several kinds of spectra.

In order to install the library you download this repository and build the package with setup tools,

$ git clone https://github.com/odarbelaeze/spectraplotpy.git
$ cd spectraplotpy
$ python setup.py install

Loading a generic spectrum from an Aviv formated file:

from spectraplotpy import AvivImporter
from spectraplotpy import Spectrum
a = AvivImporter('filename')
s = Spectrum(a.dataset)

Plotting the spectrum with the default plot settings,

import matplotlib.pyplot as plt
s.plot(plt)
plt.show()

Exporting the spectrum to a CSVFile:

from spectraplotpy import CSVExporter
csve = CSVExporter(s.dataset)
csve.save('myspectrum.csv')

Development setup

The basic dependencies to develop the project are,

matplotlib
scipy
numpy
pytest # For testing
sphinx # For documentation
pylint # For pep-8 compilance

You can install de dependecies through pip,

$ pip install matplotlib scipy numpy pytest sphinx pylint

or just let the setup script to install them for you.

In order to develop using virtual env, within your virtual env just call

$ python setup.py develop

this will allow you to do import spectraplotpy anywhere in your filesystem.

Testing

Once you get everything set up, you can run the tests using,

python setup.py test

Before you do a pull request make sure your code agrees with pylint (as far as possible) and passes all tests.

In order to run the tests for the Importer classes you'll need to provide some sample data available trough the trello board.

About

A spectrum manipulation library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 82.9%
  • Shell 17.1%