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 (spectrum_A / spectrum_B )
- Spectral subtraction (spectrum_A - spectrum_B)
- Powers/exponents (spectrum ** x)
Further documentation can be found on read the docs.
Note:
When the spectra have different wavelength vectors spectrum_overload interpolates
to the wavelength of the first spectrum. This may not suit your requirements.
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(flux, xaxis)
or :
from spectrum_overload.spectrum import Spectrum as spec
...
my_spectrum = spec(flux, xaxis)
or however else you would like to name 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.
Python 2.7
Python 2.7 is only supported in versions <0.2.1 (also available on pip) to make use of useful python3 features.
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)?
Metadata
Release files for spectrum-overload 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| spectrum_overload-0.3.tar.gz | 858.0 kB | Without provenance | Details for spectrum_overload-0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spectrum_overload-0.3-py3-none-any.whl | Python 3 | none | any | Details for spectrum_overload-0.3-py3-none-any.whl |
Total release size: 1.1 MB
Release files / spectrum_overload-0.3.tar.gz
| Download URL | spectrum_overload-0.3.tar.gz |
|---|---|
| Size | 858.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
04f9ab396fb0dae662be7b38f86f101ef9eb9e1ecc5a5faff91494ab9df5cb68
|
|
BLAKE2b-256 checksum How to use checksums |
ba9ab7b911c3e1e5374aad50c89213972e4e5f76f19893eb95df49c421679772
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5
|
Release files / spectrum_overload-0.3-py3-none-any.whl
| Download URL | spectrum_overload-0.3-py3-none-any.whl |
|---|---|
| Size | 286.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06c14bd397e200c5ff5e093a78f8a51ae6b484e846d66583301824ac84ddb7a4
|
|
BLAKE2b-256 checksum How to use checksums |
a934474a016a6c1e81470c8ebb2ce2a21ff3f79a02e15f6d0e29f8d15cae0ce1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5
|
Security for spectrum-overload 0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.