This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Specify tag release | |
export ESMPY='620_01b' | |
# Download archive if not done already | |
archive=ESMPy_${ESMPY}.tar.bz2 | |
if [ ! -f ${archive} ]; then | |
echo 'Downoading archive' | |
wget http://www.earthsystemmodeling.org/python_releases/ESMPy_${ESMPY}/${archive} | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Turn off audible bell | |
vbell off | |
# Turn off startup message | |
startup_message off | |
hardstatus off | |
caption always "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
import numpy as np | |
import iris | |
from iris.pdatetime import PartialDateTime | |
def _ret_cube(): | |
cube = iris.cube.Cube(np.arange(4)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shutil | |
import tempfile | |
class TemporaryDirectory(object): | |
""" | |
Context manager for tempfile.mkdtemp(). | |
This class is available in python +v3.2. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mosaic(iterable_shape, subdivided_shape): | |
""" | |
Return a generator of slices that represent a subdivided indexing of an iterable of specified shape. | |
""" | |
shape = subdivided_shape | |
if len(iterable_shape) != len(shape): | |
raise ValueError('Array shape and resulting shape mismatch, broadcasting not supported.') | |
# iterate through this array with shape (shape) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:563b350202cce7ea8c83bbb25c227c1bdcef905445af72e7b040121fc52884b8" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |