pep8 cleanups; use fmin_tnc for fitting to incorporate bounds on parameters; fit a function to flat field profile and use that to flatten profiles before fitting.