Skip to content

Instantly share code, notes, and snippets.

@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 / LambertConformalTicks.ipynb
Last active June 7, 2022 13:47
Adding gridline labels to a cartopy Lambert Conformal projection plot
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajdawson
ajdawson / ssh_process.ml
Created October 24, 2016 19:57
Communicating with an ssh process in OCaml
let output_command channel cmd = output_string channel (cmd ^ "\n")
let do_ssh_hostname () =
let oc_in, oc_out = Unix.open_process "ssh -T hostname" in
output_command oc_out "hostname";
flush oc_out;
try
Printf.printf "%s\n" (input_line oc_in)
with
End_of_file -> ();
@ajdawson
ajdawson / lcc_corners.ipynb
Created May 16, 2016 10:49
Map extent for an LCC projection
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajdawson
ajdawson / storm_example.ipynb
Last active December 31, 2015 20:19
Cartopy: 2012 Winter Storm
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 / 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 / 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