Example #1
0
 def __init__(self, *args, **kwargs):
     if not isinstance(args[0], SkyCoord) and 'unit' not in kwargs:
         kwargs['unit'] = (u.hourangle, u.deg)
     SkyCoord.__init__(self, *args, **kwargs)
     if self.cartesian.xyz.shape not in [(3, ), (3, 1)]:
         raise ValueError(
             "Something wrong with parameters of Coordinates().\nMost " +
             "probably you have provided more than one sky position.")
     self._calculate_projected()
Example #2
0
 def __init__(self, *args, **kwargs):
     if not isinstance(args[0], (SkyCoord, u.quantity.Quantity)):
         if 'unit' not in kwargs and len(args) > 0:
             self._check_for_ra_in_degrees(args[0])
             kwargs['unit'] = (u.hourangle, u.deg)
     SkyCoord.__init__(self, *args, **kwargs)
     if self.cartesian.xyz.shape not in [(3, ), (3, 1)]:
         raise ValueError(
             "Something wrong with parameters of Coordinates().\nMost " +
             "probably you have provided more than one sky position.")
     self._calculate_projected()
Example #3
0
    def __init__(self, *args, **kwargs):
        """
        The constructor ...
        :param args:
        :param kwargs:
        :return:
        """

        # Call the constructor of the Coordinate base class
        Coordinate.__init__(self, **kwargs)

        # Remove keyword arguments that are not recognized by the SkyCoord class
        allowed_keys = [
            "frame", "unit", "obstime", "equinox", "representation", "copy",
            "ra", "dec", "l", "b", "x", "y", "z", "w", "u", "v"
        ]
        to_be_removed_keys = []
        for key in kwargs:
            if key not in allowed_keys: to_be_removed_keys.append(key)
        for key in to_be_removed_keys:
            del kwargs[key]

        # Call the constructor of the base class
        SkyCoord.__init__(self, *args, **kwargs)
Example #4
0
 def __init__(self, *args, **kwargs):
     if "unit" not in kwargs:
         kwargs["unit"] = units.deg
     SkyCoord.__init__(self, *args, **kwargs)