[AstroPy] using astropy.coordinates.angular_separation()
John ZuHone
jzuhone at gmail.com
Thu Aug 10 12:02:55 EDT 2023
Hi Pierre,
I should note that you are looking at the page for the "stable" version of AstroPy, which is 5.3.1, whereas you are using a very old version of AstroPy, for which the docs are here:
https://docs.astropy.org/en/v2.0.16/coordinates/index.html#module-astropy.coordinates
Based on my casual look, this method is not in this old version. If you can, I highly recommend upgrading to the latest version, which also necessitates upgrading to Python 3.
Best,
John
> On Aug 10, 2023, at 11:58 AM, Didelon Pierre <pierre.didelon at cea.fr> wrote:
>
>
> Hi everyone
>
> I hope I am not disturbing you with a silly question :-/
>
> I try to use the astropy.coordinates.angular_separation() utility
> (https://docs.astropy.org/en/stable/api/astropy.coordinates.angular_separation.html)
> in python2.7 with astropy 2.0.16
> but it seems not available :-/
>
> here is the code
>
> import astropy.coordinates as ac
> ...
> angsep = ac.angular_separation (pix_c_coord[0]*pi/180.,pix_ra*pi/180.,pix_c_coord[1]*pi/180.,pix_dec*pi/180.) *180./pi
>
> and the error
>
> angsep = ac.angular_separation (pix_c_coord[0]*pi/180.,pix_ra*pi/180.,pix_c_coord[1]*pi/180.,pix_dec*pi/180.) *180./pi
> AttributeError: 'module' object has no attribute 'angular_separation'
>
> Did I miss something?
>
> Tank's in advance for any advice
>
> Pierre Didelon
>
> Astrophysic Department CEA Saclay
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org <mailto:AstroPy at python.org>
> https://mail.python.org/mailman/listinfo/astropy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/astropy/attachments/20230810/60e5fc31/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: astropy_logo.ico
Type: image/vnd.microsoft.icon
Size: 32988 bytes
Desc: not available
URL: <https://mail.python.org/pipermail/astropy/attachments/20230810/60e5fc31/attachment-0001.ico>
More information about the AstroPy
mailing list