Skip to content

specbox - A simple tool to manipulate and visualize optical spectra for astronomical research.

License

Notifications You must be signed in to change notification settings

rudolffu/specbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

specbox

A simple tool to manipulate and visualize optical spectra for astronomical research.

Installation

Dependencies

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 .

Usage

Main classes and functions

The main classes and functions of specbox are:

basemodule.py:

  • SpecLAMOST and SpecSDSS: classes to read and manipulate spectra from the LAMOST and SDSS surveys, respectively.
  • SpecIRAF: class to read and manipulate spectra from the IRAF format.

qtmodule.py:

  • PGSpecPlot: class to plot spectra in a pyqtgraph plot.
  • PGSpecPlotApp: class to create a pyqtgraph plot with a QApplication instance.
  • PGSpecPlotThread: class to create a pyqtgraph plot in a thread.

Examples

Plotting a spectrum from the LAMOST survey

from specbox import SpecLAMOST

spec = SpecLAMOST('input_file.fits')
spec.plot()
# Smooth the spectrum
spec.smooth(5, 3, inplace=False)

Run a PGSpecPlotThread for visual inspection of a list of spectra

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()

About

specbox - A simple tool to manipulate and visualize optical spectra for astronomical research.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages