Free software options include GDL (GNU Data Language) from http://gnudatalanguage.sourceforge.net/ together with Craig Markwardt's MPFIT curve fitting software from http://www.physics.wisc.edu/~craigm/idl/idl.html.
Craig's fitting routines are great for fitting curves and images. The software is written for IDL (Interactive Data Language), which is the commercial version of GDL. My group uses IDL and MPFIT extensively for image analysis.
GDL is an open-source interpreted language, and works under Ubuntu.
Open-source GDL (IDL) routines are freely available for reading FITS files.
I'd particularly recommend the routines from the IDL Astronomy User's Library at