astropy/astropy — pull request #861 by mdboom (2013-03-21 17:08:51+00:00)
Title: units: u.lightyear and u.yr

Hi,

I have started playing with units, and realize some inconsistencies:
>>> si.c.to(u.lightyear/u.yr)
>>>

Checking in more detail, I see that u.yr is not Julian year (as perhaps one might expect for astronomy):
>>> (1*u.yr).to(u.day)
>>>

This seems also discussed in #21

But the IAU does define the lightyear as c*julian_year, so the following should have given unity:
>>> ((1*u.lightyear).to(u.m)/(365.25*24.*3600.*u.s)/si.c
>>>

I'm not sure how to solve this, but safest may be to have specific versions
(julian_yr, tropical_yr, etc.). In the end, users might also expect unity for the following:

>>> (si.G*u.solMass/(si.au)**3*(1./2./np.pi*u.yr)**2).to(u.dimensionless_unscaled)

Of course, one won't since G is poorly known. This does argue for having GsolMass as one of the constants, as it is very accurately known.

All best wishes,

Marten