# [AstroPy] Fitting a 2D Gaussian Model

Tue Feb 21 15:42:40 EST 2017

```Hi Bruno,

The theta values in the model are not restricted to a particular range
(e.g. [0, 179] or [0, 359]).  What you are seeing are 180 degree
degeneracies of the Gaussian2D model with theta, e.g. theta = -625 is
identical to theta = 95 or theta = 275.

Also note that there is a more subtle 90 degree degeneracy with theta where
the x_stddev and y_stddev are flipped, e.g. x_stddev=10, y_stddev=5,
theta=0 is identical to x_stddev=5, y_stddev=10, theta=90.

Cheers,
Larry

On Tue, Feb 21, 2017 at 1:52 PM, Bruno O. Sánchez <
bruno.sanchez.63 at gmail.com> wrote:

> Hello!
>
> I'm currently playing with the modeling module,
> using models and fitting, and I have encountered difficulties
> in how to understand the values of theta that the fit delivers.
>
> I'm looping through several ellipticities, and I obtain theta angle values
> that can bu up to a several hundred, even in negative values.
>
> This is the code snippet to fit the gaussians is on this link.
> http://dpaste.com/3HW8J4Y
>
> The output I've got is pasted here:
> http://dpaste.com/3SJ6DDP
>
> Could someone help me to understand why is this happening?
> As something intesting if I plot the true and fitted gaussian using
> pyplot.imshow()
> they look pretty similar.
>
> Thanks!
> --
> Bruno
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> https://mail.scipy.org/mailman/listinfo/astropy
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20170221/4bd0aa7c/attachment.html>
```