Skip to content

Instantly share code, notes, and snippets.

@andersy005
Created June 4, 2020 23:22
Show Gist options
  • Select an option

  • Save andersy005/ea000d74035355fa0bf2d9c7b6e76c10 to your computer and use it in GitHub Desktop.

Select an option

Save andersy005/ea000d74035355fa0bf2d9c7b6e76c10 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"import cupy as cp\n",
"import xarray as xr\n",
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"('7.5.0', '1.18.1', '0.15.1')"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cp.__version__, np.__version__, xr.__version__"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"x = cp.arange(6).reshape(2, 3).astype('f')\n",
"# y = cp.ones((2, 3), dtype='float32')\n",
"z = np.ones((2, 3), dtype='int32')"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<title>Show/Hide data repr</title>\n",
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<title>Show/Hide attributes</title>\n",
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
".xr-wrap {\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: '►';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: '▼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt, dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2 {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><div class='xr-wrap'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-6109aff5-d1a9-4550-9e1a-90c0388be4f9' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-6109aff5-d1a9-4550-9e1a-90c0388be4f9' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span class='xr-has-index'>lat</span>: 2</li><li><span class='xr-has-index'>lon</span>: 3</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-c724c34c-e119-4243-a439-cf1dab8718b8' class='xr-section-summary-in' type='checkbox' checked><label for='section-c724c34c-e119-4243-a439-cf1dab8718b8' class='xr-section-summary' >Coordinates: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>lat</span></div><div class='xr-var-dims'>(lat)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>40 50</div><input id='attrs-7ce3db8b-ec5a-4a90-acea-801a3d15b561' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-7ce3db8b-ec5a-4a90-acea-801a3d15b561' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-40c5dd18-178c-4fe0-96e2-6f5e1f376f5f' class='xr-var-data-in' type='checkbox'><label for='data-40c5dd18-178c-4fe0-96e2-6f5e1f376f5f' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><pre class='xr-var-data'>array([40, 50])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>lon</span></div><div class='xr-var-dims'>(lon)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>100 120 140</div><input id='attrs-3d0f1213-9760-4f6b-9659-cf4122c1b520' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-3d0f1213-9760-4f6b-9659-cf4122c1b520' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-7f3499ff-a952-4268-8e3c-ebbd955e1e41' class='xr-var-data-in' type='checkbox'><label for='data-7f3499ff-a952-4268-8e3c-ebbd955e1e41' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><pre class='xr-var-data'>array([100, 120, 140])</pre></li></ul></div></li><li class='xr-section-item'><input id='section-2e9e4de0-bae2-425c-bcdd-950e16435ca0' class='xr-section-summary-in' type='checkbox' checked><label for='section-2e9e4de0-bae2-425c-bcdd-950e16435ca0' class='xr-section-summary' >Data variables: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>x</span></div><div class='xr-var-dims'>(lat, lon)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>array([[0., 1., 2.], [3.,...</div><input id='attrs-2f48d77f-de97-4306-b845-9f3b0c775243' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-2f48d77f-de97-4306-b845-9f3b0c775243' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-dcd3d69e-67c8-481a-b9d3-f4f5eac5ebbd' class='xr-var-data-in' type='checkbox'><label for='data-dcd3d69e-67c8-481a-b9d3-f4f5eac5ebbd' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><pre class='xr-var-data'>array([[0., 1., 2.],\n",
" [3., 4., 5.]], dtype=float32)</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>z</span></div><div class='xr-var-dims'>(lat, lon)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>1 1 1 1 1 1</div><input id='attrs-122993b0-043a-498f-92b8-53134fc0df25' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-122993b0-043a-498f-92b8-53134fc0df25' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-02da1e79-1870-4f4a-a002-5144ea68563c' class='xr-var-data-in' type='checkbox'><label for='data-02da1e79-1870-4f4a-a002-5144ea68563c' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><pre class='xr-var-data'>array([[1, 1, 1],\n",
" [1, 1, 1]], dtype=int32)</pre></li></ul></div></li><li class='xr-section-item'><input id='section-fdffb39b-dedd-4cbf-a96c-0cedee3d4d40' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-fdffb39b-dedd-4cbf-a96c-0cedee3d4d40' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: (lat: 2, lon: 3)\n",
"Coordinates:\n",
" * lat (lat) int64 40 50\n",
" * lon (lon) int64 100 120 140\n",
"Data variables:\n",
" x (lat, lon) float32 array([[0., 1., 2.], [3., 4., 5.]], dt...\n",
" z (lat, lon) int32 1 1 1 1 1 1"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"lat = [40, 50]\n",
"lon = [100, 120, 140]\n",
"ds = xr.Dataset()\n",
"\n",
"ds['x'] = xr.DataArray(x, dims=['lat', 'lon'], coords={'lat': lat, 'lon': lon})\n",
"ds['z'] = xr.DataArray(z, dims=['lat', 'lon'], coords={'lat': lat, 'lon': lon})\n",
"ds"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<CUDA Device 0>"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ds.x.data.device"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[0., 1., 2.],\n",
" [3., 4., 5.]], dtype=float32)"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ds.x.data"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"cupy.core.core.ndarray"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(ds.x.data)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[1, 1, 1],\n",
" [1, 1, 1]], dtype=int32)"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ds.z.data"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"numpy.ndarray"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(ds.z.data)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<title>Show/Hide data repr</title>\n",
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<title>Show/Hide attributes</title>\n",
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
".xr-wrap {\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: '►';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: '▼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt, dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2 {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><div class='xr-wrap'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-a6cd8592-464d-49c5-87a3-fea46a0c4c0b' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-a6cd8592-464d-49c5-87a3-fea46a0c4c0b' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span class='xr-has-index'>lon</span>: 3</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-2510dc17-8bbf-481d-9c69-f776c64f813d' class='xr-section-summary-in' type='checkbox' checked><label for='section-2510dc17-8bbf-481d-9c69-f776c64f813d' class='xr-section-summary' >Coordinates: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>lon</span></div><div class='xr-var-dims'>(lon)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>100 120 140</div><input id='attrs-83f4ee1f-2a18-427b-8e3f-9d1b17a06ca1' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-83f4ee1f-2a18-427b-8e3f-9d1b17a06ca1' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-b9eb0297-a85d-4cbe-b5f0-ef12422fb4f6' class='xr-var-data-in' type='checkbox'><label for='data-b9eb0297-a85d-4cbe-b5f0-ef12422fb4f6' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><pre class='xr-var-data'>array([100, 120, 140])</pre></li></ul></div></li><li class='xr-section-item'><input id='section-0d2dd493-fc1e-4a82-bed8-1f63d3428f1f' class='xr-section-summary-in' type='checkbox' checked><label for='section-0d2dd493-fc1e-4a82-bed8-1f63d3428f1f' class='xr-section-summary' >Data variables: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>x</span></div><div class='xr-var-dims'>(lon)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>array([3., 5., 7.], dtype=float32)</div><input id='attrs-8e2cc427-5546-4508-a615-7aa7447a9672' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-8e2cc427-5546-4508-a615-7aa7447a9672' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-81172ca6-ea74-464f-95da-d8af27a550f7' class='xr-var-data-in' type='checkbox'><label for='data-81172ca6-ea74-464f-95da-d8af27a550f7' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><pre class='xr-var-data'>array([3., 5., 7.], dtype=float32)</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>z</span></div><div class='xr-var-dims'>(lon)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>2 2 2</div><input id='attrs-2c16377d-9a3d-4750-b52a-761f50cd1c52' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-2c16377d-9a3d-4750-b52a-761f50cd1c52' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-a151bcaa-c468-4c25-9e86-ed2af3f0913e' class='xr-var-data-in' type='checkbox'><label for='data-a151bcaa-c468-4c25-9e86-ed2af3f0913e' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><pre class='xr-var-data'>array([2, 2, 2])</pre></li></ul></div></li><li class='xr-section-item'><input id='section-0c27cf0d-8686-461c-b971-660db91f2af9' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-0c27cf0d-8686-461c-b971-660db91f2af9' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: (lon: 3)\n",
"Coordinates:\n",
" * lon (lon) int64 100 120 140\n",
"Data variables:\n",
" x (lon) float32 array([3., 5., 7.], dtype=float32)\n",
" z (lon) int64 2 2 2"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Compute Sum \n",
"s = ds.sum(skipna=False, dim='lat')\n",
"s"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<CUDA Device 0>"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s.x.data.device"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([2, 2, 2])"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s.z.data"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<title>Show/Hide data repr</title>\n",
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<title>Show/Hide attributes</title>\n",
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
".xr-wrap {\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: '►';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: '▼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt, dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2 {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><div class='xr-wrap'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-8fc27dab-71c0-4367-ad8b-f8896966be03' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-8fc27dab-71c0-4367-ad8b-f8896966be03' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span>nlat</span>: 40</li><li><span>nlon</span>: 320</li><li><span class='xr-has-index'>time</span>: 501</li><li><span class='xr-has-index'>z_t</span>: 60</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-043376a4-0b5e-495b-8bdc-6b0a6c1bc99d' class='xr-section-summary-in' type='checkbox' checked><label for='section-043376a4-0b5e-495b-8bdc-6b0a6c1bc99d' class='xr-section-summary' >Coordinates: <span>(6)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>time</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>0001-12-31 00:00:00 ... 0501-12-31 00:00:00</div><input id='attrs-1277938a-70c6-4837-9297-ff02a489c896' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-1277938a-70c6-4837-9297-ff02a489c896' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6091f5e3-b068-40ee-9b4f-80eca5fced2c' class='xr-var-data-in' type='checkbox'><label for='data-6091f5e3-b068-40ee-9b4f-80eca5fced2c' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><pre class='xr-var-data'>array([cftime.DatetimeNoLeap(0001-12-31 00:00:00),\n",
" cftime.DatetimeNoLeap(0002-12-31 00:00:00),\n",
" cftime.DatetimeNoLeap(0003-12-31 00:00:00), ...,\n",
" cftime.DatetimeNoLeap(0499-12-31 00:00:00),\n",
" cftime.DatetimeNoLeap(0500-12-31 00:00:00),\n",
" cftime.DatetimeNoLeap(0501-12-31 00:00:00)], dtype=object)</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>TLONG</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-6719b003-387b-47d3-9ca4-957f1924ec6f' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-6719b003-387b-47d3-9ca4-957f1924ec6f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-0b806a21-eca7-444c-8352-fdfc96f5724e' class='xr-var-data-in' type='checkbox'><label for='data-0b806a21-eca7-444c-8352-fdfc96f5724e' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of t-grid longitudes</dd><dt><span>units :</span></dt><dd>degrees_east</dd></dl></div><pre class='xr-var-data'>array([[320.553292, 321.659845, 322.766407, ..., 317.233611, 318.340173,\n",
" 319.446736],\n",
" [320.552857, 321.658539, 322.764231, ..., 317.235787, 318.341479,\n",
" 319.447171],\n",
" [320.552405, 321.657185, 322.761973, ..., 317.238045, 318.342833,\n",
" 319.447622],\n",
" ...,\n",
" [320.52087 , 321.562573, 322.604266, ..., 317.395752, 318.437445,\n",
" 319.479157],\n",
" [320.519287, 321.557825, 322.59635 , ..., 317.403668, 318.442193,\n",
" 319.48074 ],\n",
" [320.517648, 321.552906, 322.58815 , ..., 317.411868, 318.447112,\n",
" 319.482379]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>ULAT</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-4ca064e4-2de9-4a34-bf61-749e0a995f6d' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-4ca064e4-2de9-4a34-bf61-749e0a995f6d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c00fe11c-3849-40a3-8e2a-ed57bc4e2da1' class='xr-var-data-in' type='checkbox'><label for='data-c00fe11c-3849-40a3-8e2a-ed57bc4e2da1' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of u-grid latitudes</dd><dt><span>units :</span></dt><dd>degrees_north</dd></dl></div><pre class='xr-var-data'>array([[36.786189, 36.788336, 36.791915, ..., 36.788336, 36.786189, 36.785473],\n",
" [37.21674 , 37.218948, 37.222627, ..., 37.218948, 37.21674 , 37.216004],\n",
" [37.645851, 37.64812 , 37.651901, ..., 37.64812 , 37.645851, 37.645095],\n",
" ...,\n",
" [51.849619, 51.854486, 51.862593, ..., 51.854486, 51.849619, 51.847997],\n",
" [52.236288, 52.241237, 52.249483, ..., 52.241237, 52.236288, 52.234638],\n",
" [52.622225, 52.627257, 52.635642, ..., 52.627257, 52.622225, 52.620547]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>TLAT</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-aacf440a-fd69-471c-bd56-fec99f336437' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-aacf440a-fd69-471c-bd56-fec99f336437' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f45fc060-9563-412c-9ea5-89d79878b3de' class='xr-var-data-in' type='checkbox'><label for='data-f45fc060-9563-412c-9ea5-89d79878b3de' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of t-grid latitudes</dd><dt><span>units :</span></dt><dd>degrees_north</dd></dl></div><pre class='xr-var-data'>array([[36.571116, 36.572528, 36.575351, ..., 36.575351, 36.572528, 36.571116],\n",
" [37.002383, 37.003835, 37.006739, ..., 37.006739, 37.003835, 37.002383],\n",
" [37.432208, 37.4337 , 37.436684, ..., 37.436684, 37.4337 , 37.432208],\n",
" ...,\n",
" [51.656248, 51.659465, 51.665897, ..., 51.665897, 51.659465, 51.656248],\n",
" [52.043277, 52.046549, 52.053091, ..., 52.053091, 52.046549, 52.043277],\n",
" [52.429555, 52.432882, 52.439535, ..., 52.439535, 52.432882, 52.429555]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>ULONG</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-17652cfc-b5d2-43ac-9709-c0b0d7dc011f' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-17652cfc-b5d2-43ac-9709-c0b0d7dc011f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c0ef22b1-1974-43ea-8794-281329eb0308' class='xr-var-data-in' type='checkbox'><label for='data-c0ef22b1-1974-43ea-8794-281329eb0308' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of u-grid longitudes</dd><dt><span>units :</span></dt><dd>degrees_east</dd></dl></div><pre class='xr-var-data'>array([[321.106142, 322.212278, 323.318419, ..., 317.78774 , 318.893876,\n",
" 320.000019],\n",
" [321.105256, 322.210505, 323.31576 , ..., 317.789513, 318.894762,\n",
" 320.000019],\n",
" [321.104336, 322.208666, 323.313002, ..., 317.791351, 318.895682,\n",
" 320.000019],\n",
" ...,\n",
" [321.040179, 322.080339, 323.120477, ..., 317.919679, 318.959839,\n",
" 320.000018],\n",
" [321.036958, 322.073896, 323.11081 , ..., 317.926122, 318.963059,\n",
" 320.000018],\n",
" [321.033622, 322.067221, 323.100794, ..., 317.932797, 318.966396,\n",
" 320.000018]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>z_t</span></div><div class='xr-var-dims'>(z_t)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>500.0 1500.0 ... 512502.8 537500.0</div><input id='attrs-0eb5466b-d91e-4075-b954-8773f96a1508' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-0eb5466b-d91e-4075-b954-8773f96a1508' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6ca2a5ad-f8b2-4e3c-bd9a-ad592b2d20f9' class='xr-var-data-in' type='checkbox'><label for='data-6ca2a5ad-f8b2-4e3c-bd9a-ad592b2d20f9' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>depth from surface to midpoint of layer</dd><dt><span>units :</span></dt><dd>centimeters</dd><dt><span>positive :</span></dt><dd>down</dd><dt><span>valid_min :</span></dt><dd>500.0</dd><dt><span>valid_max :</span></dt><dd>537500.0</dd></dl></div><pre class='xr-var-data'>array([5.000000e+02, 1.500000e+03, 2.500000e+03, 3.500000e+03, 4.500000e+03,\n",
" 5.500000e+03, 6.500000e+03, 7.500000e+03, 8.500000e+03, 9.500000e+03,\n",
" 1.050000e+04, 1.150000e+04, 1.250000e+04, 1.350000e+04, 1.450000e+04,\n",
" 1.550000e+04, 1.650984e+04, 1.754790e+04, 1.862913e+04, 1.976603e+04,\n",
" 2.097114e+04, 2.225783e+04, 2.364088e+04, 2.513702e+04, 2.676542e+04,\n",
" 2.854837e+04, 3.051192e+04, 3.268680e+04, 3.510935e+04, 3.782276e+04,\n",
" 4.087846e+04, 4.433777e+04, 4.827367e+04, 5.277280e+04, 5.793729e+04,\n",
" 6.388626e+04, 7.075633e+04, 7.870025e+04, 8.788252e+04, 9.847059e+04,\n",
" 1.106204e+05, 1.244567e+05, 1.400497e+05, 1.573946e+05, 1.764003e+05,\n",
" 1.968944e+05, 2.186457e+05, 2.413972e+05, 2.649001e+05, 2.889385e+05,\n",
" 3.133405e+05, 3.379793e+05, 3.627670e+05, 3.876452e+05, 4.125768e+05,\n",
" 4.375392e+05, 4.625190e+05, 4.875083e+05, 5.125028e+05, 5.375000e+05],\n",
" dtype=float32)</pre></li></ul></div></li><li class='xr-section-item'><input id='section-3f420f65-bbe6-4c70-a435-e111ed129c35' class='xr-section-summary-in' type='checkbox' checked><label for='section-3f420f65-bbe6-4c70-a435-e111ed129c35' class='xr-section-summary' >Data variables: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>TEMP</span></div><div class='xr-var-dims'>(time, z_t, nlat, nlon)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-952b58f0-b546-4f53-8f12-b87abde63778' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-952b58f0-b546-4f53-8f12-b87abde63778' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-d41fd21a-a3ae-4702-872b-9d689ba08635' class='xr-var-data-in' type='checkbox'><label for='data-d41fd21a-a3ae-4702-872b-9d689ba08635' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><pre class='xr-var-data'>[384768000 values with dtype=float32]</pre></li></ul></div></li><li class='xr-section-item'><input id='section-a24ec7cb-bd62-466d-95eb-008f650fb930' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-a24ec7cb-bd62-466d-95eb-008f650fb930' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: (nlat: 40, nlon: 320, time: 501, z_t: 60)\n",
"Coordinates:\n",
" * time (time) object 0001-12-31 00:00:00 ... 0501-12-31 00:00:00\n",
" TLONG (nlat, nlon) float64 ...\n",
" ULAT (nlat, nlon) float64 ...\n",
" TLAT (nlat, nlon) float64 ...\n",
" ULONG (nlat, nlon) float64 ...\n",
" * z_t (z_t) float32 500.0 1500.0 2500.0 ... 487508.34 512502.8 537500.0\n",
"Dimensions without coordinates: nlat, nlon\n",
"Data variables:\n",
" TEMP (time, z_t, nlat, nlon) float32 ..."
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Read a netCDF file\n",
"original_ds = xr.open_dataset(\"/glade/scratch/abanihi/test.nc\")\n",
"original_ds"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"numpy.ndarray"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(original_ds.TEMP.data)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<title>Show/Hide data repr</title>\n",
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<title>Show/Hide attributes</title>\n",
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
".xr-wrap {\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: '►';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: '▼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt, dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2 {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><div class='xr-wrap'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-96879324-7424-44eb-ac73-c8ad49ea52d9' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-96879324-7424-44eb-ac73-c8ad49ea52d9' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span>nlat</span>: 40</li><li><span>nlon</span>: 320</li><li><span class='xr-has-index'>time</span>: 501</li><li><span class='xr-has-index'>z_t</span>: 60</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-d762daff-2d96-4d4e-be89-9119140b8dfe' class='xr-section-summary-in' type='checkbox' checked><label for='section-d762daff-2d96-4d4e-be89-9119140b8dfe' class='xr-section-summary' >Coordinates: <span>(6)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>time</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>0001-12-31 00:00:00 ... 0501-12-31 00:00:00</div><input id='attrs-a361dee5-50a3-4763-8ba6-05437bcf677d' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-a361dee5-50a3-4763-8ba6-05437bcf677d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-bdcb3eb7-9790-457c-938b-50387fc864b1' class='xr-var-data-in' type='checkbox'><label for='data-bdcb3eb7-9790-457c-938b-50387fc864b1' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><pre class='xr-var-data'>array([cftime.DatetimeNoLeap(0001-12-31 00:00:00),\n",
" cftime.DatetimeNoLeap(0002-12-31 00:00:00),\n",
" cftime.DatetimeNoLeap(0003-12-31 00:00:00), ...,\n",
" cftime.DatetimeNoLeap(0499-12-31 00:00:00),\n",
" cftime.DatetimeNoLeap(0500-12-31 00:00:00),\n",
" cftime.DatetimeNoLeap(0501-12-31 00:00:00)], dtype=object)</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>ULAT</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>36.79 36.79 36.79 ... 52.62 52.62</div><input id='attrs-bcfec195-9a84-4790-be95-76670a9499f6' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-bcfec195-9a84-4790-be95-76670a9499f6' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c22c0279-55ef-451c-8a4c-68f1935f4142' class='xr-var-data-in' type='checkbox'><label for='data-c22c0279-55ef-451c-8a4c-68f1935f4142' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of u-grid latitudes</dd><dt><span>units :</span></dt><dd>degrees_north</dd></dl></div><pre class='xr-var-data'>array([[36.78618895, 36.78833647, 36.7919147 , ..., 36.78833647,\n",
" 36.78618895, 36.78547301],\n",
" [37.21674003, 37.21894794, 37.22262676, ..., 37.21894794,\n",
" 37.21674003, 37.21600396],\n",
" [37.64585128, 37.6481204 , 37.65190124, ..., 37.6481204 ,\n",
" 37.64585128, 37.6450948 ],\n",
" ...,\n",
" [51.84961913, 51.85448553, 51.86259344, ..., 51.85448553,\n",
" 51.84961913, 51.84799672],\n",
" [52.23628814, 52.24123746, 52.24948349, ..., 52.24123746,\n",
" 52.23628814, 52.23463808],\n",
" [52.62222517, 52.62725747, 52.63564173, ..., 52.62725747,\n",
" 52.62222517, 52.62054744]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>TLAT</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>36.57 36.57 36.58 ... 52.43 52.43</div><input id='attrs-32cec49f-86b5-4cf0-9933-1de731567014' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-32cec49f-86b5-4cf0-9933-1de731567014' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-985e6aa6-4cda-418f-90fb-52c4c84d6239' class='xr-var-data-in' type='checkbox'><label for='data-985e6aa6-4cda-418f-90fb-52c4c84d6239' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of t-grid latitudes</dd><dt><span>units :</span></dt><dd>degrees_north</dd></dl></div><pre class='xr-var-data'>array([[36.57111564, 36.57252758, 36.57535083, ..., 36.57535083,\n",
" 36.57252758, 36.57111569],\n",
" [37.00238345, 37.00383535, 37.00673853, ..., 37.00673853,\n",
" 37.00383535, 37.00238349],\n",
" [37.43220774, 37.43370019, 37.43668441, ..., 37.43668441,\n",
" 37.43370019, 37.43220779],\n",
" ...,\n",
" [51.65624839, 51.65946518, 51.6658971 , ..., 51.6658971 ,\n",
" 51.65946518, 51.65624843],\n",
" [52.04327673, 52.04654877, 52.05309111, ..., 52.05309111,\n",
" 52.04654877, 52.04327677],\n",
" [52.42955479, 52.43288212, 52.43953502, ..., 52.43953502,\n",
" 52.43288212, 52.42955483]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>ULONG</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>321.1 322.2 323.3 ... 319.0 320.0</div><input id='attrs-f8626202-1bdf-4a47-b09f-a1201ec6e155' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-f8626202-1bdf-4a47-b09f-a1201ec6e155' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-8afdc3e1-4247-48b4-96cd-33f286ca3bdc' class='xr-var-data-in' type='checkbox'><label for='data-8afdc3e1-4247-48b4-96cd-33f286ca3bdc' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of u-grid longitudes</dd><dt><span>units :</span></dt><dd>degrees_east</dd></dl></div><pre class='xr-var-data'>array([[321.10614208, 322.21227801, 323.31841946, ..., 317.7877398 ,\n",
" 318.89387573, 320.00001875],\n",
" [321.1052556 , 322.21050508, 323.31576013, ..., 317.78951273,\n",
" 318.89476221, 320.00001875],\n",
" [321.10433627, 322.20866643, 323.31300218, ..., 317.79135138,\n",
" 318.89568154, 320.00001874],\n",
" ...,\n",
" [321.04017906, 322.08033854, 323.12047672, ..., 317.91967927,\n",
" 318.95983875, 320.00001817],\n",
" [321.03695847, 322.07389611, 323.11080995, ..., 317.9261217 ,\n",
" 318.96305934, 320.00001814],\n",
" [321.03362171, 322.06722124, 323.10079431, ..., 317.93279657,\n",
" 318.9663961 , 320.00001811]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>TLONG</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>320.6 321.7 322.8 ... 318.4 319.5</div><input id='attrs-694cb86f-6ff0-4ad6-8d30-c73547b79de0' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-694cb86f-6ff0-4ad6-8d30-c73547b79de0' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f78d6f7f-be74-489a-9e90-f2916313260f' class='xr-var-data-in' type='checkbox'><label for='data-f78d6f7f-be74-489a-9e90-f2916313260f' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of t-grid longitudes</dd><dt><span>units :</span></dt><dd>degrees_east</dd></dl></div><pre class='xr-var-data'>array([[320.55329214, 321.6598452 , 322.7664073 , ..., 317.23361051,\n",
" 318.34017261, 319.44673553],\n",
" [320.55285678, 321.65853916, 322.76423061, ..., 317.2357872 ,\n",
" 318.34147865, 319.44717087],\n",
" [320.55240524, 321.65718456, 322.76197298, ..., 317.23804483,\n",
" 318.34283325, 319.4476224 ],\n",
" ...,\n",
" [320.52086993, 321.56257303, 322.60426566, ..., 317.39575215,\n",
" 318.43744478, 319.47915715],\n",
" [320.51928744, 321.55782499, 322.59635025, ..., 317.40366756,\n",
" 318.44219282, 319.48073962],\n",
" [320.51764799, 321.55290604, 322.58814984, ..., 317.41186797,\n",
" 318.44711177, 319.48237904]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>z_t</span></div><div class='xr-var-dims'>(z_t)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>500.0 1500.0 ... 512502.8 537500.0</div><input id='attrs-9d4042a4-bb7d-4935-9512-a697010038f9' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-9d4042a4-bb7d-4935-9512-a697010038f9' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-4a45006f-6513-47e7-a5fb-b2a82e6cac85' class='xr-var-data-in' type='checkbox'><label for='data-4a45006f-6513-47e7-a5fb-b2a82e6cac85' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>depth from surface to midpoint of layer</dd><dt><span>units :</span></dt><dd>centimeters</dd><dt><span>positive :</span></dt><dd>down</dd><dt><span>valid_min :</span></dt><dd>500.0</dd><dt><span>valid_max :</span></dt><dd>537500.0</dd></dl></div><pre class='xr-var-data'>array([5.000000e+02, 1.500000e+03, 2.500000e+03, 3.500000e+03, 4.500000e+03,\n",
" 5.500000e+03, 6.500000e+03, 7.500000e+03, 8.500000e+03, 9.500000e+03,\n",
" 1.050000e+04, 1.150000e+04, 1.250000e+04, 1.350000e+04, 1.450000e+04,\n",
" 1.550000e+04, 1.650984e+04, 1.754790e+04, 1.862913e+04, 1.976603e+04,\n",
" 2.097114e+04, 2.225783e+04, 2.364088e+04, 2.513702e+04, 2.676542e+04,\n",
" 2.854837e+04, 3.051192e+04, 3.268680e+04, 3.510935e+04, 3.782276e+04,\n",
" 4.087846e+04, 4.433777e+04, 4.827367e+04, 5.277280e+04, 5.793729e+04,\n",
" 6.388626e+04, 7.075633e+04, 7.870025e+04, 8.788252e+04, 9.847059e+04,\n",
" 1.106204e+05, 1.244567e+05, 1.400497e+05, 1.573946e+05, 1.764003e+05,\n",
" 1.968944e+05, 2.186457e+05, 2.413972e+05, 2.649001e+05, 2.889385e+05,\n",
" 3.133405e+05, 3.379793e+05, 3.627670e+05, 3.876452e+05, 4.125768e+05,\n",
" 4.375392e+05, 4.625190e+05, 4.875083e+05, 5.125028e+05, 5.375000e+05],\n",
" dtype=float32)</pre></li></ul></div></li><li class='xr-section-item'><input id='section-1a17acfc-40a1-4947-9857-c0ed327ce52e' class='xr-section-summary-in' type='checkbox' checked><label for='section-1a17acfc-40a1-4947-9857-c0ed327ce52e' class='xr-section-summary' >Data variables: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>TEMP</span></div><div class='xr-var-dims'>(time, z_t, nlat, nlon)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0</div><input id='attrs-c962d74c-518f-436b-99ef-f761227b2141' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-c962d74c-518f-436b-99ef-f761227b2141' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c8015bb9-3001-4b38-adc6-7d4046af6c3f' class='xr-var-data-in' type='checkbox'><label for='data-c8015bb9-3001-4b38-adc6-7d4046af6c3f' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><pre class='xr-var-data'>array([[[[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" ...,\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]]],\n",
"\n",
"\n",
" [[[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" ...,\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]]],\n",
"\n",
"\n",
" [[[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" ...,\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]]],\n",
"\n",
"\n",
" ...,\n",
"\n",
"\n",
" [[[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" ...,\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]]],\n",
"\n",
"\n",
" [[[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" ...,\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]]],\n",
"\n",
"\n",
" [[[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" ...,\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]],\n",
"\n",
" [[0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" ...,\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.],\n",
" [0., 0., 0., ..., 0., 0., 0.]]]], dtype=float32)</pre></li></ul></div></li><li class='xr-section-item'><input id='section-bf7ae151-18f6-4a32-af5f-8a16dc9f1e05' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-bf7ae151-18f6-4a32-af5f-8a16dc9f1e05' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: (nlat: 40, nlon: 320, time: 501, z_t: 60)\n",
"Coordinates:\n",
" * time (time) object 0001-12-31 00:00:00 ... 0501-12-31 00:00:00\n",
" ULAT (nlat, nlon) float64 36.79 36.79 36.79 36.8 ... 52.63 52.62 52.62\n",
" TLAT (nlat, nlon) float64 36.57 36.57 36.58 36.58 ... 52.44 52.43 52.43\n",
" ULONG (nlat, nlon) float64 321.1 322.2 323.3 324.4 ... 317.9 319.0 320.0\n",
" TLONG (nlat, nlon) float64 320.6 321.7 322.8 323.9 ... 317.4 318.4 319.5\n",
" * z_t (z_t) float32 500.0 1500.0 2500.0 ... 487508.34 512502.8 537500.0\n",
"Dimensions without coordinates: nlat, nlon\n",
"Data variables:\n",
" TEMP (time, z_t, nlat, nlon) float32 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Create a placeholder xarray.Dataset\n",
"ds = xr.zeros_like(original_ds)\n",
"ds"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<title>Show/Hide data repr</title>\n",
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<title>Show/Hide attributes</title>\n",
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
".xr-wrap {\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: '►';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: '▼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt, dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2 {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><div class='xr-wrap'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-0112e600-c3bd-4978-a006-489a82d0d255' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-0112e600-c3bd-4978-a006-489a82d0d255' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span>nlat</span>: 40</li><li><span>nlon</span>: 320</li><li><span class='xr-has-index'>time</span>: 501</li><li><span class='xr-has-index'>z_t</span>: 60</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-c49f0b27-3781-4773-8440-12066eb21319' class='xr-section-summary-in' type='checkbox' checked><label for='section-c49f0b27-3781-4773-8440-12066eb21319' class='xr-section-summary' >Coordinates: <span>(6)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>time</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>0001-12-31 00:00:00 ... 0501-12-31 00:00:00</div><input id='attrs-432a72bf-d5f9-4f78-8f52-d4d19a71b13f' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-432a72bf-d5f9-4f78-8f52-d4d19a71b13f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-222420fc-894f-495a-9c74-761d3a7bcb8b' class='xr-var-data-in' type='checkbox'><label for='data-222420fc-894f-495a-9c74-761d3a7bcb8b' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><pre class='xr-var-data'>array([cftime.DatetimeNoLeap(0001-12-31 00:00:00),\n",
" cftime.DatetimeNoLeap(0002-12-31 00:00:00),\n",
" cftime.DatetimeNoLeap(0003-12-31 00:00:00), ...,\n",
" cftime.DatetimeNoLeap(0499-12-31 00:00:00),\n",
" cftime.DatetimeNoLeap(0500-12-31 00:00:00),\n",
" cftime.DatetimeNoLeap(0501-12-31 00:00:00)], dtype=object)</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>ULAT</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>36.79 36.79 36.79 ... 52.62 52.62</div><input id='attrs-f5b7a704-2cc8-4bff-8cc7-3e565b44d9d2' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-f5b7a704-2cc8-4bff-8cc7-3e565b44d9d2' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-bbc6c352-b7b9-4370-b95c-1ec4612ecd91' class='xr-var-data-in' type='checkbox'><label for='data-bbc6c352-b7b9-4370-b95c-1ec4612ecd91' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of u-grid latitudes</dd><dt><span>units :</span></dt><dd>degrees_north</dd></dl></div><pre class='xr-var-data'>array([[36.78618895, 36.78833647, 36.7919147 , ..., 36.78833647,\n",
" 36.78618895, 36.78547301],\n",
" [37.21674003, 37.21894794, 37.22262676, ..., 37.21894794,\n",
" 37.21674003, 37.21600396],\n",
" [37.64585128, 37.6481204 , 37.65190124, ..., 37.6481204 ,\n",
" 37.64585128, 37.6450948 ],\n",
" ...,\n",
" [51.84961913, 51.85448553, 51.86259344, ..., 51.85448553,\n",
" 51.84961913, 51.84799672],\n",
" [52.23628814, 52.24123746, 52.24948349, ..., 52.24123746,\n",
" 52.23628814, 52.23463808],\n",
" [52.62222517, 52.62725747, 52.63564173, ..., 52.62725747,\n",
" 52.62222517, 52.62054744]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>TLAT</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>36.57 36.57 36.58 ... 52.43 52.43</div><input id='attrs-94fb4000-6561-428f-a027-4ba4a069d561' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-94fb4000-6561-428f-a027-4ba4a069d561' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-c2e0a8d7-17c4-41e8-a811-9b1a1759806e' class='xr-var-data-in' type='checkbox'><label for='data-c2e0a8d7-17c4-41e8-a811-9b1a1759806e' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of t-grid latitudes</dd><dt><span>units :</span></dt><dd>degrees_north</dd></dl></div><pre class='xr-var-data'>array([[36.57111564, 36.57252758, 36.57535083, ..., 36.57535083,\n",
" 36.57252758, 36.57111569],\n",
" [37.00238345, 37.00383535, 37.00673853, ..., 37.00673853,\n",
" 37.00383535, 37.00238349],\n",
" [37.43220774, 37.43370019, 37.43668441, ..., 37.43668441,\n",
" 37.43370019, 37.43220779],\n",
" ...,\n",
" [51.65624839, 51.65946518, 51.6658971 , ..., 51.6658971 ,\n",
" 51.65946518, 51.65624843],\n",
" [52.04327673, 52.04654877, 52.05309111, ..., 52.05309111,\n",
" 52.04654877, 52.04327677],\n",
" [52.42955479, 52.43288212, 52.43953502, ..., 52.43953502,\n",
" 52.43288212, 52.42955483]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>ULONG</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>321.1 322.2 323.3 ... 319.0 320.0</div><input id='attrs-7612fe77-4b2b-437a-9ffa-99f27ce1248b' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-7612fe77-4b2b-437a-9ffa-99f27ce1248b' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-5ee539b1-21e3-4ab4-9dc7-26b66e338303' class='xr-var-data-in' type='checkbox'><label for='data-5ee539b1-21e3-4ab4-9dc7-26b66e338303' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of u-grid longitudes</dd><dt><span>units :</span></dt><dd>degrees_east</dd></dl></div><pre class='xr-var-data'>array([[321.10614208, 322.21227801, 323.31841946, ..., 317.7877398 ,\n",
" 318.89387573, 320.00001875],\n",
" [321.1052556 , 322.21050508, 323.31576013, ..., 317.78951273,\n",
" 318.89476221, 320.00001875],\n",
" [321.10433627, 322.20866643, 323.31300218, ..., 317.79135138,\n",
" 318.89568154, 320.00001874],\n",
" ...,\n",
" [321.04017906, 322.08033854, 323.12047672, ..., 317.91967927,\n",
" 318.95983875, 320.00001817],\n",
" [321.03695847, 322.07389611, 323.11080995, ..., 317.9261217 ,\n",
" 318.96305934, 320.00001814],\n",
" [321.03362171, 322.06722124, 323.10079431, ..., 317.93279657,\n",
" 318.9663961 , 320.00001811]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>TLONG</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>320.6 321.7 322.8 ... 318.4 319.5</div><input id='attrs-4aad72b5-91c5-4e02-9780-133ba3547db3' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-4aad72b5-91c5-4e02-9780-133ba3547db3' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ceed272f-f8f7-4390-aa64-f4ccd4e46327' class='xr-var-data-in' type='checkbox'><label for='data-ceed272f-f8f7-4390-aa64-f4ccd4e46327' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of t-grid longitudes</dd><dt><span>units :</span></dt><dd>degrees_east</dd></dl></div><pre class='xr-var-data'>array([[320.55329214, 321.6598452 , 322.7664073 , ..., 317.23361051,\n",
" 318.34017261, 319.44673553],\n",
" [320.55285678, 321.65853916, 322.76423061, ..., 317.2357872 ,\n",
" 318.34147865, 319.44717087],\n",
" [320.55240524, 321.65718456, 322.76197298, ..., 317.23804483,\n",
" 318.34283325, 319.4476224 ],\n",
" ...,\n",
" [320.52086993, 321.56257303, 322.60426566, ..., 317.39575215,\n",
" 318.43744478, 319.47915715],\n",
" [320.51928744, 321.55782499, 322.59635025, ..., 317.40366756,\n",
" 318.44219282, 319.48073962],\n",
" [320.51764799, 321.55290604, 322.58814984, ..., 317.41186797,\n",
" 318.44711177, 319.48237904]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>z_t</span></div><div class='xr-var-dims'>(z_t)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>500.0 1500.0 ... 512502.8 537500.0</div><input id='attrs-ee7f1d08-1824-479e-9bdb-03cbda0589fc' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-ee7f1d08-1824-479e-9bdb-03cbda0589fc' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-7aa5e66a-bbcb-4fa6-9564-5076ed4ca147' class='xr-var-data-in' type='checkbox'><label for='data-7aa5e66a-bbcb-4fa6-9564-5076ed4ca147' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>depth from surface to midpoint of layer</dd><dt><span>units :</span></dt><dd>centimeters</dd><dt><span>positive :</span></dt><dd>down</dd><dt><span>valid_min :</span></dt><dd>500.0</dd><dt><span>valid_max :</span></dt><dd>537500.0</dd></dl></div><pre class='xr-var-data'>array([5.000000e+02, 1.500000e+03, 2.500000e+03, 3.500000e+03, 4.500000e+03,\n",
" 5.500000e+03, 6.500000e+03, 7.500000e+03, 8.500000e+03, 9.500000e+03,\n",
" 1.050000e+04, 1.150000e+04, 1.250000e+04, 1.350000e+04, 1.450000e+04,\n",
" 1.550000e+04, 1.650984e+04, 1.754790e+04, 1.862913e+04, 1.976603e+04,\n",
" 2.097114e+04, 2.225783e+04, 2.364088e+04, 2.513702e+04, 2.676542e+04,\n",
" 2.854837e+04, 3.051192e+04, 3.268680e+04, 3.510935e+04, 3.782276e+04,\n",
" 4.087846e+04, 4.433777e+04, 4.827367e+04, 5.277280e+04, 5.793729e+04,\n",
" 6.388626e+04, 7.075633e+04, 7.870025e+04, 8.788252e+04, 9.847059e+04,\n",
" 1.106204e+05, 1.244567e+05, 1.400497e+05, 1.573946e+05, 1.764003e+05,\n",
" 1.968944e+05, 2.186457e+05, 2.413972e+05, 2.649001e+05, 2.889385e+05,\n",
" 3.133405e+05, 3.379793e+05, 3.627670e+05, 3.876452e+05, 4.125768e+05,\n",
" 4.375392e+05, 4.625190e+05, 4.875083e+05, 5.125028e+05, 5.375000e+05],\n",
" dtype=float32)</pre></li></ul></div></li><li class='xr-section-item'><input id='section-b78e62ec-265b-4663-a185-b4dfbc24a7df' class='xr-section-summary-in' type='checkbox' checked><label for='section-b78e62ec-265b-4663-a185-b4dfbc24a7df' class='xr-section-summary' >Data variables: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>TEMP</span></div><div class='xr-var-dims'>(time, z_t, nlat, nlon)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>array([[[[21.878016 , 21.796999 ...</div><input id='attrs-70f97954-a45e-4645-8d25-f68ca64094ee' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-70f97954-a45e-4645-8d25-f68ca64094ee' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f7feecdc-5c9d-4f27-b5ce-f24ca78a5f9d' class='xr-var-data-in' type='checkbox'><label for='data-f7feecdc-5c9d-4f27-b5ce-f24ca78a5f9d' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><pre class='xr-var-data'>array([[[[21.878016 , 21.796999 , 21.702028 , ..., 22.0578 ,\n",
" 22.010414 , 21.948908 ],\n",
" [21.68315 , 21.622856 , 21.552776 , ..., 21.818754 ,\n",
" 21.781353 , 21.735485 ],\n",
" [21.455687 , 21.416647 , 21.376188 , ..., 21.55873 ,\n",
" 21.528133 , 21.493477 ],\n",
" ...,\n",
" [ 7.0643697, 7.3414655, 7.6288753, ..., 6.243091 ,\n",
" 6.5187273, 6.790642 ],\n",
" [ 6.8868775, 7.161008 , 7.462405 , ..., 6.1381655,\n",
" 6.3842545, 6.6309495],\n",
" [ 6.719968 , 7.0003514, 7.3224916, ..., 6.0241847,\n",
" 6.243364 , 6.4712696]],\n",
"\n",
" [[21.83025 , 21.750807 , 21.657509 , ..., 22.007069 ,\n",
" 21.960655 , 21.9 ],\n",
" [21.634186 , 21.57563 , 21.507017 , ..., 21.76694 ,\n",
" 21.730318 , 21.685167 ],\n",
" [21.40528 , 21.367853 , 21.328365 , ..., 21.504805 ,\n",
" 21.474836 , 21.441069 ],\n",
" ...,\n",
" [ 7.0284495, 7.3031936, 7.5882826, ..., 6.205745 ,\n",
" 6.4829655, 6.754924 ],\n",
" [ 6.8517303, 7.124169 , 7.42267 , ..., 6.101436 ,\n",
" 6.3485537, 6.5952196],\n",
" [ 6.6846023, 6.964988 , 7.284637 , ..., 5.9876704,\n",
" 6.207652 , 6.435481 ]],\n",
"\n",
" [[21.712826 , 21.64309 , 21.55745 , ..., 21.86759 ,\n",
" 21.827858 , 21.773462 ],\n",
" [21.500483 , 21.453121 , 21.394707 , ..., 21.609327 ,\n",
" 21.57949 , 21.541515 ],\n",
" [21.25043 , 21.22542 , 21.19908 , ..., 21.325792 ,\n",
" 21.304602 , 21.278622 ],\n",
" ...,\n",
" [ 6.9474483, 7.2158084, 7.4947996, ..., 6.1269975,\n",
" 6.4076443, 6.6780367],\n",
" [ 6.7760925, 7.042153 , 7.3348417, ..., 6.0288954,\n",
" 6.2787476, 6.524341 ],\n",
" [ 6.6149044, 6.8884735, 7.2023816, ..., 5.919592 ,\n",
" 6.141048 , 6.370342 ]],\n",
"\n",
" ...,\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]],\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]],\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]]],\n",
"\n",
"\n",
" [[[21.148008 , 21.199526 , 21.23475 , ..., 20.962963 ,\n",
" 21.028257 , 21.09065 ],\n",
" [20.867891 , 20.937037 , 20.999565 , ..., 20.667318 ,\n",
" 20.730558 , 20.798729 ],\n",
" [20.56439 , 20.648483 , 20.738556 , ..., 20.359426 ,\n",
" 20.418072 , 20.486559 ],\n",
" ...,\n",
" [ 7.66163 , 8.014474 , 8.37759 , ..., 6.6640897,\n",
" 6.988352 , 7.320475 ],\n",
" [ 7.5424805, 7.8940244, 8.262328 , ..., 6.597706 ,\n",
" 6.89957 , 7.211432 ],\n",
" [ 7.4134192, 7.766443 , 8.143697 , ..., 6.5089993,\n",
" 6.790884 , 7.0887375]],\n",
"\n",
" [[21.093294 , 21.14622 , 21.182413 , ..., 20.904547 ,\n",
" 20.970385 , 21.03374 ],\n",
" [20.81272 , 20.883677 , 20.947594 , ..., 20.608614 ,\n",
" 20.673271 , 20.742449 ],\n",
" [20.507616 , 20.59377 , 20.685278 , ..., 20.299528 ,\n",
" 20.359568 , 20.42883 ],\n",
" ...,\n",
" [ 7.614221 , 7.9696145, 8.333486 , ..., 6.61315 ,\n",
" 6.938236 , 7.26981 ],\n",
" [ 7.496208 , 7.849934 , 8.219848 , ..., 6.546971 ,\n",
" 6.8511944, 7.163279 ],\n",
" [ 7.366488 , 7.7216377, 8.101523 , ..., 6.4590316,\n",
" 6.743902 , 7.0414214]],\n",
"\n",
" [[20.955635 , 21.015606 , 21.056694 , ..., 20.75059 ,\n",
" 20.819967 , 20.887846 ],\n",
" [20.663177 , 20.744202 , 20.815676 , ..., 20.440256 ,\n",
" 20.50988 , 20.584349 ],\n",
" [20.340128 , 20.437437 , 20.541632 , ..., 20.111742 ,\n",
" 20.178755 , 20.253952 ],\n",
" ...,\n",
" [ 7.484007 , 7.8421617, 8.2082615, ..., 6.450442 ,\n",
" 6.788547 , 7.1343217],\n",
" [ 7.3692265, 7.7214866, 8.093003 , ..., 6.386742 ,\n",
" 6.705628 , 7.033403 ],\n",
" [ 7.2413936, 7.5928206, 7.9740644, ..., 6.300081 ,\n",
" 6.6008415, 6.9133916]],\n",
"\n",
" ...,\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]],\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]],\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]]],\n",
"\n",
"\n",
" [[[21.21716 , 21.267319 , 21.313477 , ..., 21.058813 ,\n",
" 21.113167 , 21.164822 ],\n",
" [20.895647 , 20.966152 , 21.036932 , ..., 20.704914 ,\n",
" 20.762693 , 20.82588 ],\n",
" [20.54992 , 20.638268 , 20.73588 , ..., 20.339369 ,\n",
" 20.396524 , 20.465366 ],\n",
" ...,\n",
" [ 6.1481004, 6.5150447, 6.915972 , ..., 5.225466 ,\n",
" 5.5031276, 5.8106155],\n",
" [ 6.1157393, 6.496735 , 6.9215693, ..., 5.1929517,\n",
" 5.4672074, 5.7730656],\n",
" [ 6.088787 , 6.489363 , 6.9462547, ..., 5.16602 ,\n",
" 5.4352393, 5.7392693]],\n",
"\n",
" [[21.16165 , 21.21407 , 21.262604 , ..., 21.005234 ,\n",
" 21.058853 , 21.109152 ],\n",
" [20.842619 , 20.91431 , 20.98662 , ..., 20.652023 ,\n",
" 20.709728 , 20.77298 ],\n",
" [20.496769 , 20.585806 , 20.684212 , ..., 20.28522 ,\n",
" 20.342329 , 20.41176 ],\n",
" ...,\n",
" [ 6.1228843, 6.4914336, 6.8940887, ..., 5.1996236,\n",
" 5.476486 , 5.784529 ],\n",
" [ 6.0932364, 6.475277 , 6.901777 , ..., 5.168452 ,\n",
" 5.4433784, 5.7499466],\n",
" [ 6.0677714, 6.4690776, 6.9277053, ..., 5.1421714,\n",
" 5.4127707, 5.717756 ]],\n",
"\n",
" [[20.985888 , 21.051344 , 21.12118 , ..., 20.81361 ,\n",
" 20.864656 , 20.9218 ],\n",
" [20.661627 , 20.74517 , 20.838182 , ..., 20.454823 ,\n",
" 20.511103 , 20.580805 ],\n",
" [20.304619 , 20.406416 , 20.526312 , ..., 20.076508 ,\n",
" 20.133507 , 20.209923 ],\n",
" ...,\n",
" [ 6.0674405, 6.436994 , 6.842504 , ..., 5.1592 ,\n",
" 5.4292436, 5.730887 ],\n",
" [ 6.042855 , 6.426039 , 6.855738 , ..., 5.13192 ,\n",
" 5.4017854, 5.7026367],\n",
" [ 6.022713 , 6.42523 , 6.8861976, ..., 5.107648 ,\n",
" 5.374817 , 5.6755567]],\n",
"\n",
" ...,\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]],\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]],\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]]],\n",
"\n",
"\n",
" ...,\n",
"\n",
"\n",
" [[[21.01689 , 21.122374 , 21.222237 , ..., 20.77508 ,\n",
" 20.846252 , 20.923088 ],\n",
" [20.705677 , 20.822811 , 20.94287 , ..., 20.454714 ,\n",
" 20.524712 , 20.606016 ],\n",
" [20.392622 , 20.520052 , 20.659536 , ..., 20.138348 ,\n",
" 20.204435 , 20.287834 ],\n",
" ...,\n",
" [ 7.701753 , 8.002766 , 8.32737 , ..., 6.8951774,\n",
" 7.144974 , 7.416963 ],\n",
" [ 7.6862464, 7.984609 , 8.315572 , ..., 6.9146004,\n",
" 7.152796 , 7.4117303],\n",
" [ 7.6759377, 7.9813957, 8.329667 , ..., 6.943537 ,\n",
" 7.1623597, 7.406166 ]],\n",
"\n",
" [[20.968195 , 21.074759 , 21.1761 , ..., 20.720535 ,\n",
" 20.79448 , 20.873335 ],\n",
" [20.656525 , 20.775236 , 20.896616 , ..., 20.399622 ,\n",
" 20.471674 , 20.555267 ],\n",
" [20.340492 , 20.469131 , 20.609358 , ..., 20.079813 ,\n",
" 20.147518 , 20.233574 ],\n",
" ...,\n",
" [ 7.6525216, 7.956751 , 8.2811575, ..., 6.845572 ,\n",
" 7.0930386, 7.365401 ],\n",
" [ 7.636021 , 7.9380555, 8.270895 , ..., 6.864633 ,\n",
" 7.098742 , 7.358209 ],\n",
" [ 7.6247888, 7.934101 , 8.284878 , ..., 6.89292 ,\n",
" 7.106336 , 7.351254 ]],\n",
"\n",
" [[20.840048 , 20.945665 , 21.04632 , ..., 20.571447 ,\n",
" 20.65371 , 20.740395 ],\n",
" [20.52959 , 20.64843 , 20.769445 , ..., 20.245777 ,\n",
" 20.330614 , 20.423904 ],\n",
" [20.209673 , 20.338018 , 20.47771 , ..., 19.910887 ,\n",
" 19.996834 , 20.096292 ],\n",
" ...,\n",
" [ 7.5484314, 7.8582015, 8.184886 , ..., 6.7201576,\n",
" 6.965526 , 7.24749 ],\n",
" [ 7.532886 , 7.8430023, 8.182106 , ..., 6.7400756,\n",
" 6.9735656, 7.242392 ],\n",
" [ 7.5214844, 7.8407397, 8.201515 , ..., 6.7689757,\n",
" 6.9837165, 7.236097 ]],\n",
"\n",
" ...,\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]],\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]],\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]]],\n",
"\n",
"\n",
" [[[21.290926 , 21.331972 , 21.358444 , ..., 21.181648 ,\n",
" 21.209255 , 21.24454 ],\n",
" [21.044464 , 21.096437 , 21.144056 , ..., 20.925196 ,\n",
" 20.955751 , 20.993563 ],\n",
" [20.787382 , 20.850698 , 20.917421 , ..., 20.660597 ,\n",
" 20.69293 , 20.733011 ],\n",
" ...,\n",
" [ 7.640323 , 7.8871994, 8.169343 , ..., 7.1114674,\n",
" 7.2551 , 7.429981 ],\n",
" [ 7.627177 , 7.8816476, 8.179875 , ..., 7.115683 ,\n",
" 7.248692 , 7.417337 ],\n",
" [ 7.6250305, 7.8915153, 8.21058 , ..., 7.1306763,\n",
" 7.2510695, 7.413752 ]],\n",
"\n",
" [[21.24306 , 21.286097 , 21.315136 , ..., 21.126068 ,\n",
" 21.157553 , 21.195267 ],\n",
" [20.99617 , 21.050848 , 21.100622 , ..., 20.86605 ,\n",
" 20.901503 , 20.942423 ],\n",
" [20.7372 , 20.80297 , 20.871576 , ..., 20.597185 ,\n",
" 20.63513 , 20.679323 ],\n",
" ...,\n",
" [ 7.596817 , 7.8425956, 8.125356 , ..., 7.0718675,\n",
" 7.215225 , 7.3885403],\n",
" [ 7.5858383, 7.838604 , 8.135543 , ..., 7.0775466,\n",
" 7.2102394, 7.377947 ],\n",
" [ 7.5844417, 7.84952 , 8.167491 , ..., 7.09331 ,\n",
" 7.2135215, 7.3749785]],\n",
"\n",
" [[21.117666 , 21.170341 , 21.211245 , ..., 20.931543 ,\n",
" 20.98616 , 21.05275 ],\n",
" [20.863647 , 20.930471 , 20.99257 , ..., 20.663483 ,\n",
" 20.71784 , 20.788666 ],\n",
" [20.589777 , 20.670948 , 20.753315 , ..., 20.385086 ,\n",
" 20.438246 , 20.50914 ],\n",
" ...,\n",
" [ 7.4769993, 7.7322426, 8.025948 , ..., 6.9425216,\n",
" 7.08676 , 7.261944 ],\n",
" [ 7.4629416, 7.7279053, 8.03859 , ..., 6.943258 ,\n",
" 7.0755324, 7.245314 ],\n",
" [ 7.4556084, 7.737053 , 8.070933 , ..., 6.9532185,\n",
" 7.069798 , 7.2333045]],\n",
"\n",
" ...,\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]],\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]],\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]]],\n",
"\n",
"\n",
" [[[20.774746 , 20.858139 , 20.911516 , ..., 20.55983 ,\n",
" 20.605717 , 20.683388 ],\n",
" [20.51748 , 20.619942 , 20.7011 , ..., 20.281593 ,\n",
" 20.33091 , 20.415188 ],\n",
" [20.243097 , 20.361284 , 20.4693 , ..., 19.999166 ,\n",
" 20.049532 , 20.135618 ],\n",
" ...,\n",
" [ 6.9141107, 7.1328554, 7.394421 , ..., 6.382046 ,\n",
" 6.5545983, 6.7267084],\n",
" [ 6.8816376, 7.1113367, 7.392432 , ..., 6.3424015,\n",
" 6.514941 , 6.689095 ],\n",
" [ 6.850295 , 7.09841 , 7.4043174, ..., 6.3029885,\n",
" 6.472588 , 6.648792 ]],\n",
"\n",
" [[20.774511 , 20.856342 , 20.90985 , ..., 20.55924 ,\n",
" 20.605095 , 20.682686 ],\n",
" [20.516712 , 20.618961 , 20.699888 , ..., 20.280855 ,\n",
" 20.32999 , 20.414175 ],\n",
" [20.241894 , 20.360647 , 20.468754 , ..., 19.998655 ,\n",
" 20.048597 , 20.134676 ],\n",
" ...,\n",
" [ 6.915186 , 7.1338477, 7.3954983, ..., 6.3817706,\n",
" 6.555091 , 6.727661 ],\n",
" [ 6.882338 , 7.1121902, 7.3934746, ..., 6.341805 ,\n",
" 6.514602 , 6.689177 ],\n",
" [ 6.851183 , 7.0997095, 7.4056616, ..., 6.302261 ,\n",
" 6.472443 , 6.648785 ]],\n",
"\n",
" [[20.774364 , 20.855886 , 20.909033 , ..., 20.557882 ,\n",
" 20.604294 , 20.682552 ],\n",
" [20.516712 , 20.61896 , 20.700066 , ..., 20.279787 ,\n",
" 20.328924 , 20.41323 ],\n",
" [20.242256 , 20.360653 , 20.469145 , ..., 19.99738 ,\n",
" 20.047834 , 20.134365 ],\n",
" ...,\n",
" [ 6.915463 , 7.1338396, 7.3953032, ..., 6.379834 ,\n",
" 6.5542235, 6.72753 ],\n",
" [ 6.882011 , 7.112032 , 7.3933544, ..., 6.3384266,\n",
" 6.5132184, 6.6881833],\n",
" [ 6.8504896, 7.09981 , 7.405873 , ..., 6.299002 ,\n",
" 6.4707603, 6.6480546]],\n",
"\n",
" ...,\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]],\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]],\n",
"\n",
" [[ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" ...,\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan],\n",
" [ nan, nan, nan, ..., nan,\n",
" nan, nan]]]], dtype=float32)</pre></li></ul></div></li><li class='xr-section-item'><input id='section-a4d8fcb5-a73a-40a7-b593-ac9ea14d92bf' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-a4d8fcb5-a73a-40a7-b593-ac9ea14d92bf' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: (nlat: 40, nlon: 320, time: 501, z_t: 60)\n",
"Coordinates:\n",
" * time (time) object 0001-12-31 00:00:00 ... 0501-12-31 00:00:00\n",
" ULAT (nlat, nlon) float64 36.79 36.79 36.79 36.8 ... 52.63 52.62 52.62\n",
" TLAT (nlat, nlon) float64 36.57 36.57 36.58 36.58 ... 52.44 52.43 52.43\n",
" ULONG (nlat, nlon) float64 321.1 322.2 323.3 324.4 ... 317.9 319.0 320.0\n",
" TLONG (nlat, nlon) float64 320.6 321.7 322.8 323.9 ... 317.4 318.4 319.5\n",
" * z_t (z_t) float32 500.0 1500.0 2500.0 ... 487508.34 512502.8 537500.0\n",
"Dimensions without coordinates: nlat, nlon\n",
"Data variables:\n",
" TEMP (time, z_t, nlat, nlon) float32 array([[[[21.878016 , 21.796999 ..."
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Move the read netCDF data to the GPU\n",
"gpu_temp_array = cp.array(original_ds.TEMP.data)\n",
"\n",
"# Assign the GPU array to the TEMP variable in our new xarray.Dataset\n",
"ds['TEMP'].data = gpu_temp_array\n",
"ds"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<CUDA Device 0>"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Confirm that we have our TEMP variable is pointing to data on the GPU\n",
"ds.TEMP.data.device"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<title>Show/Hide data repr</title>\n",
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<title>Show/Hide attributes</title>\n",
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
".xr-wrap {\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: '►';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: '▼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt, dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2 {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><div class='xr-wrap'><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'TEMP'</div><ul class='xr-dim-list'><li><span>nlat</span>: 40</li><li><span>nlon</span>: 320</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-aa5521f6-d384-4654-8df7-5106bd5f97a1' class='xr-array-in' type='checkbox' ><label for='section-aa5521f6-d384-4654-8df7-5106bd5f97a1' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>array([[13.41964 , 13.677184 , 13.946518 , ..., 12.763631 , 12.959...</span></div><pre class='xr-array-data'>array([[13.41964 , 13.677184 , 13.946518 , ..., 12.763631 , 12.959838 ,\n",
" 13.179738 ],\n",
" [13.205299 , 13.280841 , 13.5566635, ..., 12.569894 , 12.755723 ,\n",
" 12.968415 ],\n",
" [12.795654 , 13.0501375, 13.332416 , ..., 12.36939 , 12.378892 ,\n",
" 12.572637 ],\n",
" ...,\n",
" [ 5.388435 , 5.4863214, 5.611896 , ..., 5.1458535, 5.2052274,\n",
" 5.2851214],\n",
" [ 5.3980308, 5.516022 , 5.6742806, ..., 5.1671176, 5.2291913,\n",
" 5.3432126],\n",
" [ 5.4092703, 5.5538225, 5.7556906, ..., 5.161197 , 5.253569 ,\n",
" 5.3141665]], dtype=float32)</pre></div></li><li class='xr-section-item'><input id='section-073529d2-b572-4c51-8445-a3c2d62e965a' class='xr-section-summary-in' type='checkbox' checked><label for='section-073529d2-b572-4c51-8445-a3c2d62e965a' class='xr-section-summary' >Coordinates: <span>(4)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>ULAT</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>36.79 36.79 36.79 ... 52.62 52.62</div><input id='attrs-e7d77975-82e7-4d5f-9364-e970aebd4e52' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-e7d77975-82e7-4d5f-9364-e970aebd4e52' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-1a87200d-7424-419a-9c0b-2086e4d14e15' class='xr-var-data-in' type='checkbox'><label for='data-1a87200d-7424-419a-9c0b-2086e4d14e15' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of u-grid latitudes</dd><dt><span>units :</span></dt><dd>degrees_north</dd></dl></div><pre class='xr-var-data'>array([[36.78618895, 36.78833647, 36.7919147 , ..., 36.78833647,\n",
" 36.78618895, 36.78547301],\n",
" [37.21674003, 37.21894794, 37.22262676, ..., 37.21894794,\n",
" 37.21674003, 37.21600396],\n",
" [37.64585128, 37.6481204 , 37.65190124, ..., 37.6481204 ,\n",
" 37.64585128, 37.6450948 ],\n",
" ...,\n",
" [51.84961913, 51.85448553, 51.86259344, ..., 51.85448553,\n",
" 51.84961913, 51.84799672],\n",
" [52.23628814, 52.24123746, 52.24948349, ..., 52.24123746,\n",
" 52.23628814, 52.23463808],\n",
" [52.62222517, 52.62725747, 52.63564173, ..., 52.62725747,\n",
" 52.62222517, 52.62054744]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>TLAT</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>36.57 36.57 36.58 ... 52.43 52.43</div><input id='attrs-9a45ae41-f380-4a5f-ba34-46153f8b84f6' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-9a45ae41-f380-4a5f-ba34-46153f8b84f6' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-2d08d1d8-d62c-488f-b94a-3cd2037564bb' class='xr-var-data-in' type='checkbox'><label for='data-2d08d1d8-d62c-488f-b94a-3cd2037564bb' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of t-grid latitudes</dd><dt><span>units :</span></dt><dd>degrees_north</dd></dl></div><pre class='xr-var-data'>array([[36.57111564, 36.57252758, 36.57535083, ..., 36.57535083,\n",
" 36.57252758, 36.57111569],\n",
" [37.00238345, 37.00383535, 37.00673853, ..., 37.00673853,\n",
" 37.00383535, 37.00238349],\n",
" [37.43220774, 37.43370019, 37.43668441, ..., 37.43668441,\n",
" 37.43370019, 37.43220779],\n",
" ...,\n",
" [51.65624839, 51.65946518, 51.6658971 , ..., 51.6658971 ,\n",
" 51.65946518, 51.65624843],\n",
" [52.04327673, 52.04654877, 52.05309111, ..., 52.05309111,\n",
" 52.04654877, 52.04327677],\n",
" [52.42955479, 52.43288212, 52.43953502, ..., 52.43953502,\n",
" 52.43288212, 52.42955483]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>ULONG</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>321.1 322.2 323.3 ... 319.0 320.0</div><input id='attrs-aca950af-9b5d-46fa-8584-179dcb6389ac' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-aca950af-9b5d-46fa-8584-179dcb6389ac' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-e2725098-5eb1-4f1e-994d-650a638c1a44' class='xr-var-data-in' type='checkbox'><label for='data-e2725098-5eb1-4f1e-994d-650a638c1a44' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of u-grid longitudes</dd><dt><span>units :</span></dt><dd>degrees_east</dd></dl></div><pre class='xr-var-data'>array([[321.10614208, 322.21227801, 323.31841946, ..., 317.7877398 ,\n",
" 318.89387573, 320.00001875],\n",
" [321.1052556 , 322.21050508, 323.31576013, ..., 317.78951273,\n",
" 318.89476221, 320.00001875],\n",
" [321.10433627, 322.20866643, 323.31300218, ..., 317.79135138,\n",
" 318.89568154, 320.00001874],\n",
" ...,\n",
" [321.04017906, 322.08033854, 323.12047672, ..., 317.91967927,\n",
" 318.95983875, 320.00001817],\n",
" [321.03695847, 322.07389611, 323.11080995, ..., 317.9261217 ,\n",
" 318.96305934, 320.00001814],\n",
" [321.03362171, 322.06722124, 323.10079431, ..., 317.93279657,\n",
" 318.9663961 , 320.00001811]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>TLONG</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>320.6 321.7 322.8 ... 318.4 319.5</div><input id='attrs-fb0e2af0-eafd-4028-8021-8e1777dc8201' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-fb0e2af0-eafd-4028-8021-8e1777dc8201' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-9d7105d6-c9d8-4512-9fed-e4165b1ee4f3' class='xr-var-data-in' type='checkbox'><label for='data-9d7105d6-c9d8-4512-9fed-e4165b1ee4f3' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of t-grid longitudes</dd><dt><span>units :</span></dt><dd>degrees_east</dd></dl></div><pre class='xr-var-data'>array([[320.55329214, 321.6598452 , 322.7664073 , ..., 317.23361051,\n",
" 318.34017261, 319.44673553],\n",
" [320.55285678, 321.65853916, 322.76423061, ..., 317.2357872 ,\n",
" 318.34147865, 319.44717087],\n",
" [320.55240524, 321.65718456, 322.76197298, ..., 317.23804483,\n",
" 318.34283325, 319.4476224 ],\n",
" ...,\n",
" [320.52086993, 321.56257303, 322.60426566, ..., 317.39575215,\n",
" 318.43744478, 319.47915715],\n",
" [320.51928744, 321.55782499, 322.59635025, ..., 317.40366756,\n",
" 318.44219282, 319.48073962],\n",
" [320.51764799, 321.55290604, 322.58814984, ..., 317.41186797,\n",
" 318.44711177, 319.48237904]])</pre></li></ul></div></li><li class='xr-section-item'><input id='section-55cb61ee-1b20-4340-9da2-751b0fb92184' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-55cb61ee-1b20-4340-9da2-751b0fb92184' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.DataArray 'TEMP' (nlat: 40, nlon: 320)>\n",
"array([[13.41964 , 13.677184 , 13.946518 , ..., 12.763631 , 12.959838 ,\n",
" 13.179738 ],\n",
" [13.205299 , 13.280841 , 13.5566635, ..., 12.569894 , 12.755723 ,\n",
" 12.968415 ],\n",
" [12.795654 , 13.0501375, 13.332416 , ..., 12.36939 , 12.378892 ,\n",
" 12.572637 ],\n",
" ...,\n",
" [ 5.388435 , 5.4863214, 5.611896 , ..., 5.1458535, 5.2052274,\n",
" 5.2851214],\n",
" [ 5.3980308, 5.516022 , 5.6742806, ..., 5.1671176, 5.2291913,\n",
" 5.3432126],\n",
" [ 5.4092703, 5.5538225, 5.7556906, ..., 5.161197 , 5.253569 ,\n",
" 5.3141665]], dtype=float32)\n",
"Coordinates:\n",
" ULAT (nlat, nlon) float64 36.79 36.79 36.79 36.8 ... 52.63 52.62 52.62\n",
" TLAT (nlat, nlon) float64 36.57 36.57 36.58 36.58 ... 52.44 52.43 52.43\n",
" ULONG (nlat, nlon) float64 321.1 322.2 323.3 324.4 ... 317.9 319.0 320.0\n",
" TLONG (nlat, nlon) float64 320.6 321.7 322.8 323.9 ... 317.4 318.4 319.5\n",
"Dimensions without coordinates: nlat, nlon"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Do some calculations \n",
"m_gpu = ds.TEMP.mean(skipna=True, dim=['time', 'z_t'])\n",
"m_gpu"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<CUDA Device 0>"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m_gpu.data.device"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/glade/work/abanihi/softwares/miniconda3/envs/ds-gpu/lib/python3.7/site-packages/xarray/core/nanops.py:142: RuntimeWarning: Mean of empty slice\n",
" return np.nanmean(a, axis=axis, dtype=dtype)\n"
]
},
{
"data": {
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<title>Show/Hide data repr</title>\n",
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<title>Show/Hide attributes</title>\n",
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
".xr-wrap {\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: '►';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: '▼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt, dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2 {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><div class='xr-wrap'><div class='xr-header'><div class='xr-obj-type'>xarray.DataArray</div><div class='xr-array-name'>'TEMP'</div><ul class='xr-dim-list'><li><span>nlat</span>: 40</li><li><span>nlon</span>: 320</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-c2d1fa80-530f-4ee5-8f30-0a01d95ad449' class='xr-array-in' type='checkbox' ><label for='section-c2d1fa80-530f-4ee5-8f30-0a01d95ad449' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>13.4196415 13.677207 13.946558 ... 5.1612086 5.2535663 5.3141584</span></div><pre class='xr-array-data'>array([[13.4196415, 13.677207 , 13.946558 , ..., 12.763634 , 12.959792 ,\n",
" 13.179752 ],\n",
" [13.205279 , 13.280861 , 13.55661 , ..., 12.569877 , 12.755762 ,\n",
" 12.968458 ],\n",
" [12.795618 , 13.050129 , 13.332415 , ..., 12.369363 , 12.378893 ,\n",
" 12.572666 ],\n",
" ...,\n",
" [ 5.3884425, 5.4863286, 5.6118927, ..., 5.1458673, 5.205242 ,\n",
" 5.285122 ],\n",
" [ 5.3980284, 5.516034 , 5.674297 , ..., 5.1671147, 5.2291775,\n",
" 5.3432107],\n",
" [ 5.4092717, 5.553839 , 5.7556715, ..., 5.1612086, 5.2535663,\n",
" 5.3141584]], dtype=float32)</pre></div></li><li class='xr-section-item'><input id='section-6092b771-a4f7-4ec6-947e-2b2f84ec8960' class='xr-section-summary-in' type='checkbox' checked><label for='section-6092b771-a4f7-4ec6-947e-2b2f84ec8960' class='xr-section-summary' >Coordinates: <span>(4)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>TLONG</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>320.6 321.7 322.8 ... 318.4 319.5</div><input id='attrs-362cbbeb-6190-4d90-9ff0-ae8ca0cbfa63' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-362cbbeb-6190-4d90-9ff0-ae8ca0cbfa63' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-666f2f20-d08d-4a64-87a4-0004fd5010fc' class='xr-var-data-in' type='checkbox'><label for='data-666f2f20-d08d-4a64-87a4-0004fd5010fc' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of t-grid longitudes</dd><dt><span>units :</span></dt><dd>degrees_east</dd></dl></div><pre class='xr-var-data'>array([[320.553292, 321.659845, 322.766407, ..., 317.233611, 318.340173,\n",
" 319.446736],\n",
" [320.552857, 321.658539, 322.764231, ..., 317.235787, 318.341479,\n",
" 319.447171],\n",
" [320.552405, 321.657185, 322.761973, ..., 317.238045, 318.342833,\n",
" 319.447622],\n",
" ...,\n",
" [320.52087 , 321.562573, 322.604266, ..., 317.395752, 318.437445,\n",
" 319.479157],\n",
" [320.519287, 321.557825, 322.59635 , ..., 317.403668, 318.442193,\n",
" 319.48074 ],\n",
" [320.517648, 321.552906, 322.58815 , ..., 317.411868, 318.447112,\n",
" 319.482379]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>ULAT</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>36.79 36.79 36.79 ... 52.62 52.62</div><input id='attrs-1fa01ed9-b938-42f0-ba58-74d14f94c72e' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-1fa01ed9-b938-42f0-ba58-74d14f94c72e' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-9a91afa4-6155-4813-b6e5-d42e8a91f7ab' class='xr-var-data-in' type='checkbox'><label for='data-9a91afa4-6155-4813-b6e5-d42e8a91f7ab' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of u-grid latitudes</dd><dt><span>units :</span></dt><dd>degrees_north</dd></dl></div><pre class='xr-var-data'>array([[36.786189, 36.788336, 36.791915, ..., 36.788336, 36.786189, 36.785473],\n",
" [37.21674 , 37.218948, 37.222627, ..., 37.218948, 37.21674 , 37.216004],\n",
" [37.645851, 37.64812 , 37.651901, ..., 37.64812 , 37.645851, 37.645095],\n",
" ...,\n",
" [51.849619, 51.854486, 51.862593, ..., 51.854486, 51.849619, 51.847997],\n",
" [52.236288, 52.241237, 52.249483, ..., 52.241237, 52.236288, 52.234638],\n",
" [52.622225, 52.627257, 52.635642, ..., 52.627257, 52.622225, 52.620547]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>TLAT</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>36.57 36.57 36.58 ... 52.43 52.43</div><input id='attrs-24adff2c-3402-45ae-882b-cb91dc0c5381' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-24adff2c-3402-45ae-882b-cb91dc0c5381' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-afb27b80-f489-4bb3-898e-e692e207d323' class='xr-var-data-in' type='checkbox'><label for='data-afb27b80-f489-4bb3-898e-e692e207d323' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of t-grid latitudes</dd><dt><span>units :</span></dt><dd>degrees_north</dd></dl></div><pre class='xr-var-data'>array([[36.571116, 36.572528, 36.575351, ..., 36.575351, 36.572528, 36.571116],\n",
" [37.002383, 37.003835, 37.006739, ..., 37.006739, 37.003835, 37.002383],\n",
" [37.432208, 37.4337 , 37.436684, ..., 37.436684, 37.4337 , 37.432208],\n",
" ...,\n",
" [51.656248, 51.659465, 51.665897, ..., 51.665897, 51.659465, 51.656248],\n",
" [52.043277, 52.046549, 52.053091, ..., 52.053091, 52.046549, 52.043277],\n",
" [52.429555, 52.432882, 52.439535, ..., 52.439535, 52.432882, 52.429555]])</pre></li><li class='xr-var-item'><div class='xr-var-name'><span>ULONG</span></div><div class='xr-var-dims'>(nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>321.1 322.2 323.3 ... 319.0 320.0</div><input id='attrs-f08d4f08-8fc8-46b6-aa7f-af6304d0cdc7' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-f08d4f08-8fc8-46b6-aa7f-af6304d0cdc7' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f5620f28-d274-4e9f-a7cf-e1f15eee63de' class='xr-var-data-in' type='checkbox'><label for='data-f5620f28-d274-4e9f-a7cf-e1f15eee63de' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>array of u-grid longitudes</dd><dt><span>units :</span></dt><dd>degrees_east</dd></dl></div><pre class='xr-var-data'>array([[321.106142, 322.212278, 323.318419, ..., 317.78774 , 318.893876,\n",
" 320.000019],\n",
" [321.105256, 322.210505, 323.31576 , ..., 317.789513, 318.894762,\n",
" 320.000019],\n",
" [321.104336, 322.208666, 323.313002, ..., 317.791351, 318.895682,\n",
" 320.000019],\n",
" ...,\n",
" [321.040179, 322.080339, 323.120477, ..., 317.919679, 318.959839,\n",
" 320.000018],\n",
" [321.036958, 322.073896, 323.11081 , ..., 317.926122, 318.963059,\n",
" 320.000018],\n",
" [321.033622, 322.067221, 323.100794, ..., 317.932797, 318.966396,\n",
" 320.000018]])</pre></li></ul></div></li><li class='xr-section-item'><input id='section-3f2c322d-e270-4b61-8c21-f83f199a28e1' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-3f2c322d-e270-4b61-8c21-f83f199a28e1' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.DataArray 'TEMP' (nlat: 40, nlon: 320)>\n",
"array([[13.4196415, 13.677207 , 13.946558 , ..., 12.763634 , 12.959792 ,\n",
" 13.179752 ],\n",
" [13.205279 , 13.280861 , 13.55661 , ..., 12.569877 , 12.755762 ,\n",
" 12.968458 ],\n",
" [12.795618 , 13.050129 , 13.332415 , ..., 12.369363 , 12.378893 ,\n",
" 12.572666 ],\n",
" ...,\n",
" [ 5.3884425, 5.4863286, 5.6118927, ..., 5.1458673, 5.205242 ,\n",
" 5.285122 ],\n",
" [ 5.3980284, 5.516034 , 5.674297 , ..., 5.1671147, 5.2291775,\n",
" 5.3432107],\n",
" [ 5.4092717, 5.553839 , 5.7556715, ..., 5.1612086, 5.2535663,\n",
" 5.3141584]], dtype=float32)\n",
"Coordinates:\n",
" TLONG (nlat, nlon) float64 320.6 321.7 322.8 323.9 ... 317.4 318.4 319.5\n",
" ULAT (nlat, nlon) float64 36.79 36.79 36.79 36.8 ... 52.63 52.62 52.62\n",
" TLAT (nlat, nlon) float64 36.57 36.57 36.58 36.58 ... 52.44 52.43 52.43\n",
" ULONG (nlat, nlon) float64 321.1 322.2 323.3 324.4 ... 317.9 319.0 320.0\n",
"Dimensions without coordinates: nlat, nlon"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m_cpu = original_ds.TEMP.mean(skipna=True, dim=['time', 'z_t'])\n",
"m_cpu"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
"np.testing.assert_allclose(m_cpu.data, m_gpu.data.get(), rtol=1e-04)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:ds-gpu]",
"language": "python",
"name": "conda-env-ds-gpu-py"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment