code: def skydir_to_pix(skydir, wcs):
      
      if len(skydir.shape) > 0 and len(skydir) == 0:
          return [np.empty(0), np.empty(0)]
  
      return skydir.to_pixel(wcs, origin=0)
docs: Convert skydir object to pixel coordinates.
  
      Gracefully handles 0-d coordinate arrays.
  
      Parameters
      ----------
      skydir : `~astropy.coordinates.SkyCoord`
  
      wcs : `~astropy.wcs.WCS`
  
      Returns
      -------
      xp, yp : `numpy.ndarray`
         The pixel coordinates