Skip to content

Instantly share code, notes, and snippets.

View transientlunatic's full-sized avatar

Daniel Williams transientlunatic

View GitHub Profile
@transientlunatic
transientlunatic / README.md
Last active April 22, 2022 07:14
Relative Hills of Glasgow

This gist contains a list of all hills in Glasgow which have a height of at least 30m and a topological prominence of 10m or more.

The heights were deteremined by analysing Scottish Government remote sensing data available here: https://remotesensingdata.gov.scot/data

@transientlunatic
transientlunatic / GPX.ipynb
Last active December 15, 2021 12:42
Mountain images
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@transientlunatic
transientlunatic / README.md
Last active April 30, 2020 09:26
Data from the "Wheel of Time" series.

Wheel of Time Data

This repository contains sporadic bits of data derived from the "Wheel of Time" novels by Robert Jordan, and I intend, at some point in the far distant future to use these to make some entertaining visualisation of what happens in the books. For now, however, it's just data.

@transientlunatic
transientlunatic / Covid-19.ipynb
Last active January 26, 2021 14:40
Covid-19 in Scotland
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',
@transientlunatic
transientlunatic / Sunset plots.ipynb
Last active December 14, 2021 18:14
Calculate the earliest sunset and the latest sunrise in winter.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 / 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 / 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 / plot.py
Last active February 28, 2017 11:38
Reading-in SRT Data
# Script here