Gaussian fit with offset

135 views
Skip to first unread message

Stefan Reich

unread,
Jun 23, 2017, 5:46:25 AM6/23/17
to astropy-dev
Dear all,
I'm new here, because I want to use the Gaussian-Fit of astropy but I need also to fit the offset of the gaussian. Until now it is not implemented, so I wanted to ask, if this could be done. Simple tests showd me, that the fit in the actual version breaks down, if there is an offset. I unfortunatly did not manage to simply add the offset in the functional_models.py file.
In the end I need the 2d-gaussian model with an offset, but also the 1d would be nice.

I can only help with math and simple coding. The way of programming with all these subfunktions as astropy is done, I'm not familiar with.

It would be great, if someone can help me.

Greetings,
Stefan

matteobach...@gmail.com

unread,
Jun 23, 2017, 4:53:02 PM6/23/17
to astropy-dev
Hi Stefan,
I don't know if I'm missing something, but have you tried to create a composite model? something like
model = Gaussian1D()+Const1D()

I often fit Gaussians with a constant offset, and this works well.

Cheers,

Matteo

Stefan Reich

unread,
Jun 26, 2017, 8:53:38 AM6/26/17
to astropy-dev
Hi Matteo,
yes thank you, this works well. I just startet with astropy and I'm not so familiar with the algorithm logic. Looks a bit unconvenient for me, as long as you are new in the topic. A Note in the Documentation would have been very helpfull for me.

Thanks for help!
Stefan
Reply all
Reply to author
Forward
0 new messages