[AstroPy] Discrepancy between astropy.constants parsec and au values?
Derek Homeier
derek at astro.physik.uni-goettingen.de
Tue Jul 14 09:43:45 EDT 2020
Hi Jenny,
>
> 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.
>
> The IAU fixed the astronomical unit in 2012 (resolution B2) to 149 597 870 700 m exactly,
> https://www.iau.org/static/resolutions/IAU2012_English.pdf
> and the parsec follows from the au so should be exactly a factor 180 * 3600 / pi larger.
>
> Comparing the calculated value with the stored value in astropy.constants shows the discrepancy -
>
> # AU to pc check
> # AU copied from IAU 2012 resolution B2
> AU = 149597870700
> print(AU * 180*3600 / np.pi)
> print(const.au * 180*3600 / np.pi)
> print(const.pc.value)
>
> 3.085677581491367e+16
> 3.085677581491367e+16 m
> 3.0856775814671916e+16
>
>
> astropy version 4.0.1.post1
>
> None of those values have any uncertainties, and although np.pi has a limited precision it is available to more than 10 d.p.
>
> Of course, it’s unlikely that anyone needs this level of precision when astronomical distances are typically only known to a few %.
>
it appears that astropy.constants defines the parsec as the distance of a 1”-parallax source to the Sun.
print(const.au / np.tan(np.pi / 180*3600))
3.0856775814671916e+16 m
accordingly reproduces the const.pc value (just to check on numpy's tangent builtin, I confirmed that this
is also identical to the 2nd order expansion const.au / ((np.pi / 180*3600) + (np.pi / 180*3600)**3 / 3)
within float64 precision.
Probably because this definition conflicts with the how people will calculate and use distances for smaller
parallaxes, IAU 2015 resolution B2 (which is in fact explicitly listed as the reference in iau2015.py) states that
"4 The parsec is defined as exactly (648 000/π) au (e.g. Cox 2000, Binney & Tremaine 2008)."
which is 30 856 775 814 913 673 m, 3 metres longer than the numbers you calculated (float64 precision ;-).
Thanks for the bug report!
Derek
More information about the AstroPy
mailing list