Advertisement
SVXX

SkyCoord Issues

Jun 26th, 2014
550
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.59 KB | None | 0 0
  1. >>> from frames import *
  2. >>> hgic = HelioGraphicStonyhurst(1*u.deg, 1*u.deg)
  3. ((<Quantity 1.0 deg>, <Quantity 1.0 deg>), {})
  4. In args section
  5. ((<Quantity 1.0 deg>, <Quantity 1.0 deg>, <Quantity 695508.0 km>), {})
  6. >>> hgic # Works fine
  7. <HelioGraphicStonyhurst Coordinate: hlon=1.0 deg, hlat=1.0 deg, rad=695508.0 km>
  8. >>> from astropy.coordinates import SkyCoord
  9. >>> sc = SkyCoord(hgic) # Problems?
  10. ((), {}) # Why is the args section empty?
  11. In kwargs section
  12. ((), {'rad': <Quantity 695508.0 km>}) # In kwargs, the rad quantity is added automatically
  13. # This can happen only because of the code I added in the constructor.
  14. # Why is the Heliographic constructor called twice?
  15. Traceback (most recent call last):
  16.   File "<stdin>", line 1, in <module>
  17.   File "/home/pritishc/RestOfFileSystem/Astropy Repo/astropy/astropy/coordinates/sky_coordinate.py", line 134, in __init__
  18.     kwargs = self._parse_inputs(args, kwargs)
  19.   File "/home/pritishc/RestOfFileSystem/Astropy Repo/astropy/astropy/coordinates/sky_coordinate.py", line 199, in _parse_inputs
  20.     frame = valid_kwargs['frame'] = _get_frame(args, kwargs)
  21.   File "/home/pritishc/RestOfFileSystem/Astropy Repo/astropy/astropy/coordinates/sky_coordinate.py", line 816, in _get_frame
  22.     frame = frame_cls()
  23.   File "frames.py", line 73, in __init__
  24.     super(HelioGraphicStonyhurst, self).__init__(*args, **kwargs)
  25.   File "/home/pritishc/RestOfFileSystem/Astropy Repo/astropy/astropy/coordinates/baseframe.py", line 437, in __init__
  26.     representation_data = self.representation(**repr_kwargs)
  27. TypeError: __init__() takes at least 4 arguments (2 given)
  28. >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement