Skip to content

Instantly share code, notes, and snippets.

View stephenpascoe's full-sized avatar

Stephen Pascoe stephenpascoe

View GitHub Profile
"""
Convert a Dynamics365 input CSV (separated by "|") into a EDI record format.
usage: dynamics_edi_940.py --input <filename> --output <filename>
"""
import re
import datetime as dt
import sys
@stephenpascoe
stephenpascoe / jasmin-mpl-example.ipynb
Last active March 3, 2020 15:46
Simple example of running an IPython notebook within on JASMIN Analysis Platform
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stephenpascoe
stephenpascoe / gist:4715666
Created February 5, 2013 16:37
esgf-pyclient demo notebook from GO-ESSP-TECH telco on 2013-02-05
{
"metadata": {
"name": "esgf-pyclient-demo"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@stephenpascoe
stephenpascoe / gist:4585769
Created January 21, 2013 12:40
Find all CMIP5 datasets from MPI-M in 4 lines of Python. A simple example of using esgf-pyclient
from pyesgf.search import SearchConnection
conn = SearchConnection('http://esgf-index1.ceda.ac.uk/esg-search/search', distrib=True)
ctx = conn.new_context(latest=True, institute='MPI-M')
for result in ctx.search():
print result.json['master_id'], result.json['version']
@stephenpascoe
stephenpascoe / drslib-to-git-annex
Last active December 11, 2015 01:29
A simple script to convert a drslib dataset directory to git-annex
#!/bin/sh
#
# This is a nieve migration script for converting a drslib dataset directory
# into a git-annex managed format. The result is properly deduplicated
# but each version will be temporarily duplicated during migration. This would
# be problematic for large datasets. A more robust approach could use
# "git-annex reinject" to set the versioned path of each file.
#
cd $DATASET_DIRECTORY
@stephenpascoe
stephenpascoe / cordex-esg.ini
Created December 14, 2012 13:34
ESGF configuration for the CORDEX regional climate modelling project http://esgf.org http://cordex.dmi.dk/joomla/
[project:cordex]
categories =
project | enum | true | true | 0
domain | enum | true | true | 1
institute | enum | true | true | 2
driving_model | enum | false | true | 3
driving_experiment | enum | false | true | 4
driving_ensemble | enum | false | true | 5
rcm_model | enum | false | true | 6
rcm_version | enum | false | true | 7
@stephenpascoe
stephenpascoe / gist:4154237
Created November 27, 2012 13:33
Second Example of reading CMIP5 data over OPeNDAP in the IPython nodebook
{
"metadata": {
"name": "esgf_opendap1"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@stephenpascoe
stephenpascoe / gist:3823500
Created October 2, 2012 21:43
Example of using esgf-pyclient to find and plot ESGF data.
{
"metadata": {
"name": "esgf-pyclient-hadcm3-annotated"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@stephenpascoe
stephenpascoe / gist:3721874
Created September 14, 2012 13:23
Example of reading CMIP5 data over OPeNDAP in IPython
{
"metadata": {
"name": "esgf_opendap"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{