Skip to content

Instantly share code, notes, and snippets.

View transientlunatic's full-sized avatar

Daniel Williams transientlunatic

View GitHub Profile
@transientlunatic
transientlunatic / lal_install.sh
Last active January 25, 2018 11:50
LAL Install script
#! /bin/bash
LIBFRAME_VER=v8r26
# CHECK IF WE'RE INSTALLING INTO A VIRTUALENV
if [ -n "$VIRTUAL_ENV" ]; then
echo "This installation appears to be within a virtual environment."
echo "LALSuite will be installed to $VIRTUAL_ENV."
@transientlunatic
transientlunatic / burstsim_install.sh
Last active October 20, 2015 09:32
BurstSim Installation
#! /bin/bash
# This is a bash script to install the BurstSims environment as
# described at https://wiki.ligo.org/Bursts/BurstSimsEnvironment
NAME=burstsim
SOURCE_DIR=${HOME}/repositories
# Install PIP in the home directory
VERSION=`python -c 'import sys; print "%d.%d" % (sys.version_info[0], sys.version_info[1])'`
mkdir -p ${HOME}/local/pip-7.1.0/lib/python${VERSION}/site-packages
@transientlunatic
transientlunatic / burst.mplstyle
Last active April 19, 2016 09:54
A Matplotlib style for the Burst Companion Paper
patch.linewidth: 0.5
patch.facecolor: 348ABD # blue
patch.edgecolor: EEEEEE
patch.antialiased: True
font.size: 8
text.usetex: True,
font.family: 'New Century Schoolbook',
text.color : black,

Keybase proof

I hereby claim:

  • I am transientlunatic on github.
  • I am lpmn (https://keybase.io/lpmn) on keybase.
  • I have a public key ASCSLnwk5X0yaDIA0bqBF_Gv-fIHfoBIRVHs_Tx-Mj71nAo

To claim this, I am signing this object:

@transientlunatic
transientlunatic / plot.py
Last active February 28, 2017 11:38
Reading-in SRT Data
# Script here
@transientlunatic
transientlunatic / gnuradio_data.py
Last active January 16, 2018 12:46
Snippet for loading a gnuradio data file into python
import scipy
import re
data = scipy.fromfile(datafile, dtype=np.float32)
a = re.compile("ra(.*)dec(.*)time(.*).dat")
bandwidth = 4e6
centre = 1420.4e6
@transientlunatic
transientlunatic / hexmap.tex
Last active April 29, 2021 20:56
Hexagons for map-making in the Traveller RPG
%
% x=3*(minimum size)/2
% x=\sqrt{3/4}*(minimum size)/2
%
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{calc}
\def\hexdia{1cm}
@transientlunatic
transientlunatic / mcmc.tex
Created March 17, 2019 09:54
Markov chain illustration in LaTeX
\newcommand\gauss[2]{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}
\newcommand\complicated{ 0.5*( 1/(.2*sqrt(2*pi))*exp(-((x-1)^2)/(.2*2^2))) + 0.5*(1/(.5*sqrt(2*pi))*exp(-((x-5)^2)/(.5*2^2)) ) }
% Gauss function, parameters mu and sigma
\begin{tikzpicture}
\foreach \x in {1,2,...,4}{
\begin{scope}[xshift=1cm, yshift=1.5*\x cm]
@transientlunatic
transientlunatic / Sunset plots.ipynb
Last active December 14, 2021 18:14
Calculate the earliest sunset and the latest sunrise in winter.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@transientlunatic
transientlunatic / altair.py
Last active May 26, 2020 15:44
Some useful plotting styles
import altair
def pastle():
# Typography
font = "Lato"
# At Urban it's the same font for all text but it's good to keep them separate in case you want to change one later.
labelFont = "Source Code Pro"
sourceFont = "Lato" # Axes
axisColor = "#000000"
gridColor = "#4298bd" # Colors
main_palette = ['#8dd3c7', '#ffffb3', '#bebada',