Skip to content

Instantly share code, notes, and snippets.

@cpelley
Created May 5, 2016 14:27
Show Gist options
  • Save cpelley/6bb0fcd657fb98729eb009041e7ad25b to your computer and use it in GitHub Desktop.
Save cpelley/6bb0fcd657fb98729eb009041e7ad25b to your computer and use it in GitHub Desktop.
{
"metadata": {
"name": "",
"signature": "sha256:05f4a43c46ca589337d846930f349fcde8b87fa125b344c972943419fd6f2999"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"import iris.coords\n",
"import iris.tests.stock as stock"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 'aa' as an aux coord, 'bb' as a dim coord"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"cube1 = stock.lat_lon_cube()\n",
"cube2 = stock.lat_lon_cube()\n",
"cube1.add_aux_coord(iris.coords.AuxCoord(0, long_name='aa'), None)\n",
"cube2.add_aux_coord(iris.coords.AuxCoord(1, long_name='aa'), None)\n",
"\n",
"cube1.add_aux_coord(iris.coords.DimCoord(0, long_name='bb'), None)\n",
"cube2.add_aux_coord(iris.coords.DimCoord(1, long_name='bb'), None)\n",
"\n",
"print iris.cube.CubeList([cube1, cube2]).merge_cube()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"unknown / (unknown) (bb: 2; latitude: 3; longitude: 4)\n",
" Dimension coordinates:\n",
" bb x - -\n",
" latitude - x -\n",
" longitude - - x\n",
" Auxiliary coordinates:\n",
" aa x - -\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"cube1 = stock.lat_lon_cube()\n",
"cube2 = stock.lat_lon_cube()\n",
"cube1.add_aux_coord(iris.coords.DimCoord(0, long_name='aa'), None)\n",
"cube2.add_aux_coord(iris.coords.DimCoord(1, long_name='aa'), None)\n",
"\n",
"cube1.add_aux_coord(iris.coords.AuxCoord(0, long_name='bb'), None)\n",
"cube2.add_aux_coord(iris.coords.AuxCoord(1, long_name='bb'), None)\n",
"\n",
"print iris.cube.CubeList([cube1, cube2]).merge_cube()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"unknown / (unknown) (aa: 2; latitude: 3; longitude: 4)\n",
" Dimension coordinates:\n",
" aa x - -\n",
" latitude - x -\n",
" longitude - - x\n",
" Auxiliary coordinates:\n",
" bb x - -\n"
]
}
],
"prompt_number": 6
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment