[AstroPy] AstroPy Digest, Vol 125, Issue 4

Fabricio Ferrari fabricio.ferrari at gmail.com
Wed Feb 15 07:14:49 EST 2017


Dear Andrzej

here it seemed to work. Maybe the version you are using.

Here I have:

In [2]: np.__version__
Out[2]: '1.11.1'

In [4]: astropy.__version__
Out[4]: u'1.2.1'


My output:


DATA:
Model: Ellipse2D
Inputs: (u'x', u'y')
Outputs: (u'z',)
Model set size: 1
Parameters:
    amplitude x_0 y_0  a   b  theta
    --------- --- --- --- --- -----
          1.0 0.0 0.0 2.0 1.0   0.0


MODEL:
Model: Ellipse2D
Inputs: (u'x', u'y')
Outputs: (u'z',)
Model set size: 1
Parameters:
      amplitude    x_0 y_0  a   b  theta
    -------------- --- --- --- --- -----
    0.338211382114 0.1 0.1 3.0 2.0   0.2




p.s. thank you for letting me know about the Ellipse2D fit, that I indeed
need and did not know about.

Regards

Fabricio



..-. ..-.
Fabricio Ferrari       [www.ferrari.pro.br]
IMEF -  FURG
Rio Grande, RS
Brasil

2017-02-09 10:00 GMT-02:00 <astropy-request at scipy.org>:

> Send AstroPy mailing list submissions to
>         astropy at scipy.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mail.scipy.org/mailman/listinfo/astropy
> or, via email, send a message with subject or body 'help' to
>         astropy-request at scipy.org
>
> You can reach the person managing the list at
>         astropy-owner at scipy.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of AstroPy digest..."
>
>
> Today's Topics:
>
>    1. Ellipse2D fit (Andrzej Szary)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 8 Feb 2017 16:40:07 +0100
> From: Andrzej Szary <aszary at gmail.com>
> To: astropy at scipy.org
> Subject: [AstroPy] Ellipse2D fit
> Message-ID:
>         <CAOGYrkXrsAhLfdjyLjUPEQk_aYTkwD9Dn6UZOhbZgo4iaMfBAw@
> mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hello,
>
> I am struggling with  fitting an ellipse using Ellipse2D model. The fitting
> procedure does not seem to have any effect on ellipse parameters (maybe
> except amplitude).
>
> Please find a test code at the end of this email.
>
> Best wishes,
> Andrzej Szary
>
>
> import numpy as np
> from astropy.modeling import models, fitting
> import matplotlib.pyplot as pl
>
> # data
> num = 100
> x, y = np.meshgrid(np.linspace(-5., 5., num), np.linspace(-5, 5, num))
> e0 = models.Ellipse2D(amplitude=1., x_0=0., y_0=0., a=2, b=1, theta=0.)
> z0 = e0(x, y)
> print 'DATA:\n', e0, '\n\n'
>
> # initial model
> ei = models.Ellipse2D(amplitude=1., x_0=0.1, y_0=0.1, a=3, b=2, theta=0.2)
> fi = fitting.LevMarLSQFitter()
>
> # fitted model?
> e1 = fi(ei, x, y, z0)
> z1 = e1(x, y)
> print 'MODEL:\n', e1, '\n\n'
>
> pl.imshow(z0, extent=[-5, 5, -5, 5], alpha=0.5)
> pl.imshow(z1, extent=[-5, 5, -5, 5], alpha=0.2)
> pl.show()
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://mail.scipy.org/pipermail/astropy/attachments/
> 20170208/dd96824c/attachment-0001.html>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> https://mail.scipy.org/mailman/listinfo/astropy
>
>
> ------------------------------
>
> End of AstroPy Digest, Vol 125, Issue 4
> ***************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20170215/56114ebc/attachment.html>


More information about the AstroPy mailing list