This file contains 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 | |
from iris.tests.stock import realistic_4d | |
from iris.fileformats.netcdf._dask_locks import get_dask_array_scheduler_type | |
import dask.array as da | |
import dask.config | |
try: | |
import distributed | |
except ImportError: | |
distributed = None |
This file contains 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
# Example showing how to append ~similar cubes onto an existing netcdf file. | |
import numpy as np | |
import iris | |
from iris.cube import Cube | |
from iris.coords import DimCoord, AuxCoord | |
# | |
# Generate a really simple timestepped data sequence | |
# |
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 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
# Script to make bigger hybrid-height data. | |
# E.G. "$ python expanded_hybrid_height.py 5" | |
import datetime | |
import sys | |
import numpy as np | |
import iris | |
from iris.aux_factory import HybridHeightFactory |
This file contains 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
# N.B. currently requires/assumes "dask_timed" feature branch version of Iris (commit 1013ad9) | |
from functools import wraps | |
import dask.array as da | |
import numpy as np | |
import numpy.ma as ma | |
from iris.cube import Cube | |
from iris.coords import DimCoord |
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 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 collections import OrderedDict | |
import numpy as np | |
import numpy.ma as ma | |
def array_difference_stats(array_a, array_b, min_reldiff=1e-20): | |
# Calculate different types of array differences and basic stats on them. | |
diffs = array_a - array_b | |
absdiffs = np.abs(diffs) | |
absmags = 0.5*(np.abs(array_a) + np.abs(array_b)) | |
absmags = np.max(absmags, min_reldiff * np.max(absmags)) |
This file contains 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
''' | |
Code for demonstrating Robinson projection problems + fixes | |
As reported in : https://github.com/SciTools/cartopy/issues/23 | |
Proposed fixes in : https://github.com/SciTools/cartopy/pull/277 | |
''' | |
import sys | |
import numpy as np | |
import cartopy.crs as ccrs |