mriener / gausspyplus

Fully automated Gaussian decomposition package for emission line spectra
46 stars 14 forks source link
decomposition python-packages spectra

About

GaussPy+ is a fully automated Gaussian decomposition package for emission line spectra. For a detailed description about the package and results of tests performed on synthetic spectra and a test field from the Galactic Ring Survey (Jackson et al. 2006) please see:

Riener et al. 2019

GaussPy+ is based on GaussPy: A python tool for implementing the Autonomous Gaussian Decomposition algorithm. For a description about the Autonomous Gaussian Decomposition algorithm please see:

Lindner et al. 2015

For tips on how to get started with GaussPy+ see the section Getting started further below and check the Frequently asked questions.

Version

The currently recommended version of GaussPy+ is v0.2 (stable version released on 2020-05-19). See the GaussPy+ Changelog for an overview of the major changes and improvements introduced in this version.

New updates to the code are first tested and developed in the dev branch. Users cloning the dev branch should beware that these versions are not guaranteed to be stable.

Installation

Dependencies

You will need the following packages to run GaussPy+. We list the version of each package which we know to be compatible with GaussPy+.

If you do not already have Python 3.5, you can install the Anaconda Scientific Python distribution, which comes pre-loaded with numpy and scipy.

Optional Dependencies

If you wish to use optimization with Fortran code you will need

Download GaussPy+

Download GaussPy+ using git $ git clone https://github.com/mriener/gausspyplus

Installing Dependencies on Linux

You will need several libraries which the GSL and scipy libraries depend on. Install these required packages with:

sudo apt-get install libblas-dev liblapack-dev gfortran libgsl0-dev

Install pip for easy installation of python packages:

sudo apt-get install python-pip

Then install the required python packages:

sudo pip install astropy lmfit networkx numpy scipy tqdm

Install the optional dependencies for plotting and optimization:

sudo pip install matplotlib
sudo apt-get install libgsl0-dev

Installing Dependencies on OSX

Installation on OSX can be done easily with homebrew. Install pip for easy installation of python packages:

sudo easy_install pip

Then install the required python packages:

sudo pip install numpy scipy lmfit astropy networkx tqdm

Install the optional dependencies for plotting and optimization:

sudo pip install matplotlib
sudo brew install gsl

Installing GaussPy+

To install make sure that all dependences are already installed and properly linked to python --python has to be able to load them--. Then cd to the local directory containing GaussPy+ and install via

python setup.py install

If you don't have root access and/or wish a local installation of GaussPy+ then use

python setup.py install --user

Getting started

You can find an example decomposition run with GaussPy+ in the example directory. All individual scripts can be run via the Jupyter notebook Tutorial_example-GRS.ipynb.

The Jupyter notebook Tutorial_decompose_single_spectrum.ipynb illustrates the functionality of GaussPy+ and allows users to play around with the different parameter settings to determine their effects on the decomposition.

Some advice for decomposition runs with GaussPy+

We recommend to first test the GaussPy+ settings on a small subsection of the dataset and check whether the chosen parameter values lead to good fitting results. GaussPy+ includes many helper functions that allow users to easily create a subcube of the dataset to use for the test run.

We tested the default settings of GaussPy+ on different spectral cubes of CO isotopologues, which yielded good decomposition results for all tested datasets. However, if you find that the fitting results are insufficient or stumble upon problems we recommend that you first try the following steps:

Frequently asked questions

See FAQ.

Citing GaussPy+

If you make use of this package in a publication, please consider the following acknowledgements:

@ARTICLE{2019A&A...628A..78R,
       author = {{Riener}, M. and {Kainulainen}, J. and {Henshaw}, J.~D. and
         {Orkisz}, J.~H. and {Murray}, C.~E. and {Beuther}, H.},
        title = "{GAUSSPY+: A fully automated Gaussian decomposition package for emission line spectra}",
      journal = {\aap},
     keywords = {methods: data analysis, radio lines: general, ISM: kinematics and dynamics, ISM: lines and bands, Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - Astrophysics of Galaxies},
         year = "2019",
        month = "Aug",
       volume = {628},
          eid = {A78},
        pages = {A78},
          doi = {10.1051/0004-6361/201935519},
archivePrefix = {arXiv},
       eprint = {1906.10506},
 primaryClass = {astro-ph.IM},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2019A&A...628A..78R},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Lindner2015L,
       author = {{Lindner}, Robert R. and {Vera-Ciro}, Carlos and {Murray}, Claire E. and
         {Stanimirovi{\'c}}, Sne{\v{z}}ana and {Babler}, Brian and
         {Heiles}, Carl and {Hennebelle}, Patrick and {Goss}, W.~M. and
         {Dickey}, John},
        title = "{Autonomous Gaussian Decomposition}",
      journal = {\aj},
     keywords = {ISM: atoms, ISM: clouds, ISM: lines and bands, line: identification, methods: data analysis, techniques: spectroscopic, Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - Astrophysics of Galaxies},
         year = "2015",
        month = "Apr",
       volume = {149},
       number = {4},
          eid = {138},
        pages = {138},
          doi = {10.1088/0004-6256/149/4/138},
archivePrefix = {arXiv},
       eprint = {1409.2840},
 primaryClass = {astro-ph.IM},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2015AJ....149..138L},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

Citation courtesy of ADS.

Please also consider acknowledgements to the required packages in your work.

Feedback

We would love to get your feedback on GaussPy+. If you should find that GaussPy+ does not perform as intended for your dataset or if you should come across bugs or have suggestions for improvement, please get into contact with us or open a new Issue or Pull request. We are also happy to give support and advice on the decomposition.

Contributing to GaussPy+

To contribute to GaussPy+, see Contributing to GaussPy+.