code: def ang2pix(nside, theta, phi, nest=False, lonlat=False):
      
      lon, lat = _healpy_to_lonlat(theta, phi, lonlat=lonlat)
      return lonlat_to_healpix(lon, lat, nside, order='nested' if nest else 'ring')
docs: Drop-in replacement for healpy `~healpy.pixelfunc.ang2pix`.