重载运算符的谱类。
spectrum-overload的Python项目详细描述
频谱过载
概述
这个项目的目的是学习如何使用和创建类,并创建一个频谱对象,以便在我的博士工作中使用。
项目主要目标基本完成。
- 创建包含光谱的类
- 自动插值
- 重载运算符 尤其是
- 光谱分割(光谱a/光谱b)
- 谱减法(谱a-谱b)
- 功率/指数(光谱**x)
更多文档可以在read the docs上找到。
注意:
When the spectra have different wavelength vectors spectrum_overload interpolates
to the wavelength of the first spectrum. This may not suit your requirements.
安装
PIP
pip install spectrum-overload
Git/手动
目前正在为您自己的项目安装和使用Spectrum类。
将git存储库克隆到需要的位置,然后键入:
git clone https://github.com/jason-neal/spectrum_overload.git
cd spectrum_overload
python setup.py install
或者python setup.py develop
如果您想进行更改。
用法
要使用导入类,请使用:
from spectrum_overload import Spectrum
...
my_spectrum = Spectrum(flux, xaxis)
或:
from spectrum_overload.spectrum import Spectrum as spec
...
my_spectrum = spec(flux, xaxis)
或者你想给它起个名字。
提供了一个教程here来展示如何使用这个类的示例。
贡献
我们非常欢迎您的贡献。
如果您有任何改进,我将非常感谢用户的反馈或建议。
请随意提交问题或创建请求。
python 2.7
python 2.7仅在<;0.2.1版本(pip上也有)中受支持,以利用有用的python3特性。
其他频谱类别
有许多其他的频谱类,但我没有看到任何超载的运营商。(我可能是瞎子)。
其中之一可能更适合您的需要
- 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
哇太多了。我可能不应该再发明太多的轮子了…
结果发现astropy/specutils与我所创建的非常相似,但它的方向目前还不确定,它们不使用重载运算符,在可预见的将来也不会实现。
待办事项
还有一些任务要做:
- 改进文档
- 生成校准溶液(光谱类之外)?