<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi all</p>
<p>I am very puzzled by this issue of coordinate difference after a
direct/inverse transformation between AltAz and ICRS. Whatever the
origin is, it looks like in one of the two directions (direct or
inverse) there somewhere a transformation that is missing - but
not in both. <br>
</p>
<p>This could be related to a propagation of the earth rotation
direction, but also to other factors in principle. Maybe this
could be resolved by specifying some parameters to tune some
parameters in the trasformation, but given my limited knowledge of
astropy I do not know if this is possible...</p>
<p>Anyway, it looks like a check of self-consistency would be
appropriate here...<br>
</p>
<p>cheers<br>
</p>
<p>Paolo<br>
</p>
<p>On 26/11/2019 19:34, Benjamin Weiner wrote:<br>
</p>
<blockquote type="cite"
cite="mid:CAAKCKFGLHsL-y+a8NsY6WZgL4kbemgg8ALvUpnGZgPzOTn7_-A@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;font-size:small">Hi
Eric,</div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;font-size:small"><br>
</div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;font-size:small">The
precession that is causing this issue is the precession of
the earth relative to the axis of the ICRS coordinate
system, which is within an arcsec or so of J2000. The
example used July 2012 so the earth's axis is 12 years off
the coordinate system axis. Try the example again but with
an observation time in July 2000:</div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;font-size:small"><br>
</div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;font-size:small">time2
= Time('2000-07-12 23:00:00') - utcoffset<br>
m33altaz =
m33.transform_to(AltAz(obstime=time2,location=bear_mountain))<br>
</div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;font-size:small">new_altaz
= SkyCoord(AltAz(obstime=time2 + 0.5*u.sday,<br>
az=<a href="http://m33altaz.az"
moz-do-not-send="true">m33altaz.az</a>,<br>
alt=m33altaz.alt,<br>
location=bear_mountain))<br>
newradec = new_altaz.transform_to('icrs')<br>
print(m33.to_string('hmsdms'))<br>
print(newradec.to_string('hmsdms'))</div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;font-size:small">#
prints:<br>
# 01h33m50.904s +30d39m35.79s<br>
# 13h33m51.157s +30d39m20.5722s<br>
</div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;font-size:small"><br>
</div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;font-size:small">These
are much closer to 12 hours RA difference.</div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;font-size:small"><br>
</div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;font-size:small">cheers,</div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;font-size:small">Ben</div>
<div class="gmail_default"
style="font-family:arial,helvetica,sans-serif;font-size:small"><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Nov 26, 2019 at
12:01 PM <<a href="mailto:astropy-request@python.org"
moz-do-not-send="true">astropy-request@python.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">Send AstroPy mailing list
submissions to<br>
<a href="mailto:astropy@python.org" target="_blank"
moz-do-not-send="true">astropy@python.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a
href="https://mail.python.org/mailman/listinfo/astropy"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://mail.python.org/mailman/listinfo/astropy</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:astropy-request@python.org"
target="_blank" moz-do-not-send="true">astropy-request@python.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:astropy-owner@python.org"
target="_blank" moz-do-not-send="true">astropy-owner@python.org</a><br>
<br>
When replying, please edit your Subject line so it is more
specific<br>
than "Re: Contents of AstroPy digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: Convert from AltAz to ICRS (<a
href="mailto:keithmclaurin@gmail.com" target="_blank"
moz-do-not-send="true">keithmclaurin@gmail.com</a>)<br>
2. Re: Convert from AltAz to ICRS (Eric Jensen)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 26 Nov 2019 00:06:54 -0500<br>
From: <a href="mailto:keithmclaurin@gmail.com"
target="_blank" moz-do-not-send="true">keithmclaurin@gmail.com</a><br>
To: Astronomical Python mailing list <<a
href="mailto:astropy@python.org" target="_blank"
moz-do-not-send="true">astropy@python.org</a>><br>
Subject: Re: [AstroPy] Convert from AltAz to ICRS<br>
Message-ID: <<a
href="mailto:595E44E9-2129-41AB-BD32-A94D6BF77F43@gmail.com"
target="_blank" moz-do-not-send="true">595E44E9-2129-41AB-BD32-A94D6BF77F43@gmail.com</a>><br>
Content-Type: text/plain; charset=utf-8<br>
<br>
The RA and dec changes mostly due to precession is my
understanding. <br>
<br>
Sent from my iPhone<br>
<br>
> On Nov 23, 2019, at 15:20, Eric Jensen <<a
href="mailto:ejensen1@swarthmore.edu" target="_blank"
moz-do-not-send="true">ejensen1@swarthmore.edu</a>>
wrote:<br>
> <br>
> Hi Franco, <br>
> <br>
> You can use the same transform_to method that is given
in the example docs, just in the other direction, e.g. <br>
> <br>
> object_radec = object_altaz.transform_to(?icrs')<br>
> <br>
> Referring to the example here: <br>
> <a
href="https://docs.astropy.org/en/stable/generated/examples/coordinates/plot_obs-planning.html#sphx-glr-generated-examples-coordinates-plot-obs-planning-py"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://docs.astropy.org/en/stable/generated/examples/coordinates/plot_obs-planning.html#sphx-glr-generated-examples-coordinates-plot-obs-planning-py</a><br>
> <br>
> Here is some code based on that example, that extends
it to show a transformation back to RA and Dec: <br>
> <br>
> import astropy.units as u<br>
> from astropy.time import Time<br>
> from astropy.coordinates import SkyCoord,
EarthLocation, AltAz<br>
> <br>
> # Get M33's coordinates<br>
> m33 = SkyCoord.from_name('M33')<br>
> <br>
> # Define a location for observation: <br>
> bear_mountain = EarthLocation(lat=41.3*u.deg,
lon=-74*u.deg, height=390*u.m)<br>
> utcoffset = -4*u.hour # Eastern Daylight Time<br>
> time = Time('2012-07-12 23:00:00') - utcoffset<br>
> <br>
> # Find the alt/az at that time:<br>
> m33altaz =
m33.transform_to(AltAz(obstime=time,location=bear_mountain))<br>
> print("M33's Altitude = {0.alt:.2f}, Azimuth =
{0.az:.1f}".format(m33altaz))<br>
> <br>
> # prints: M33's Altitude = 0.13 deg, Azimuth = 47.3
deg<br>
> <br>
> # Look at the same alt/az, <br>
> # but half a sidereal day later: <br>
> new_altaz = SkyCoord(AltAz(obstime=time + 0.5*u.sday,<br>
> az=<a href="http://m33altaz.az"
rel="noreferrer" target="_blank" moz-do-not-send="true">m33altaz.az</a>,<br>
> alt=m33altaz.alt,<br>
> location=bear_mountain))<br>
> <br>
> # Transform back to RA, Dec;<br>
> # should get the same Dec as before but RA 12 hours
different:<br>
> newradec = new_altaz.transform_to('icrs')<br>
> print(m33.to_string('hmsdms'))<br>
> print(newradec.to_string('hmsdms?))<br>
> <br>
> # Prints <br>
> # 01h33m50.904s +30d39m35.79s<br>
> # 13h33m59.1873s +30d47m03.8071s<br>
> <br>
> Interestingly, the declination isn?t *exactly* the same
and the RA doesn?t differ by exactly 12 hours - I wonder
why? But overall you can see the idea for doing what you
want. <br>
> <br>
> Best,<br>
> <br>
> Eric<br>
> <br>
> <br>
>> On Nov 23, 2019, at 2:00 PM, franco basti <<a
href="mailto:franco.basti@gmail.com" target="_blank"
moz-do-not-send="true">franco.basti@gmail.com</a>>
wrote:<br>
>> <br>
>> <br>
>> Can anyone help me converting from a alt az to
ra,dec ?<br>
>> all I can find are examples that convert from
ra,dec to alt,az<br>
>> <br>
>> Thx<br>
>> Franco<br>
>> <br>
>> _______________________________________________<br>
>> AstroPy mailing list<br>
>> <a href="mailto:AstroPy@python.org"
target="_blank" moz-do-not-send="true">AstroPy@python.org</a><br>
>> <a
href="https://mail.python.org/mailman/listinfo/astropy"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://mail.python.org/mailman/listinfo/astropy</a><br>
> <br>
> _______________________________________________<br>
> AstroPy mailing list<br>
> <a href="mailto:AstroPy@python.org" target="_blank"
moz-do-not-send="true">AstroPy@python.org</a><br>
> <a
href="https://mail.python.org/mailman/listinfo/astropy"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://mail.python.org/mailman/listinfo/astropy</a><br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 26 Nov 2019 07:58:58 -0500<br>
From: Eric Jensen <<a
href="mailto:ejensen1@swarthmore.edu" target="_blank"
moz-do-not-send="true">ejensen1@swarthmore.edu</a>><br>
To: Astronomical Python mailing list <<a
href="mailto:astropy@python.org" target="_blank"
moz-do-not-send="true">astropy@python.org</a>><br>
Subject: Re: [AstroPy] Convert from AltAz to ICRS<br>
Message-ID: <<a
href="mailto:6CE26C72-6BFE-437C-8DBB-B75A21C28B63@swarthmore.edu"
target="_blank" moz-do-not-send="true">6CE26C72-6BFE-437C-8DBB-B75A21C28B63@swarthmore.edu</a>><br>
Content-Type: text/plain; charset=utf-8<br>
<br>
<br>
> On Nov 26, 2019, at 12:06 AM, <a
href="mailto:keithmclaurin@gmail.com" target="_blank"
moz-do-not-send="true">keithmclaurin@gmail.com</a> wrote:<br>
> <br>
> The RA and dec changes mostly due to precession is my
understanding. <br>
<br>
Thanks for responding. A quick back-of-the-envelope
calculation shows that precession (360 degrees in 26,000
years) should be less than 0.1 arcsecond over 12 hours,
whereas the difference here is quite a bit bigger, about 7.5
arcminutes. So it must be something else - maybe some
internal rounding or (more likely) some more subtle
misunderstanding by me of some conversion / reference frame
issue. In any case, it?s not really germane to the original
query, but still has my curiosity piqued. <br>
<br>
Eric <br>
<br>
> <br>
>> On Nov 23, 2019, at 15:20, Eric Jensen <<a
href="mailto:ejensen1@swarthmore.edu" target="_blank"
moz-do-not-send="true">ejensen1@swarthmore.edu</a>>
wrote:<br>
>> <br>
>> Hi Franco, <br>
>> <br>
>> You can use the same transform_to method that is
given in the example docs, just in the other direction, e.g.
<br>
>> <br>
>> object_radec = object_altaz.transform_to(?icrs')<br>
>> <br>
>> Referring to the example here: <br>
>> <a
href="https://docs.astropy.org/en/stable/generated/examples/coordinates/plot_obs-planning.html#sphx-glr-generated-examples-coordinates-plot-obs-planning-py"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://docs.astropy.org/en/stable/generated/examples/coordinates/plot_obs-planning.html#sphx-glr-generated-examples-coordinates-plot-obs-planning-py</a><br>
>> <br>
>> Here is some code based on that example, that
extends it to show a transformation back to RA and Dec: <br>
>> <br>
>> import astropy.units as u<br>
>> from astropy.time import Time<br>
>> from astropy.coordinates import SkyCoord,
EarthLocation, AltAz<br>
>> <br>
>> # Get M33's coordinates<br>
>> m33 = SkyCoord.from_name('M33')<br>
>> <br>
>> # Define a location for observation: <br>
>> bear_mountain = EarthLocation(lat=41.3*u.deg,
lon=-74*u.deg, height=390*u.m)<br>
>> utcoffset = -4*u.hour # Eastern Daylight Time<br>
>> time = Time('2012-07-12 23:00:00') - utcoffset<br>
>> <br>
>> # Find the alt/az at that time:<br>
>> m33altaz =
m33.transform_to(AltAz(obstime=time,location=bear_mountain))<br>
>> print("M33's Altitude = {0.alt:.2f}, Azimuth =
{0.az:.1f}".format(m33altaz))<br>
>> <br>
>> # prints: M33's Altitude = 0.13 deg, Azimuth =
47.3 deg<br>
>> <br>
>> # Look at the same alt/az, <br>
>> # but half a sidereal day later: <br>
>> new_altaz = SkyCoord(AltAz(obstime=time +
0.5*u.sday,<br>
>> az=<a href="http://m33altaz.az"
rel="noreferrer" target="_blank" moz-do-not-send="true">m33altaz.az</a>,<br>
>> alt=m33altaz.alt,<br>
>> location=bear_mountain))<br>
>> <br>
>> # Transform back to RA, Dec;<br>
>> # should get the same Dec as before but RA 12 hours
different:<br>
>> newradec = new_altaz.transform_to('icrs')<br>
>> print(m33.to_string('hmsdms'))<br>
>> print(newradec.to_string('hmsdms?))<br>
>> <br>
>> # Prints <br>
>> # 01h33m50.904s +30d39m35.79s<br>
>> # 13h33m59.1873s +30d47m03.8071s<br>
>> <br>
>> Interestingly, the declination isn?t *exactly* the
same and the RA doesn?t differ by exactly 12 hours - I
wonder why? But overall you can see the idea for doing
what you want. <br>
>> <br>
>> Best,<br>
>> <br>
>> Eric<br>
>> <br>
>> <br>
>>> On Nov 23, 2019, at 2:00 PM, franco basti <<a
href="mailto:franco.basti@gmail.com" target="_blank"
moz-do-not-send="true">franco.basti@gmail.com</a>>
wrote:<br>
>>> <br>
>>> <br>
>>> Can anyone help me converting from a alt az to
ra,dec ?<br>
>>> all I can find are examples that convert from
ra,dec to alt,az<br>
>>> <br>
>>> Thx<br>
>>> Franco<br>
>>> <br>
>>> _______________________________________________<br>
>>> AstroPy mailing list<br>
>>> <a href="mailto:AstroPy@python.org"
target="_blank" moz-do-not-send="true">AstroPy@python.org</a><br>
>>> <a
href="https://mail.python.org/mailman/listinfo/astropy"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://mail.python.org/mailman/listinfo/astropy</a><br>
>> <br>
>> _______________________________________________<br>
>> AstroPy mailing list<br>
>> <a href="mailto:AstroPy@python.org"
target="_blank" moz-do-not-send="true">AstroPy@python.org</a><br>
>> <a
href="https://mail.python.org/mailman/listinfo/astropy"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://mail.python.org/mailman/listinfo/astropy</a><br>
> _______________________________________________<br>
> AstroPy mailing list<br>
> <a href="mailto:AstroPy@python.org" target="_blank"
moz-do-not-send="true">AstroPy@python.org</a><br>
> <a
href="https://mail.python.org/mailman/listinfo/astropy"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://mail.python.org/mailman/listinfo/astropy</a><br>
<br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
AstroPy mailing list<br>
<a href="mailto:AstroPy@python.org" target="_blank"
moz-do-not-send="true">AstroPy@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/astropy"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://mail.python.org/mailman/listinfo/astropy</a><br>
<br>
<br>
------------------------------<br>
<br>
End of AstroPy Digest, Vol 158, Issue 4<br>
***************************************<br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">Benjamin Weiner <br>
Staff Scientist / Associate Astronomer, MMT /
Steward Observatory<br>
<a href="mailto:bjw@as.arizona.edu" target="_blank"
moz-do-not-send="true">bjw@as.arizona.edu</a><br>
<a href="http://mingus.as.arizona.edu/~bjw/"
target="_blank" moz-do-not-send="true">http://mingus.mmto.arizona.edu/~bjw/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
AstroPy mailing list
<a class="moz-txt-link-abbreviated" href="mailto:AstroPy@python.org">AstroPy@python.org</a>
<a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/astropy">https://mail.python.org/mailman/listinfo/astropy</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
---------------------------------------------------------------------
Paolo Tanga Astronome
Deputy director of Laboratoire Langrange / UMR 7293
Observatoire de la Côte d'Azur Tel +33(0)492003042
Bv de l'Observatoire - CS 34229 Fax +33(0)492003121
06304 Nice Cedex 4 - France <a class="moz-txt-link-freetext" href="http://www.oca.eu/tanga">http://www.oca.eu/tanga</a>
<a class="moz-txt-link-freetext" href="https://twitter.com/ziggypao">https://twitter.com/ziggypao</a></pre>
</body>
</html>