A selection of the Python and C++ code can be browsed in the source repository.
I have also written detailed walkthroughs for installing IRAF on Ubuntu and installing PyRAF and STSDAS/TABLES on Ubuntu.
An Overview of the Code
The majority of the scripts require Python 2.4, NumPy, NumArray, SciPy, and PyFITS. Several of them variously require MatPlotLib, PyVTK, GCC and PyRAF. They are all intended to be used on Linux/Unix from the command line (and some work in Cygwin on Windows). The lists of arguments are either documented inside the Python scripts, or are self-explanatory. The DatacubeUtils directory contains re-usable functionality common to the scripts, including the self-compiling C++ extension.
- auto-deconvolve-cube.py
- Deconvolves each spectrum in the datacube along the wavelength axis using the hydrogen beta 4861 Angstrom line as the point spread function.
- construct-error-cube.py
- Calculates a datacube of error values for each spaxel using the empirical method documented in the project report.
- extract-regions-from-fits.py
- Extracts DS9-format regions from a datacube and averages each region into a single spectrum.
- fit-OIII-gaussians-chisq.py
- Performs a Gaussian decomposition of the OIII 4959 and 5007 Angstrom doublet in the FITS datacube spectra. Internal variables can be used to enable interactive plotting, Moffat functions and adaptive fitting. They can also be used to change the number of components fitted, the boundary constraints on the optimisation, and the regions over which chi-squared is calculated.
- fit-guided-by-OIII.py
- Derived from to fit-OIII-gaussians-chisq.py, this script uses the OIII fits to guide fits to the other lines.
- fit-walker-components-csv-list.py
- Uses Andrew Walker's hydrogen beta 4861 Angstrom components atlas to guide fits to other lines.
- flip-cube-axes.py
- Switches x and y axes of a FITS datacube.
- gnuplot-from-csv.py
- Converts a CSV file into a suitable format for Gnuplot's splot mode.
- gnuplot-from-datacube-slice.py
- Takes a constant-wavelength slice from a FITS datacube and converts it into a suitable format for Gnuplot's splot mode.
- gnuplot-from-datacube-spectrum-slice.py
- Takes an arbitrary "long-slit spectrum" slice from a FITS datacube and outputs it in a suitable format for Gnuplot's splot mode.
- gnuplot-from-datacube-spectrum.py
- Reads a single spectrum from a FITSdatacube and outputs it in a suitable format for Gnuplot's splot mode.
- gnuplot-from-spectrum.py
- Reads a single FITS spectrum and converts it into a suitable format for Gnuplot's splot mode.
- reconstruct-cube-from-components.py
- Generates a FITS datacube from a CSV components atlas.
- remove-cube-continuum.py
- Removes continuum from a datacube using IRAF.
- simple-complexity-metric.py
- Caculates a simple spectral width/complexity metric for a datacube.
- vtk-from-fits-datacube.py
- Converts a FITS datacube into VTK (Kitware/VolView) format.