Getting Started

Introduction

This is a package to coadd images. Currently, there is no fast python package to resample image. Therefore, coadd relies on the swarp softare to perform the resampling. This will be replaced in the future once a fast python resampling package is written.

There are five main modules:

  • driver: Decomposes all of the spectra in a datacube.

  • fitter: Does the actual Gaussian Decomposition.

  • cube: Contains the Cube class for a data cube.

  • spectrum: Contains the Spectrum class for a single spectrum.

  • utils: Various utility functions.

There is a class for data cubes called Cube and a class for spectra called Spectrum.

To fit a single spectrum you first need to create the Spectrum object.

from gaussdecomp import spectrum,fitter
sp = spectrum.Spectrum(flux,vel)   # flux and velocity arrays
out = fitter.gaussfit(sp)          # do the fitting

You can make a nice plot using gplot().

from gaussdecomp import utils
utils.gplot(vel,flux,par)

Gaussian Fit to Spectrum

To fit an entire datacube, you can either give the driver code a datacube object you have already created or give it a FITS filename.

from gaussdecomp import cube,driver
# Load the cube first
datacube = cube.Cube.read('mycube.fits')
gstruc = driver.driver(datacube)

# Give it the FITS filename
gstruc = driver.driver('mycube.fits')

See the Examples page for some examples of how Python |gaussdecomp| runs.