[AstroPy] How do you create a dimensionless Cartesian coordinate?

Leo Singer lsinger at caltech.edu
Tue Oct 22 01:34:24 EDT 2013


Hello,

How do you create a dimensionless Cartesian coordinate? If I try the obvious way, by passing pure numbers to the constructor, I get the following exception:

$ python -c "import astropy.coordinates; astropy.coordinates.CartesianPoints(1, 0, 0)"
ERROR: UnitsError: None is not a valid Unit [astropy.coordinates.distances]
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/.../local/lib/python2.7/site-packages/astropy/coordinates/distances.py", line 279, in __new__
    raise u.UnitsError(str(e))
astropy.units.core.UnitsError: None is not a valid Unit

This is using the latest build from master, by the way.

Thank you,
Leo Singer
Graduate Student @ LIGO-Caltech



More information about the AstroPy mailing list