Skip to content

Instantly share code, notes, and snippets.

@syrte
Created January 29, 2024 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syrte/027227164d0a3ed33e566fa6bf65065d to your computer and use it in GitHub Desktop.
Save syrte/027227164d0a3ed33e566fa6bf65065d to your computer and use it in GitHub Desktop.
To compute the coefficient for Sersic or Einasto profile with half-mass radius
from scipy.special import gammaincinv
def b(n):
# 2 * n - 1 / 3 + 4 / (405 * n) + 46 / (25515 * n**2) + 131 / (1148175 * n**3)
return gammaincinv(2 * n, 0.5)
def d(n):
# 3 * n - 1 / 3 + 8 / (1215 * n) + 184 / (229635 * n**2) + 1048 / (31000725 * n**3)
return gammaincinv(3 * n, 0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment