This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Relativistic Breit-Wigner. | |
""" | |
import numpy as np | |
from numpy import pi | |
from scipy.stats import rv_continuous | |
class breit_wigner_gen(rv_continuous): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Make a numpy array | |
>>> np_array = np.random.random((30, 30)) | |
Write it in h5 format | |
>>> h5_name = 'np_array.h5' | |
>>> write_dh5_np(h5_name, np_array) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Merge two pickled plots | |
======================= | |
This is rather crude. The pickled plots should have identical sizes, axes etc. | |
""" | |
from pickle import load | |
from matplotlib.pyplot import figure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Load functions from a dynmaic library via the header file | |
========================================================= | |
""" | |
import ctypes | |
import numpy as np | |
import json | |
import sys | |
from collections import OrderedDict as odict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Convert arXiv code into markdown entry for webpage in Hugo academic theme | |
========================================================================= | |
Main usuage e.g., | |
>>> markdown('1607.06608') | |
to scrape https://arxiv.org/abs/1607.06608 into a publication for Hugo | |
academic theme. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Plot evidences for simple and complicated models | |
================================================ | |
by Andrew Fowlie. | |
""" | |
import matplotlib | |
import numpy as np | |
import matplotlib.pyplot as plt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\NeedsTeXFormat{LaTeX2e}[1994/06/01] | |
\ProvidesPackage{highlight}[2017/09/13 Highlight] | |
% All credit to https://tex.stackexchange.com/a/6029/35729 | |
\usepackage{soul} | |
\usepackage{tikz} | |
\usetikzlibrary{calc} | |
\usetikzlibrary{decorations.pathmorphing} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\NeedsTeXFormat{LaTeX2e}[1994/06/01] | |
\ProvidesPackage{shadow}[2017/09/13 shadow] | |
% code adapted from http://tex.stackexchange.com/a/11483/3954 | |
\usepackage{tikz} | |
\usetikzlibrary{shadows,calc} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
WIMP miracle | |
============ | |
""" | |
import matplotlib | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.ticker import MaxNLocator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Pie chart of Bayes factor | |
========================= | |
""" | |
import matplotlib | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.ticker import MaxNLocator |
OlderNewer