code: def pix_to_skydir(xpix, ypix, wcs):
      
      xpix = np.array(xpix)
      ypix = np.array(ypix)
  
      if xpix.ndim > 0 and len(xpix) == 0:
          return SkyCoord(np.empty(0), np.empty(0), unit='deg',
                          frame='icrs')
  
      return SkyCoord.from_pixel(xpix, ypix, wcs,
                                 origin=0).transform_to('icrs')
docs: Convert pixel coordinates to a skydir object.
  
      Gracefully handles 0-d coordinate arrays.
      Always returns a celestial coordinate.
  
      Parameters
      ----------
      xpix : `numpy.ndarray`
  
      ypix : `numpy.ndarray`
  
      wcs : `~astropy.wcs.WCS`