让我在这里发布对最后@Christoph 评论的答案,以便我可以粘贴完整的代码。这是我得到的代码和错误:
In [1]: import astropy.coordinates as coord
In [2]: import astropy.units as u
In [3]: from astropy.time import Time
In [4]: coord.ITRS( coord.SphericalRepresentation(lon= 0.0 *u.deg ,lat = 0.0 * u.deg, distance = 1 * u.m), obstime=Time('2018-12-03 14:00:00')).transform_to(coord.ICRS)
ValueError Traceback (most recent call last)
<ipython-input-4-1d50da4d3855> in <module>
----> 1 coord.ITRS( coord.SphericalRepresentation(lon= 0.0 *u.deg ,lat = 0.0 * u.deg, distance = 1 * u.m), obstime=Time('2018-12-03 14:00:00')).transform_to(coord.ICRS)
~/lib/python3.5/site-packages/astropy/coordinates/baseframe.py in transform_to(self, new_frame)
1165 msg = 'Cannot transform from {0} to {1}'
1166 raise ConvertError(msg.format(self.__class__, new_frame.__class__))
-> 1167 return trans(self, new_frame)
1168
1169 def is_transformable_to(self, new_frame):
...
474 # In case we want to convert 1e20 to int.
475 try:
--> 476 fill_value = np.array(fill_value, copy=False, dtype=ndtype)
477 except OverflowError:
478 # Raise TypeError instead of OverflowError.
ValueError: invalid literal for int() with base 10: 'N'
In [6]: astropy.__version__
Out[6]: '3.0.5'
In [8]: numpy.__version__
Out[8]: '1.15.3'