code: def datapt_to_system(self, datapt, system=None, coords='data',
                           naxispath=None):
          
          if self.coordsys == 'raw':
              raise common.WCSError("No usable WCS")
  
          if system is None:
              system = 'icrs'
  
          wcspt = self.datapt_to_wcspt(datapt, coords=coords,
                                       naxispath=naxispath)
  
          frame_class = coordinates.frame_transform_graph.lookup_name(
              self.coordsys)
          ra_deg = wcspt[:, 0]
          dec_deg = wcspt[:, 1]
          coord = frame_class(ra_deg * units.degree, dec_deg * units.degree)
          to_class = coordinates.frame_transform_graph.lookup_name(system)
          # Skip if input and output is the same (no realize_frame
          # call in astropy)
          if to_class != frame_class:
              coord = coord.transform_to(to_class)
  
          return coord
docs: Map points to given coordinate system.
  
          Parameters
          ----------
          datapt : array-like
              Pixel coordinates in the format of
              ``[[x0, y0, ...], [x1, y1, ...], ..., [xn, yn, ...]]``.
  
          system : str or None, optional, default to 'icrs'
              Coordinate system name.
  
          coords : 'data' or None, optional, default to 'data'
              Expresses whether the data coordinate is indexed from zero
  
          naxispath : list-like or None, optional, defaults to None
              A sequence defining the pixel indexes > 2D, if any
  
          Returns
          -------
          coord : SkyCoord