[AstroPy] RA-Dec to Alt-Az using Astropy 1.0
Christoph Deil
deil.christoph at googlemail.com
Wed Mar 11 05:03:15 EDT 2015
> On 11 Mar 2015, at 09:47, Akshat Singhal <akshat.singhal014 at gmail.com> wrote:
>
> Hi all,
>
> For some of my calculation I want to convert RA-Dec coordinates of a star to Alt-Az coordinates (for given location and time),
> make some other computations and then convert Alt-Az back to RA-dec.
> First conversion is easy, I am not able to figure out how to convert Alt-Az to RA-Dec in Astropy 1.0
> Any insight to this will be a lot helpful
>
> Thanks and regards
> Akshat Singhal
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
Hi Akshat,
to transform an from Alt-Az to Ra-Dec, you should create a SkyCoord with an AltAz frame and then call it’s `transform_to(‘icrs')` method or access it’s `.icrs` attribute.
There’s an example here in the Astropy tests:
https://github.com/astropy/astropy/blob/master/astropy/coordinates/tests/accuracy/test_altaz_icrs.py#L81 <https://github.com/astropy/astropy/blob/master/astropy/coordinates/tests/accuracy/test_altaz_icrs.py#L81>
I think it would be nice to add an example involving AltAz to the docs here:
http://astropy.readthedocs.org/en/latest/coordinates/transforming.html <http://astropy.readthedocs.org/en/latest/coordinates/transforming.html>
Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20150311/dbe96892/attachment.html>
More information about the AstroPy
mailing list