Spectrum class that overloads operators.
Project description
spectrum_overload
Overview
The purpose of this was project was to learn how to use and create Classes, and to create a Spectrum object to use within my Phd work.
The main goals of this project are basically complete.
- create a class to contain spectrum
- automatic interpolation
- overloaded operators especially
- Spectral division (SpectrumA / SpectrumB )
- Spectral subtraction (SpectrumA - SpectrumB)
- Powers/exponents (Spectrum ** x)
Further documentation can be found on read the docs.
Installation
Pip
pip install spectrum-overload
git / manual
Currently to install and use Spectrum class for your own projects.
clone the git repository where you want it then type:
git clone https://github.com/jason-neal/spectrum_overload.git
cd spectrum_overload
python setup.py install
or python setup.py develop
if you want to make changes.
Usage
To use import the class using :
from spectrum_overload import Spectrum
...
my_spectrum = Spectrum.Spectrum(flux, xaxis)
or :
from spectrum_overload.Spectrum import Spectrum as spec
...
my_spectrum = spec(flux, xaxis)
or how ever else you would like to import it.
A tutorial is provided here to show an example of how to use this class.
Contributions
Contributions are very welcome.
I would really appreciate user feedback or suggested improvements if you have any.
Feel free to submit issues or create pull requests.
Other Spectrum Classes
There are many other spectrum classes around but I didn't see any that overload the operators. (I could be blind).
One of these may better suit your needs
- https://github.com/crawfordsm/specreduce
- https://github.com/crawfordsm/pyspectrograph/tree/master/PySpectrograph/Spectra
- http://pyspeckit.bitbucket.org/html/sphinx/spectrum.html#pyspeckit.spectrum.classes.Spectrum
- https://github.com/cokelaer/spectrum
- https://github.com/astropy/specutils
Wow A lot. I probably should not reinvent the wheel too much then...
It turns out that astropy/specutils is very similar to what I have created but its direction is uncertain at the moment and they do not use overloaded operators and will not implement in the foreseeable future.
TO DO
Some tasks still to do:
- Improve Documentation
- Generate Calibration solution (outside spectrum class)?
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for spectrum_overload-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a71a4befba8275aff55c6b2ff017931b2eda7c5ddc0079412d9abec3b328d50d |
|
MD5 | 5cf7effae008fe5cd4898ae4b8ad7ab7 |
|
BLAKE2b-256 | e1d5ccf4e682ba539923d602694568a6c09bf6b6ece53d1ec4e97b7c629f4e59 |