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
from functools import wraps | |
import os | |
def proc_stat(): | |
pid = os.getpid() | |
fnme = os.path.join('/', 'proc', str(pid), 'status') | |
fields = ['VmSize', 'VmRSS', 'VmPeak', 'VmHWM'] | |
with open(fnme, 'r') as fh: |
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 os | |
import biggus | |
import iris | |
import numpy as np | |
print iris.__file__, iris.__version__ | |
print biggus.__file__, biggus.__version__ | |
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
from netCDF4 import Dataset | |
import numpy as np | |
import os | |
def process_usage(): | |
fnme = os.path.join('/', 'proc', str(os.getpid()), 'status') | |
usage = {} | |
with open(fnme, 'r') as fh: | |
for line in fh: |
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 plot_data(*args, **kwargs): | |
save = kwargs.pop('save', False) | |
import matplotlib.pyplot as plt | |
import iris.plot as iplt | |
markers = ('+', 'x', 's') | |
if save is True: | |
plt.switch_backend('Agg') |
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:1ccaf1d6efde449dc4d273823364434c19bdd068d41587570ffde0a5be796216" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
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:9e9b8e73d2e084ca27d4015fe246597f8a1595a35b0bee658170be3636d8c30a" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
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 warnings | |
import iris | |
import biggus | |
from iris.analysis._area_weighted import AreaWeightedRegridder \ | |
as _AreaWeightedRegridder | |
from iris.experimental.regrid import regrid_weighted_curvilinear_to_rectilinear | |
import iris.experimental.regrid as eregrid | |
from iris.analysis._regrid import RectilinearRegridder | |
import numpy as np |
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 iris | |
import numpy as np | |
from shapely.geometry import Polygon | |
def horizontal_grid(cube): | |
return cube.coord(axis='x'), cube.coord(axis='y') | |
def transform_bbox(points, src_crs, tgt_crs): |
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
#!/usr/bin/env python2.7 | |
import subprocess | |
import sys | |
DEBUG = False | |
SVN_EXEC = '/usr/bin/svn' | |
class SVNError(Exception): |
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 numpy as np | |
>>> arr = np.ma.array([1, 2, 3, 4], mask=[False, True, False, True]) | |
>>> arr2 = arr.reshape((2, 2)) | |
>>> arr2 | |
masked_array(data = | |
[[1 --] | |
[3 --]], | |
mask = | |
[[False True] | |
[False True]], |