Skip to content

Instantly share code, notes, and snippets.

View pelson's full-sized avatar

Phil Elson pelson

View GitHub Profile
@pelson
pelson / index.ipynb
Last active August 31, 2018 09:10
A notebook to answer a StackOverflow question (https://stackoverflow.com/questions/51801109) relating to animating the rotation of a projecton using cartopy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import cartopy.crs as ccrs
import matplotlib.animation as animation
import matplotlib.pyplot as plt
ax = plt.axes(projection=ccrs.Robinson())
ax.stock_img()
ny_lon, ny_lat = -75, 43
delhi_lon, delhi_lat = 77.23, 28.61
@pelson
pelson / contour.geojson
Created July 4, 2018 12:36
Example of a GeoJSON produced with cartopy and matplotlib
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pelson
pelson / mega_merge.ipynb
Last active July 4, 2018 06:41
Iris cube mega-merge: how to join disjoint tiles into a single cube with Iris
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pelson
pelson / scalar_pp.ipynb
Created June 13, 2018 03:27
Working around a scalar PP saving issue by adding an extra point to a scalar dimension
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pelson
pelson / .gitignore
Last active May 27, 2018 08:49
Looking at how much of the South West Coast Path I've walked
.ipynb_checkpoints/
south_west_coast_path.gpx
@pelson
pelson / LFRic_UGRID_containment.ipynb
Last active May 25, 2018 11:30
LFRic's cubesphere UGRID and containment/intersection testing investigation using Shaply and Cartopy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pelson
pelson / gist:786ce4827aa1cd40b3f6
Created February 3, 2015 09:47
Work in progress support for plotting 360-day calendars with matplotlib
from collections import namedtuple
import datetime
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import matplotlib.transforms as mtransforms
import matplotlib.units as munits
import netcdftime
@pelson
pelson / demo.py
Last active February 1, 2018 08:40
aiohttp security authorization for StaticResource (or any aiohttp resource)
from aiohttp import web
from functools import wraps
from logging import getLogger
from types import MethodType
_LOGGER = getLogger(__name__)
AUTH_USER = 'authenticated_user'
@pelson
pelson / README.md
Last active August 13, 2017 16:58
Feature extraction from the XKCD handwriting dataset