Cube Gaussfit

While neat, this code has some unfortunate hacks in it and is quite slow because it uses loops instead of vectorizing. I don't know how to vectorize a Levenberg-Marqardt least-squares fitting routine, though. This was primarily written for use on CO 3-2 data from the JCMT.

If you're interested in 2D Gaussian fitting, look at my 2D gaussian fitting page
readfile("python/collapse_gaussfit.py"); ?>

I rewrote the MAD (median absolute deviation) code found in scipy.stats.stats because in numpy version 1.0.1 there was an error related to 1-dimensional arrays. This error has been corrected in numpy 1.0.4 and therefore this code does not need to be used if you have that version. readfile("python/mad.py"); ?>