A simple tool to manipulate and visualize optical spectra for astronomical research.
numpy
scipy
astropy
pyqtgraph
pyqt5
specutils
matplotlib
pandas
PyAstronomy
To install the latest version of specbox, run the following command in your terminal:
git clone https://github.com/rudolffu/specbox.git
cd specbox
python -m pip install .
The main classes and functions of specbox are:
SpecLAMOST
andSpecSDSS
: classes to read and manipulate spectra from the LAMOST and SDSS surveys, respectively.SpecIRAF
: class to read and manipulate spectra from the IRAF format.
PGSpecPlot
: class to plot spectra in apyqtgraph
plot.PGSpecPlotApp
: class to create apyqtgraph
plot with aQApplication
instance.PGSpecPlotThread
: class to create apyqtgraph
plot in a thread.
from specbox import SpecLAMOST
spec = SpecLAMOST('input_file.fits')
spec.plot()
# Smooth the spectrum
spec.smooth(5, 3, inplace=False)
from specbox import SpecLAMOST
from specbox.qtmodule import PGSpecPlotThread
from glob import glob
basepath = 'lamost_spec/fits_files/'
flist = glob(basepath+'*fits.gz')
flist.sort()
flist = flist[0:60]
a = PGSpecPlotThread(speclist=flist, SpecClass=SpecLAMOST, output_file='vi_output_test60.csv')
a.run()