[AstroPy] Gaussian with constant background

Ian Crossfield ianc@ucla....
Wed Jun 27 16:36:31 CDT 2012


I have also had good results with the Kapteyn package, which has an 
updated implementation of MPFIT.
http://www.astro.rug.nl/software/kapteyn/kmpfit.html

-Ian

On 6/27/12 1:15 PM, Taro Sato wrote:
> On Wed, Jun 27, 2012 at 1:10 PM, Vivienne Baldassare
> <vivienne.baldassare@gmail.com>  wrote:
>> Hello,
>>
>> I've been trying to figure out how to fit a gaussian with a constant
>> (non-zero) background.  Aside from just subtracting off the background, I
>> haven't been able to do it, and googling around was not particularly
>> helpful.  I'd appreciate any tips!
>
>
> Why don't you learn how to use some generic non-linear fitting routine
> like scipy.optimize.leastsq?  Once you learn how to do this, you can
> basically fit any analytical function you like.  A few good examples
> in the following page:
>
> http://www.scipy.org/Cookbook/FittingData
>
>
>

-- 
Ian Crossfield
UCLA Astronomy and
Max-Planck Institüt für Astronomie
http://www.astro.ucla.edu/~ianc/



More information about the AstroPy mailing list