<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi al
<div class=""><br class="">
</div>
<div class="">Apologies for using the DIFX mailing list for a decidedly non-DIFX question. I’m guessing there is a number of people on this list who can help me with this query.</div>
<div class=""><br class="">
</div>
<div class="">I am trying to convert some J2000 coordinates to “date coordinates” (ie precess to a specific date).</div>
<div class=""><br class="">
</div>
<div class="">The initial idea was to use python astropy (rather than perl/slalib) to get with the times. However I am getting inconsistent results, and cannot find any documentation on how to do this in astropy.</div>
<div class=""><br class="">
</div>
<div class="">As an example I am trying to convert 1934-638 from J2000 to epoch 2020-1-1. Various different approaches are here:</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
1934-638<span class="Apple-tab-span" style="white-space:pre"> </span>19h39m25.026s<span class="Apple-tab-span" style="white-space:pre">
</span>-63d42m45.63s<span class="Apple-tab-span" style="white-space:pre"> </span>
J2000<span class="Apple-tab-span" style="white-space:pre"> </span><br class="">
astropy<span class="Apple-tab-span" style="white-space:pre"> </span>19h41m15.463s <span class="Apple-tab-span" style="white-space:pre">
</span>-63d39m55.69s<span class="Apple-tab-span" style="white-space:pre"> </span>
<span class="Apple-tab-span" style="white-space:pre"></span><br class="">
perl<span class="Apple-tab-span" style="white-space:pre"> </span>19h41m13.563s<span class="Apple-tab-span" style="white-space:pre">
</span>-63d39m56.94s<span class="Apple-tab-span" style="white-space:pre"> </span>
<span class="Apple-tab-span" style="white-space:pre"></span><br class="">
SLA<span class="Apple-tab-span" style="white-space:pre"> </span>19h41m10.545s<span class="Apple-tab-span" style="white-space:pre">
</span>-63d40m02.77s<span class="Apple-tab-span" style="white-space:pre"> </span>
<span class="Apple-tab-span" style="white-space:pre"></span><br class="">
Perl SLA<span class="Apple-tab-span" style="white-space:pre"> </span>19h41m10.559s<span class="Apple-tab-span" style="white-space:pre">
</span>-63d40m02.76s<span class="Apple-tab-span" style="white-space:pre"> </span>
<span class="Apple-tab-span" style="white-space:pre"></span><br class="">
Online<span class="Apple-tab-span" style="white-space:pre"> </span>19h41m15.5s <span class="Apple-tab-span" style="white-space:pre">
</span>-63d39m56s<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"></span><a href="http://www.robertmartinayers.org/tools/coordinates.html" class="">http://www.robertmartinayers.org/tools/coordinates.html</a></div>
<div class=""><br class="">
</div>
<div class="">“Perl” is code I wrote years ago for Astro:Coord (on CPAN) based on Fortran code at Hobart observatory</div>
<div class="">SLA is a hacked version from Caltech VLBI package “PRECESS” which uses SLALIB</div>
<div class="">PerlSLA is a perl version which makes the same calls (mostly for coding consistency check)</div>
<div class="">Online is a random webpage found via google.</div>
<div class=""><br class="">
</div>
<div class="">Clearly astropy and the online version use the same algorithm (or online is using astropy under the hood).</div>
<div class=""><br class="">
</div>
<div class="">My perl version is similar to astropy, but slalib is different by a lot. I remember years ago looking into this sort of stuff</div>
<div class=""> (maybe B1950-J2000 rather than epoch precession) and SLALIB used a very different implementation to astronomical</div>
<div class="">Almanac, following a paper which basically said the almanac implementation was wrong.</div>
<div class=""><br class="">
</div>
<div class="">FYI, the relevant code is:</div>
<div class=""><br class="">
</div>
<div class="">Astropy:</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space:pre"></span>from astropy.coordinates import SkyCoord, FK5</font></div>
<div class=""><span class="Apple-tab-span" style="font-family: Menlo; white-space: pre;"></span><span style="font-family: Menlo;" class="">from astropy.time import Time</span></div>
</div>
<div class=""><font face="Menlo" class=""><br class="">
</font></div>
<div class="">
<div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space:pre"></span>c = SkyCoord('19h39m25.026s', '-63d42m45.63s', frame='icrs')</font></div>
<div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space:pre"></span>t = Time('2020-01-01 00:00:00', scale='utc')</font></div>
</div>
<div class="">
<div class=""><br class="">
</div>
<div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space:pre"></span>my_date = FK5(equinox=Time(t))</font></div>
<div class=""><span class="Apple-tab-span" style="font-family: Menlo; white-space: pre;"></span><span style="font-family: Menlo;" class="">c_date = c.transform_to(my_date)</span></div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">I’m a little dubious this is correct, given the use of “Equinox”, while I really want to change Epoch.</div>
<div class=""><br class="">
</div>
<div class="">The SLALIB implementation is:</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><font face="Menlo" class=""> CALL SLA_MAPPA(2000D0, DATE, AMPRMS)</font></div>
<div class=""><span style="font-family: Menlo;" class=""> CALL SLA_MAPQKZ(R2000, D2000, AMPRMS, RA, DA)</span></div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Where DATE is the MJD (checked to be consistent).</div>
<div class=""><br class="">
</div>
<div class="">Does anyone have code which they trust to test these conversions (or comments)?</div>
<div class=""><br class="">
</div>
<div class="">Thanks</div>
<div class="">Chris</div>
</body>
</html>