Code from my Masters thesis "An objective categorisation of auroral substorms - Exploring large scale morphology"