Skip to content

Instantly share code, notes, and snippets.

@ajdawson
ajdawson / cube_explorer.py
Last active December 18, 2015 03:48
This is a fairly bare-bones proof of concept for a cube explorer type function. I didn't bother to add buttons for exploring over more than one dimension, but the code supports it. It only supports iris plot functions, it needs logic adding to handle matplotlib functions.
"""
Very basic implementation of a cube explorer function.
This is a proof of concept rather than a solid design idea. It is
currently hard-wired to work on one dimension only although the
workings allow for multiple dimensions, I just didn't get round to
writing code to add the buttons for these!
"""
import functools
@ajdawson
ajdawson / gist:5916765
Last active December 19, 2015 07:09
IPython notebook demonstrating proposed 1D plotting features for iris.
{
"metadata": {
"name": "1D Plotting Example"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@ajdawson
ajdawson / gist:6550671
Created September 13, 2013 13:23
Preliminary ideas for vector handling in cartopy.
This file has been truncated, but you can view the full file.
{
"metadata": {
"name": "Cartopy Vector Transforms"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@ajdawson
ajdawson / storm_example.ipynb
Last active December 31, 2015 20:19
Cartopy: 2012 Winter Storm
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajdawson
ajdawson / goes_ir_cartopy.ipynb
Last active January 4, 2016 14:49
GOES IR cartopy example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajdawson
ajdawson / gist:fcf9d3f600b02654bde3
Created September 15, 2014 15:37
iris development conda environment
biggus 0.7.0 np18py27_0
cairo 1.12.2 2
cartopy 0.12.x <pip>
curl 7.30.0 0
cython 0.21 py27_0
dateutil 2.1 py27_2
docutils 0.12 py27_0
ecmwf_grib 1.9.16 np18py27_10
freetype 2.4.10 0
gdal 1.10.1 np18py27_2
@ajdawson
ajdawson / gist:dc712f1d2203aceedb95
Created September 21, 2014 11:36
SRTM parser for Cartopy
"""Construct an SRTM lookup file for Cartopy."""
from HTMLParser import HTMLParser
import json
import os
import urllib2
#: Base URL where SRTM data files (with extensions .hgt.zip) are located.
SRTM_URL = 'http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/2000.02.11/'
@ajdawson
ajdawson / udunits2_test.c
Created October 10, 2014 08:03
Test program for UDUNITS2
#include <stdio.h>
#include <udunits2.h>
int main(int argc, char *argv[])
{
ut_system* unitSystem = ut_read_xml(NULL);
ut_unit *unit0, *unit1, *unit2;
char unit0_str[128], unit1_str[128], unit2_str[128];
unsigned format_opts = UT_ASCII;
@ajdawson
ajdawson / gauss_grid.py
Created January 21, 2015 14:04
Gaussian grid generation.
"""Tools for working with Gaussian grids."""
from __future__ import (absolute_import, division, print_function)
import functools
import numpy as np
import numpy.linalg as la
from numpy.polynomial.legendre import legcompanion, legder, legval
@ajdawson
ajdawson / nps.ipynb
Created February 16, 2015 09:04
North Polar Stereographic Extents
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.