Skip to content

Instantly share code, notes, and snippets.

View syrte's full-sized avatar

Zhaozhou Li syrte

View GitHub Profile
@syrte
syrte / sersic_lum.py
Created January 29, 2024 08:55 — forked from bamford/sersic_lum.py
Luminosity of Sérsic function in annulus
from numpy import pi, exp
from scipy.special import gamma, gammaincinv, gammainc
# Normalisation constant
def b(n):
return gammaincinv(2*n, 0.5)
# Total luminosity of a 2D Sérsic profile
def sersic_total_lum(Ie, re, n):
bn = b(n)
@syrte
syrte / apj_short_prop.bst
Created July 30, 2022 06:14 — forked from eteq/apj_short_prop.bst
A modified version of the apj latex/bibtex bst file for funding/observing proposals where there is very little space.
%%This is often best used in a latex file in two-column mode. To do that, do:
%%
%%\usepackage{multicol} % before \begin{document}
%% ... document ...
%%\begin{multicols}{2}
%%\bibliography{filename}{}
%%\bibliographystyle{apj_short_prop}
%%\end{multicols}
@syrte
syrte / gpy_kernel_cheatsheet.py
Created May 25, 2020 12:48 — forked from rikrd/gpy_kernel_cheatsheet.py
GPy Kernel Cheatsheet:: All the kernels in GPy (example realizations, covariance matrix, kernel equation)
%pylab inline
import numpy as np
import pylab as plt
import GPy
import re
def get_equation(kern):
match = re.search(r'(math::)(\r\n|\r|\n)*(?P<equation>.*)(\r\n|\r|\n)*', kern.__doc__)
return '' if match is None else match.group('equation').strip()
@syrte
syrte / weighted_kde.ipynb
Created May 9, 2019 12:12 — forked from tillahoffmann/weighted_kde.ipynb
Weighted kernel density estimation based on `scipy.stats.gaussian_kde`.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.