Skip to content

Instantly share code, notes, and snippets.

View niallrobinson's full-sized avatar

Niall Robinson niallrobinson

  • Met Office
  • Exeter
View GitHub Profile
@niallrobinson
niallrobinson / cube_explorer.py
Last active December 18, 2015 03:49 — forked from ajdawson/cube_explorer.py
an attempt at classifying and adding a picker. Doesn't work but you get the idea
'''
Proof of concept class for making interactive plot object which allow the addition
of navigation buttons.
Created on Jul 3, 2013
@author: nrobin
'''
import iris
@niallrobinson
niallrobinson / animate_cube.py
Last active December 18, 2015 04:49
A function to animate cubes
'''
Created on Jun 6, 2013
Function to allow the easy animation of cubes
@author: nrobin
'''
import os
import shutil
@niallrobinson
niallrobinson / correlate.py
Last active December 18, 2015 10:59
A function for fairly efficiently calculating the correlation between two cubes over arbitrary dimensions.
import numpy as np
import iris
def nDimCorr(cube_a, cube_b, corr_dims):
""" Calculates the n-D correlation cube over the given dimensions
Returns a cube representing the correlation between two
cubes along the given dimensions, which are comparable
in all other dimensions.
'''
Proof of concept class for making interactive plot object which allow the addition
of navigation buttons.
Created on Jul 3, 2013
@author: nrobin
'''
import iris
@niallrobinson
niallrobinson / cube_explorer.py
Last active December 19, 2015 15:28
cube explorer with picker
'''
Proof of concept class for making interactive plot object which allow the addition
of navigation buttons.
Created on Jul 3, 2013
@author: nrobin
'''
import matplotlib.cm as mpl_cm
@niallrobinson
niallrobinson / coord_prob_nb
Created September 23, 2013 13:13
new plot coord problem
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@niallrobinson
niallrobinson / coord_bcster.ipynb
Created December 6, 2013 16:12
cube common coord broadcaster
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@niallrobinson
niallrobinson / pre-commit
Last active November 27, 2015 12:38 — forked from DmZ/pre-commit
Git pre-commit hook to search for Amazon AWS API keys.
#!/usr/bin/env bash
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
EMPTY_TREE=$(git hash-object -t tree /dev/null)
against=$EMPTY_TREE
fi
@niallrobinson
niallrobinson / pre-commit.sh
Created November 27, 2015 09:24 — forked from czardoz/pre-commit.sh
Git pre-commit hook that checks for AWS keys
#!/usr/bin/env bash
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
EMPTY_TREE=$(git hash-object -t tree /dev/null)
against=$EMPTY_TREE
fi
@niallrobinson
niallrobinson / WBPT_skill.ipynb
Created August 23, 2018 09:56
Ensemble forecast fun
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.