<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="">
<br class="">
A colleague of mine points out that the value of a parsec in astropy.constants/units differs from that calculated from astronomical units after the 10th decimal place.
<div class=""><br class="">
</div>
<div class="">The IAU fixed the astronomical unit in 2012 (resolution B2) to 149 597 870 700 m exactly, </div>
<div class=""><a href="https://www.iau.org/static/resolutions/IAU2012_English.pdf" class="">https://www.iau.org/static/resolutions/IAU2012_English.pdf</a></div>
<div class="">and the parsec follows from the au so should be exactly a factor 180 * 3600 / pi larger.</div>
<div class=""><br class="">
</div>
<div class="">Comparing the calculated value with the stored value in astropy.constants shows the discrepancy - </div>
<div class=""><br class="">
</div>
<div class="">
<div class=""># AU to pc check</div>
<div class=""># AU copied from IAU 2012 resolution B2</div>
<div class="">AU = 149597870700 </div>
<div class="">print(AU * 180*3600 / np.pi)</div>
<div class="">print(<a href="http://const.au" class="">const.au</a> * 180*3600 / np.pi)</div>
<div class="">print(const.pc.value)</div>
</div>
<div class=""><br class="">
</div>
<div class="">
<pre class="" style="box-sizing: border-box; overflow: auto; font-size: 14px; padding: 1px 0px; margin-top: 0px; margin-bottom: 0px; line-height: inherit; word-break: break-all; overflow-wrap: break-word; background-color: rgb(255, 255, 255); border: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; white-space: pre-wrap; vertical-align: baseline; font-variant-ligatures: normal; orphans: 2; widows: 2;"><pre class="" style="box-sizing: border-box; overflow: auto; padding: 1px 0px; margin-top: 0px; margin-bottom: 0px; line-height: inherit; word-break: break-all; overflow-wrap: break-word; border: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; white-space: pre-wrap; vertical-align: baseline; font-variant-ligatures: normal;">3.085677581491367e+16
3.085677581491367e+16 m
3.0856775814671916e+16</pre><div class=""><br class=""></div></pre>
</div>
<div class="">
<pre class="" style="box-sizing: border-box; overflow: auto; font-size: 14px; padding: 1px 0px; margin-top: 0px; margin-bottom: 0px; line-height: inherit; word-break: break-all; overflow-wrap: break-word; background-color: rgb(255, 255, 255); border: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; white-space: pre-wrap; vertical-align: baseline; font-variant-ligatures: normal; orphans: 2; widows: 2;">astropy version 4.0.1.post1</pre>
<div class=""><br class="">
</div>
</div>
<div class="">None of those values have any uncertainties, and although np.pi has a limited precision it is available to more than 10 d.p.</div>
<div class=""><br class="">
</div>
<div class="">Of course, it’s unlikely that anyone needs this level of precision when astronomical distances are typically only known to a few %.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes</div>
<div class="">Jenny</div>
<div class=""><br class="">
</div>
<div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
---<br class="">
Dr. Jennifer Hatchell <br class="">
Senior Lecturer in Astrophysics<br class="">
University of Exeter<br class="">
+44 (0)1392 725516<br class="">
<br class="">
<div>Standard working pattern: Tue-Thu and Fri AM. Currently working from home.</div>
<div class=""><br class="">
</div>
</div>
<br class="Apple-interchange-newline">
<br class="Apple-interchange-newline">
</div>
<br class="">
</body>
</html>