Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
| 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) |
| """ | |
| Sublime shortcuts for jupyter notebook | |
| """ | |
| from jupyter_core.paths import jupyter_config_dir | |
| import os | |
| custom_js_path = os.path.join(jupyter_config_dir(), 'custom', 'custom.js') | |
| custom_path = os.path.join(jupyter_config_dir(), 'custom') | |
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
| # A function to rasterize components of a matplotlib figure while keeping | |
| # axes, labels, etc as vector components | |
| # https://brushingupscience.wordpress.com/2017/05/09/vector-and-raster-in-one-with-matplotlib/ | |
| from inspect import getmembers, isclass | |
| import matplotlib | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| def rasterize_and_save(fname, rasterize_list=None, fig=None, dpi=None, |
| git config --global https.proxy http://127.0.0.1:1080 | |
| git config --global https.proxy https://127.0.0.1:1080 | |
| git config --global --unset http.proxy | |
| git config --global --unset https.proxy | |
| npm config delete proxy |
| import numpy as np | |
| from astropy.table import Table, Column | |
| def transpose_table(tab_before, id_col_name='ID'): | |
| '''Returns a copy of tab_before (an astropy.Table) with rows and columns interchanged | |
| id_col_name: name for optional ID column corresponding to | |
| the column names of tab_before''' | |
| # contents of the first column of the old table provide column names for the new table | |
| # TBD: check for duplicates in new_colnames & resolve | |
| new_colnames=tuple(tab_before[tab_before.colnames[0]]) |
| from __future__ import division | |
| import collections | |
| import numpy as np | |
| import matplotlib | |
| import matplotlib.pyplot as plt | |
| from scipy.spatial import Delaunay, KDTree | |
| # an adaptation of https://stackoverflow.com/a/15783581/60982 | |
| # using ideas from https://stackoverflow.com/a/9471601/60982 |
| %%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} | |