Last active
June 12, 2024 17:33
-
-
Save andersy005/3f1eca11b397a7797429aaba735245de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import xarray as xr\n", | |
"import pathlib\n", | |
"import dask\n", | |
"import zarr\n", | |
"from distributed import Client" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\"> </div>\n", | |
" <div style=\"margin-left: 48px;\">\n", | |
" <h3 style=\"margin-bottom: 0px;\">Client</h3>\n", | |
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-bc7500fa-fdb3-11ee-9131-3cecef1b11de</p>\n", | |
" <table style=\"width: 100%; text-align: left;\">\n", | |
"\n", | |
" <tr>\n", | |
" \n", | |
" <td style=\"text-align: left;\"><strong>Connection method:</strong> Cluster object</td>\n", | |
" <td style=\"text-align: left;\"><strong>Cluster type:</strong> distributed.LocalCluster</td>\n", | |
" \n", | |
" </tr>\n", | |
"\n", | |
" \n", | |
" <tr>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Dashboard: </strong> <a href=\"https://jupyterhub.hpc.ucar.edu/stable/user/abanihi/batch/proxy/8787/status\" target=\"_blank\">https://jupyterhub.hpc.ucar.edu/stable/user/abanihi/batch/proxy/8787/status</a>\n", | |
" </td>\n", | |
" <td style=\"text-align: left;\"></td>\n", | |
" </tr>\n", | |
" \n", | |
"\n", | |
" </table>\n", | |
"\n", | |
" \n", | |
" <details>\n", | |
" <summary style=\"margin-bottom: 20px;\"><h3 style=\"display: inline;\">Cluster Info</h3></summary>\n", | |
" <div class=\"jp-RenderedHTMLCommon jp-RenderedHTML jp-mod-trusted jp-OutputArea-output\">\n", | |
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\">\n", | |
" </div>\n", | |
" <div style=\"margin-left: 48px;\">\n", | |
" <h3 style=\"margin-bottom: 0px; margin-top: 0px;\">LocalCluster</h3>\n", | |
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">625f4bce</p>\n", | |
" <table style=\"width: 100%; text-align: left;\">\n", | |
" <tr>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Dashboard:</strong> <a href=\"https://jupyterhub.hpc.ucar.edu/stable/user/abanihi/batch/proxy/8787/status\" target=\"_blank\">https://jupyterhub.hpc.ucar.edu/stable/user/abanihi/batch/proxy/8787/status</a>\n", | |
" </td>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Workers:</strong> 1\n", | |
" </td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Total threads:</strong> 8\n", | |
" </td>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Total memory:</strong> 50.00 GiB\n", | |
" </td>\n", | |
" </tr>\n", | |
" \n", | |
" <tr>\n", | |
" <td style=\"text-align: left;\"><strong>Status:</strong> running</td>\n", | |
" <td style=\"text-align: left;\"><strong>Using processes:</strong> False</td>\n", | |
"</tr>\n", | |
"\n", | |
" \n", | |
" </table>\n", | |
"\n", | |
" <details>\n", | |
" <summary style=\"margin-bottom: 20px;\">\n", | |
" <h3 style=\"display: inline;\">Scheduler Info</h3>\n", | |
" </summary>\n", | |
"\n", | |
" <div style=\"\">\n", | |
" <div>\n", | |
" <div style=\"width: 24px; height: 24px; background-color: #FFF7E5; border: 3px solid #FF6132; border-radius: 5px; position: absolute;\"> </div>\n", | |
" <div style=\"margin-left: 48px;\">\n", | |
" <h3 style=\"margin-bottom: 0px;\">Scheduler</h3>\n", | |
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-0e6cec62-70a8-4dce-b923-516b443e8738</p>\n", | |
" <table style=\"width: 100%; text-align: left;\">\n", | |
" <tr>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Comm:</strong> inproc://128.117.208.100/69937/1\n", | |
" </td>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Workers:</strong> 1\n", | |
" </td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Dashboard:</strong> <a href=\"https://jupyterhub.hpc.ucar.edu/stable/user/abanihi/batch/proxy/8787/status\" target=\"_blank\">https://jupyterhub.hpc.ucar.edu/stable/user/abanihi/batch/proxy/8787/status</a>\n", | |
" </td>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Total threads:</strong> 8\n", | |
" </td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Started:</strong> Just now\n", | |
" </td>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Total memory:</strong> 50.00 GiB\n", | |
" </td>\n", | |
" </tr>\n", | |
" </table>\n", | |
" </div>\n", | |
" </div>\n", | |
"\n", | |
" <details style=\"margin-left: 48px;\">\n", | |
" <summary style=\"margin-bottom: 20px;\">\n", | |
" <h3 style=\"display: inline;\">Workers</h3>\n", | |
" </summary>\n", | |
"\n", | |
" \n", | |
" <div style=\"margin-bottom: 20px;\">\n", | |
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n", | |
" <div style=\"margin-left: 48px;\">\n", | |
" <details>\n", | |
" <summary>\n", | |
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 0</h4>\n", | |
" </summary>\n", | |
" <table style=\"width: 100%; text-align: left;\">\n", | |
" <tr>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Comm: </strong> inproc://128.117.208.100/69937/3\n", | |
" </td>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Total threads: </strong> 8\n", | |
" </td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Dashboard: </strong> <a href=\"https://jupyterhub.hpc.ucar.edu/stable/user/abanihi/batch/proxy/44105/status\" target=\"_blank\">https://jupyterhub.hpc.ucar.edu/stable/user/abanihi/batch/proxy/44105/status</a>\n", | |
" </td>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Memory: </strong> 50.00 GiB\n", | |
" </td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <td style=\"text-align: left;\">\n", | |
" <strong>Nanny: </strong> None\n", | |
" </td>\n", | |
" <td style=\"text-align: left;\"></td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <td colspan=\"2\" style=\"text-align: left;\">\n", | |
" <strong>Local directory: </strong> /glade/work/abanihi/dask-worker-space/worker-fhkwm3eq\n", | |
" </td>\n", | |
" </tr>\n", | |
"\n", | |
" \n", | |
"\n", | |
" \n", | |
"\n", | |
" </table>\n", | |
" </details>\n", | |
" </div>\n", | |
" </div>\n", | |
" \n", | |
"\n", | |
" </details>\n", | |
"</div>\n", | |
"\n", | |
" </details>\n", | |
" </div>\n", | |
"</div>\n", | |
" </details>\n", | |
" \n", | |
"\n", | |
" </div>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
"<Client: 'inproc://128.117.208.100/69937/1' processes=1 threads=8, memory=50.00 GiB>" | |
] | |
}, | |
"execution_count": 2, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"/glade/work/abanihi/opt/miniconda/envs/dev/lib/python3.9/site-packages/dask/array/numpy_compat.py:39: RuntimeWarning: invalid value encountered in divide\n", | |
" x = np.divide(x1, x2, out)\n", | |
"distributed.utils_perf - WARNING - full garbage collections took 23% CPU time recently (threshold: 10%)\n", | |
"distributed.utils_perf - WARNING - full garbage collections took 24% CPU time recently (threshold: 10%)\n", | |
"distributed.utils_perf - WARNING - full garbage collections took 25% CPU time recently (threshold: 10%)\n", | |
"distributed.utils_perf - WARNING - full garbage collections took 26% CPU time recently (threshold: 10%)\n", | |
"/glade/work/abanihi/opt/miniconda/envs/dev/lib/python3.9/site-packages/dask/array/numpy_compat.py:39: RuntimeWarning: invalid value encountered in divide\n", | |
" x = np.divide(x1, x2, out)\n", | |
"distributed.utils_perf - WARNING - full garbage collections took 22% CPU time recently (threshold: 10%)\n", | |
"distributed.utils_perf - WARNING - full garbage collections took 20% CPU time recently (threshold: 10%)\n", | |
"distributed.utils_perf - WARNING - full garbage collections took 18% CPU time recently (threshold: 10%)\n" | |
] | |
} | |
], | |
"source": [ | |
"client = Client(processes=False)\n", | |
"client" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"PosixPath('/glade/derecho/scratch/mclong/fgco2-files')" | |
] | |
}, | |
"execution_count": 5, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"directory = pathlib.Path(\"/glade/derecho/scratch/mclong/fgco2-files\")\n", | |
"directory" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"dirs = sorted(list(directory.iterdir()))\n", | |
"files = dirs[-366:]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"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", | |
"<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", | |
"<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", | |
"html[theme=dark],\n", | |
"body[data-theme=dark],\n", | |
"body.vscode-dark {\n", | |
" --xr-font-color0: rgba(255, 255, 255, 1);\n", | |
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n", | |
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n", | |
" --xr-border-color: #1F1F1F;\n", | |
" --xr-disabled-color: #515151;\n", | |
" --xr-background-color: #111111;\n", | |
" --xr-background-color-row-even: #111111;\n", | |
" --xr-background-color-row-odd: #313131;\n", | |
"}\n", | |
"\n", | |
".xr-wrap {\n", | |
" display: block !important;\n", | |
" min-width: 300px;\n", | |
" max-width: 700px;\n", | |
"}\n", | |
"\n", | |
".xr-text-repr-fallback {\n", | |
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n", | |
" display: none;\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-index-preview {\n", | |
" grid-column: 2 / 5;\n", | |
" color: var(--xr-font-color2);\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", | |
".xr-index-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", | |
".xr-index-data-in:checked ~ .xr-index-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-index-name div,\n", | |
".xr-index-data,\n", | |
".xr-attrs {\n", | |
" padding-left: 25px !important;\n", | |
"}\n", | |
"\n", | |
".xr-attrs,\n", | |
".xr-var-attrs,\n", | |
".xr-var-data,\n", | |
".xr-index-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,\n", | |
".xr-attrs 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", | |
".xr-no-icon {\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><pre class='xr-text-repr-fallback'><xarray.Dataset>\n", | |
"Dimensions: (time: 366, nlat: 1800, nlon: 3600)\n", | |
"Coordinates:\n", | |
" * time (time) object 2021-01-01 00:00:00 ... 2022-01-01 00:00:00\n", | |
"Dimensions without coordinates: nlat, nlon\n", | |
"Data variables:\n", | |
" FG_CO2_2 (time, nlat, nlon) float64 dask.array<chunksize=(1, 225, 450), meta=np.ndarray></pre><div class='xr-wrap' style='display:none'><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-920d0b3c-ea5a-4c1b-809f-b164608e5a80' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-920d0b3c-ea5a-4c1b-809f-b164608e5a80' 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'>time</span>: 366</li><li><span>nlat</span>: 1800</li><li><span>nlon</span>: 3600</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-d45c107b-7fff-450f-8032-ca9272f7391b' class='xr-section-summary-in' type='checkbox' checked><label for='section-d45c107b-7fff-450f-8032-ca9272f7391b' 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'>time</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>2021-01-01 00:00:00 ... 2022-01-...</div><input id='attrs-41df8e1e-7344-4480-9f79-6b6f055e5592' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-41df8e1e-7344-4480-9f79-6b6f055e5592' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-91569032-f173-4af3-b5cc-2425597484b6' class='xr-var-data-in' type='checkbox'><label for='data-91569032-f173-4af3-b5cc-2425597484b6' 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>bounds :</span></dt><dd>time_bound</dd><dt><span>long_name :</span></dt><dd>time</dd></dl></div><div class='xr-var-data'><pre>array([cftime.DatetimeNoLeap(2021, 1, 1, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2021, 1, 2, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2021, 1, 3, 0, 0, 0, 0, has_year_zero=True), ...,\n", | |
" cftime.DatetimeNoLeap(2021, 12, 30, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2021, 12, 31, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2022, 1, 1, 0, 0, 0, 0, has_year_zero=True)],\n", | |
" dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-336e0140-6bd1-4b16-ac92-5e462d87293f' class='xr-section-summary-in' type='checkbox' checked><label for='section-336e0140-6bd1-4b16-ac92-5e462d87293f' 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>FG_CO2_2</span></div><div class='xr-var-dims'>(time, nlat, nlon)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(1, 225, 450), meta=np.ndarray></div><input id='attrs-e900f411-1d12-4240-a06d-78e705d47cf5' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-e900f411-1d12-4240-a06d-78e705d47cf5' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-d6ae8cd0-e33a-4b9e-b6a9-e480a18ec2c6' class='xr-var-data-in' type='checkbox'><label for='data-d6ae8cd0-e33a-4b9e-b6a9-e480a18ec2c6' 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>cell_methods :</span></dt><dd>time: mean</dd><dt><span>grid_loc :</span></dt><dd>2110</dd><dt><span>long_name :</span></dt><dd>DIC Surface Gas Flux</dd><dt><span>units :</span></dt><dd>mol m$^{-2}$ yr$^{-1}$</dd></dl></div><div class='xr-var-data'><table>\n", | |
" <tr>\n", | |
" <td>\n", | |
" <table>\n", | |
" <thead>\n", | |
" <tr>\n", | |
" <td> </td>\n", | |
" <th> Array </th>\n", | |
" <th> Chunk </th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" \n", | |
" <tr>\n", | |
" <th> Bytes </th>\n", | |
" <td> 17.67 GiB </td>\n", | |
" <td> 791.02 kiB </td>\n", | |
" </tr>\n", | |
" \n", | |
" <tr>\n", | |
" <th> Shape </th>\n", | |
" <td> (366, 1800, 3600) </td>\n", | |
" <td> (1, 225, 450) </td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th> Count </th>\n", | |
" <td> 47214 Tasks </td>\n", | |
" <td> 23424 Chunks </td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th> Type </th>\n", | |
" <td> float64 </td>\n", | |
" <td> numpy.ndarray </td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
" </table>\n", | |
" </td>\n", | |
" <td>\n", | |
" <svg width=\"202\" height=\"132\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n", | |
"\n", | |
" <!-- Horizontal lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"32\" y2=\"22\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"10\" y1=\"7\" x2=\"32\" y2=\"30\" />\n", | |
" <line x1=\"10\" y1=\"15\" x2=\"32\" y2=\"37\" />\n", | |
" <line x1=\"10\" y1=\"22\" x2=\"32\" y2=\"45\" />\n", | |
" <line x1=\"10\" y1=\"30\" x2=\"32\" y2=\"52\" />\n", | |
" <line x1=\"10\" y1=\"37\" x2=\"32\" y2=\"60\" />\n", | |
" <line x1=\"10\" y1=\"45\" x2=\"32\" y2=\"67\" />\n", | |
" <line x1=\"10\" y1=\"52\" x2=\"32\" y2=\"75\" />\n", | |
" <line x1=\"10\" y1=\"60\" x2=\"32\" y2=\"82\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Vertical lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"60\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"11\" y1=\"1\" x2=\"11\" y2=\"61\" />\n", | |
" <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"62\" />\n", | |
" <line x1=\"13\" y1=\"3\" x2=\"13\" y2=\"63\" />\n", | |
" <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"64\" />\n", | |
" <line x1=\"15\" y1=\"5\" x2=\"15\" y2=\"65\" />\n", | |
" <line x1=\"17\" y1=\"7\" x2=\"17\" y2=\"67\" />\n", | |
" <line x1=\"18\" y1=\"8\" x2=\"18\" y2=\"68\" />\n", | |
" <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"69\" />\n", | |
" <line x1=\"20\" y1=\"10\" x2=\"20\" y2=\"70\" />\n", | |
" <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"71\" />\n", | |
" <line x1=\"23\" y1=\"13\" x2=\"23\" y2=\"73\" />\n", | |
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"74\" />\n", | |
" <line x1=\"25\" y1=\"15\" x2=\"25\" y2=\"75\" />\n", | |
" <line x1=\"26\" y1=\"16\" x2=\"26\" y2=\"76\" />\n", | |
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"77\" />\n", | |
" <line x1=\"29\" y1=\"19\" x2=\"29\" y2=\"79\" />\n", | |
" <line x1=\"30\" y1=\"20\" x2=\"30\" y2=\"80\" />\n", | |
" <line x1=\"31\" y1=\"21\" x2=\"31\" y2=\"81\" />\n", | |
" <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"82\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Colored Rectangle -->\n", | |
" <polygon points=\"10.0,0.0 32.75780426847002,22.757804268470018 32.75780426847002,82.75780426847001 10.0,60.0\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n", | |
"\n", | |
" <!-- Horizontal lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"11\" y1=\"1\" x2=\"131\" y2=\"1\" />\n", | |
" <line x1=\"12\" y1=\"2\" x2=\"132\" y2=\"2\" />\n", | |
" <line x1=\"13\" y1=\"3\" x2=\"133\" y2=\"3\" />\n", | |
" <line x1=\"14\" y1=\"4\" x2=\"134\" y2=\"4\" />\n", | |
" <line x1=\"15\" y1=\"5\" x2=\"135\" y2=\"5\" />\n", | |
" <line x1=\"17\" y1=\"7\" x2=\"137\" y2=\"7\" />\n", | |
" <line x1=\"18\" y1=\"8\" x2=\"138\" y2=\"8\" />\n", | |
" <line x1=\"19\" y1=\"9\" x2=\"139\" y2=\"9\" />\n", | |
" <line x1=\"20\" y1=\"10\" x2=\"140\" y2=\"10\" />\n", | |
" <line x1=\"21\" y1=\"11\" x2=\"141\" y2=\"11\" />\n", | |
" <line x1=\"23\" y1=\"13\" x2=\"143\" y2=\"13\" />\n", | |
" <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" />\n", | |
" <line x1=\"25\" y1=\"15\" x2=\"145\" y2=\"15\" />\n", | |
" <line x1=\"26\" y1=\"16\" x2=\"146\" y2=\"16\" />\n", | |
" <line x1=\"27\" y1=\"17\" x2=\"147\" y2=\"17\" />\n", | |
" <line x1=\"29\" y1=\"19\" x2=\"149\" y2=\"19\" />\n", | |
" <line x1=\"30\" y1=\"20\" x2=\"150\" y2=\"20\" />\n", | |
" <line x1=\"31\" y1=\"21\" x2=\"151\" y2=\"21\" />\n", | |
" <line x1=\"32\" y1=\"22\" x2=\"152\" y2=\"22\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Vertical lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"32\" y2=\"22\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"25\" y1=\"0\" x2=\"47\" y2=\"22\" />\n", | |
" <line x1=\"40\" y1=\"0\" x2=\"62\" y2=\"22\" />\n", | |
" <line x1=\"55\" y1=\"0\" x2=\"77\" y2=\"22\" />\n", | |
" <line x1=\"70\" y1=\"0\" x2=\"92\" y2=\"22\" />\n", | |
" <line x1=\"85\" y1=\"0\" x2=\"107\" y2=\"22\" />\n", | |
" <line x1=\"100\" y1=\"0\" x2=\"122\" y2=\"22\" />\n", | |
" <line x1=\"115\" y1=\"0\" x2=\"137\" y2=\"22\" />\n", | |
" <line x1=\"130\" y1=\"0\" x2=\"152\" y2=\"22\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Colored Rectangle -->\n", | |
" <polygon points=\"10.0,0.0 130.0,0.0 152.75780426847,22.757804268470018 32.75780426847002,22.757804268470018\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n", | |
"\n", | |
" <!-- Horizontal lines -->\n", | |
" <line x1=\"32\" y1=\"22\" x2=\"152\" y2=\"22\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"32\" y1=\"30\" x2=\"152\" y2=\"30\" />\n", | |
" <line x1=\"32\" y1=\"37\" x2=\"152\" y2=\"37\" />\n", | |
" <line x1=\"32\" y1=\"45\" x2=\"152\" y2=\"45\" />\n", | |
" <line x1=\"32\" y1=\"52\" x2=\"152\" y2=\"52\" />\n", | |
" <line x1=\"32\" y1=\"60\" x2=\"152\" y2=\"60\" />\n", | |
" <line x1=\"32\" y1=\"67\" x2=\"152\" y2=\"67\" />\n", | |
" <line x1=\"32\" y1=\"75\" x2=\"152\" y2=\"75\" />\n", | |
" <line x1=\"32\" y1=\"82\" x2=\"152\" y2=\"82\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Vertical lines -->\n", | |
" <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"82\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"47\" y1=\"22\" x2=\"47\" y2=\"82\" />\n", | |
" <line x1=\"62\" y1=\"22\" x2=\"62\" y2=\"82\" />\n", | |
" <line x1=\"77\" y1=\"22\" x2=\"77\" y2=\"82\" />\n", | |
" <line x1=\"92\" y1=\"22\" x2=\"92\" y2=\"82\" />\n", | |
" <line x1=\"107\" y1=\"22\" x2=\"107\" y2=\"82\" />\n", | |
" <line x1=\"122\" y1=\"22\" x2=\"122\" y2=\"82\" />\n", | |
" <line x1=\"137\" y1=\"22\" x2=\"137\" y2=\"82\" />\n", | |
" <line x1=\"152\" y1=\"22\" x2=\"152\" y2=\"82\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Colored Rectangle -->\n", | |
" <polygon points=\"32.75780426847002,22.757804268470018 152.75780426847,22.757804268470018 152.75780426847,82.75780426847001 32.75780426847002,82.75780426847001\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", | |
"\n", | |
" <!-- Text -->\n", | |
" <text x=\"92.757804\" y=\"102.757804\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >3600</text>\n", | |
" <text x=\"172.757804\" y=\"52.757804\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,172.757804,52.757804)\">1800</text>\n", | |
" <text x=\"11.378902\" y=\"91.378902\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,11.378902,91.378902)\">366</text>\n", | |
"</svg>\n", | |
" </td>\n", | |
" </tr>\n", | |
"</table></div></li></ul></div></li><li class='xr-section-item'><input id='section-1ecb4277-65b7-4c7a-8796-6ccfde77850f' class='xr-section-summary-in' type='checkbox' ><label for='section-1ecb4277-65b7-4c7a-8796-6ccfde77850f' class='xr-section-summary' >Indexes: <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-index-name'><div>time</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-2d977645-7c73-4504-944a-814acd237cdb' class='xr-index-data-in' type='checkbox'/><label for='index-2d977645-7c73-4504-944a-814acd237cdb' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(CFTimeIndex([2021-01-01 00:00:00, 2021-01-02 00:00:00, 2021-01-03 00:00:00,\n", | |
" 2021-01-04 00:00:00, 2021-01-05 00:00:00, 2021-01-06 00:00:00,\n", | |
" 2021-01-07 00:00:00, 2021-01-08 00:00:00, 2021-01-09 00:00:00,\n", | |
" 2021-01-10 00:00:00,\n", | |
" ...\n", | |
" 2021-12-23 00:00:00, 2021-12-24 00:00:00, 2021-12-25 00:00:00,\n", | |
" 2021-12-26 00:00:00, 2021-12-27 00:00:00, 2021-12-28 00:00:00,\n", | |
" 2021-12-29 00:00:00, 2021-12-30 00:00:00, 2021-12-31 00:00:00,\n", | |
" 2022-01-01 00:00:00],\n", | |
" dtype='object', length=366, calendar='noleap', freq='D'))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-3fdbd3f6-0de7-46d9-8e1a-694e24a73338' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-3fdbd3f6-0de7-46d9-8e1a-694e24a73338' 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: (time: 366, nlat: 1800, nlon: 3600)\n", | |
"Coordinates:\n", | |
" * time (time) object 2021-01-01 00:00:00 ... 2022-01-01 00:00:00\n", | |
"Dimensions without coordinates: nlat, nlon\n", | |
"Data variables:\n", | |
" FG_CO2_2 (time, nlat, nlon) float64 dask.array<chunksize=(1, 225, 450), meta=np.ndarray>" | |
] | |
}, | |
"execution_count": 7, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"ds = xr.open_mfdataset(files, engine='zarr')\n", | |
"ds" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 8, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"compressor = zarr.Zlib(level=5)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 9, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"{'compressor': Zlib(level=5),\n", | |
" 'filters': None,\n", | |
" '_FillValue': nan,\n", | |
" 'dtype': dtype('float32')}" | |
] | |
}, | |
"execution_count": 9, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"def coarsen(ds, dim):\n", | |
" dset = ds.coarsen(dim).mean().chunk({'time': 30, 'nlat': -1, 'nlon': -1})\n", | |
" dset = dask.optimize(dset)[0]\n", | |
" for variable in dset.variables:\n", | |
" if 'chunks' in dset[variable].encoding:\n", | |
" del dset[variable].encoding['chunks']\n", | |
" if 'preferred_chunks' in dset[variable].encoding:\n", | |
" del dset[variable].encoding['preferred_chunks']\n", | |
" dset[variable].encoding['compressor'] = compressor\n", | |
" if variable == 'FG_CO2_2':\n", | |
" encoding = dset[variable].encoding\n", | |
" dset[variable] = dset[variable].astype('float32')\n", | |
" dset[variable].encoding = encoding\n", | |
" dset[variable].encoding['dtype'] = dset[variable].dtype\n", | |
"\n", | |
" return dset\n", | |
"\n", | |
"x = coarsen(ds, {'nlat': 5, 'nlon': 5})\n", | |
"x.FG_CO2_2.encoding" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 10, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"CPU times: user 1min 53s, sys: 12.8 s, total: 2min 6s\n", | |
"Wall time: 1min 13s\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"<xarray.backends.zarr.ZarrStore at 0x150d8640b660>" | |
] | |
}, | |
"execution_count": 10, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"%%time \n", | |
"\n", | |
"coarsen(ds, {'nlat': 5, 'nlon': 5}).to_zarr(\"/glade/derecho/scratch/abanihi/fgco2-2021-360x720.zarr\", \n", | |
" consolidated=True, mode='w')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 11, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": [ | |
"distributed.utils_perf - WARNING - full garbage collections took 25% CPU time recently (threshold: 10%)\n" | |
] | |
}, | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"CPU times: user 1min 55s, sys: 11.8 s, total: 2min 7s\n", | |
"Wall time: 1min 28s\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"<xarray.backends.zarr.ZarrStore at 0x150d79d750b0>" | |
] | |
}, | |
"execution_count": 11, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"%%time \n", | |
"\n", | |
"coarsen(ds, {'nlat': 10, 'nlon': 10}).to_zarr(\"/glade/derecho/scratch/abanihi/fgco2-2021-180x360.zarr\", \n", | |
" consolidated=True, mode='w')" | |
] | |
}, | |
{ | |
"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", | |
"<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", | |
"<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", | |
"html[theme=dark],\n", | |
"body[data-theme=dark],\n", | |
"body.vscode-dark {\n", | |
" --xr-font-color0: rgba(255, 255, 255, 1);\n", | |
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n", | |
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n", | |
" --xr-border-color: #1F1F1F;\n", | |
" --xr-disabled-color: #515151;\n", | |
" --xr-background-color: #111111;\n", | |
" --xr-background-color-row-even: #111111;\n", | |
" --xr-background-color-row-odd: #313131;\n", | |
"}\n", | |
"\n", | |
".xr-wrap {\n", | |
" display: block !important;\n", | |
" min-width: 300px;\n", | |
" max-width: 700px;\n", | |
"}\n", | |
"\n", | |
".xr-text-repr-fallback {\n", | |
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n", | |
" display: none;\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-index-preview {\n", | |
" grid-column: 2 / 5;\n", | |
" color: var(--xr-font-color2);\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", | |
".xr-index-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", | |
".xr-index-data-in:checked ~ .xr-index-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-index-name div,\n", | |
".xr-index-data,\n", | |
".xr-attrs {\n", | |
" padding-left: 25px !important;\n", | |
"}\n", | |
"\n", | |
".xr-attrs,\n", | |
".xr-var-attrs,\n", | |
".xr-var-data,\n", | |
".xr-index-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,\n", | |
".xr-attrs 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", | |
".xr-no-icon {\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><pre class='xr-text-repr-fallback'><xarray.Dataset>\n", | |
"Dimensions: (time: 366, nlat: 180, nlon: 360)\n", | |
"Coordinates:\n", | |
" * time (time) object 2021-01-01 00:00:00 ... 2022-01-01 00:00:00\n", | |
"Dimensions without coordinates: nlat, nlon\n", | |
"Data variables:\n", | |
" FG_CO2_2 (time, nlat, nlon) float32 dask.array<chunksize=(30, 180, 360), meta=np.ndarray></pre><div class='xr-wrap' style='display:none'><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-587a840f-85d8-43dd-9e37-b752c9e29aad' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-587a840f-85d8-43dd-9e37-b752c9e29aad' 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'>time</span>: 366</li><li><span>nlat</span>: 180</li><li><span>nlon</span>: 360</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-745f1795-a79f-438c-b6a3-c6c61c6c4251' class='xr-section-summary-in' type='checkbox' checked><label for='section-745f1795-a79f-438c-b6a3-c6c61c6c4251' 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'>time</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>2021-01-01 00:00:00 ... 2022-01-...</div><input id='attrs-265588a0-bdcc-4440-8237-68bd0ac938f5' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-265588a0-bdcc-4440-8237-68bd0ac938f5' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-8e3edba9-a7c3-44d6-b754-daae7424daa6' class='xr-var-data-in' type='checkbox'><label for='data-8e3edba9-a7c3-44d6-b754-daae7424daa6' 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>bounds :</span></dt><dd>time_bound</dd><dt><span>long_name :</span></dt><dd>time</dd></dl></div><div class='xr-var-data'><pre>array([cftime.DatetimeNoLeap(2021, 1, 1, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2021, 1, 2, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2021, 1, 3, 0, 0, 0, 0, has_year_zero=True), ...,\n", | |
" cftime.DatetimeNoLeap(2021, 12, 30, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2021, 12, 31, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2022, 1, 1, 0, 0, 0, 0, has_year_zero=True)],\n", | |
" dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-6b416d65-1ff8-4fd8-b855-606c1a1737bf' class='xr-section-summary-in' type='checkbox' checked><label for='section-6b416d65-1ff8-4fd8-b855-606c1a1737bf' 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>FG_CO2_2</span></div><div class='xr-var-dims'>(time, nlat, nlon)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(30, 180, 360), meta=np.ndarray></div><input id='attrs-3bca0b3e-5a5c-4241-82c8-009867fe4a13' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-3bca0b3e-5a5c-4241-82c8-009867fe4a13' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-d9e67a8e-b924-4793-b570-de0a6a08b8a5' class='xr-var-data-in' type='checkbox'><label for='data-d9e67a8e-b924-4793-b570-de0a6a08b8a5' 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>cell_methods :</span></dt><dd>time: mean</dd><dt><span>grid_loc :</span></dt><dd>2110</dd><dt><span>long_name :</span></dt><dd>DIC Surface Gas Flux</dd><dt><span>units :</span></dt><dd>mol m$^{-2}$ yr$^{-1}$</dd></dl></div><div class='xr-var-data'><table>\n", | |
" <tr>\n", | |
" <td>\n", | |
" <table>\n", | |
" <thead>\n", | |
" <tr>\n", | |
" <td> </td>\n", | |
" <th> Array </th>\n", | |
" <th> Chunk </th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" \n", | |
" <tr>\n", | |
" <th> Bytes </th>\n", | |
" <td> 90.47 MiB </td>\n", | |
" <td> 7.42 MiB </td>\n", | |
" </tr>\n", | |
" \n", | |
" <tr>\n", | |
" <th> Shape </th>\n", | |
" <td> (366, 180, 360) </td>\n", | |
" <td> (30, 180, 360) </td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th> Count </th>\n", | |
" <td> 14 Tasks </td>\n", | |
" <td> 13 Chunks </td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th> Type </th>\n", | |
" <td> float32 </td>\n", | |
" <td> numpy.ndarray </td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
" </table>\n", | |
" </td>\n", | |
" <td>\n", | |
" <svg width=\"248\" height=\"179\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n", | |
"\n", | |
" <!-- Horizontal lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"10\" y1=\"59\" x2=\"80\" y2=\"129\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Vertical lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"59\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"15\" y1=\"5\" x2=\"15\" y2=\"64\" />\n", | |
" <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"70\" />\n", | |
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"76\" />\n", | |
" <line x1=\"33\" y1=\"23\" x2=\"33\" y2=\"82\" />\n", | |
" <line x1=\"38\" y1=\"28\" x2=\"38\" y2=\"87\" />\n", | |
" <line x1=\"44\" y1=\"34\" x2=\"44\" y2=\"93\" />\n", | |
" <line x1=\"50\" y1=\"40\" x2=\"50\" y2=\"99\" />\n", | |
" <line x1=\"56\" y1=\"46\" x2=\"56\" y2=\"105\" />\n", | |
" <line x1=\"62\" y1=\"52\" x2=\"62\" y2=\"111\" />\n", | |
" <line x1=\"67\" y1=\"57\" x2=\"67\" y2=\"116\" />\n", | |
" <line x1=\"73\" y1=\"63\" x2=\"73\" y2=\"122\" />\n", | |
" <line x1=\"79\" y1=\"69\" x2=\"79\" y2=\"128\" />\n", | |
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"129\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Colored Rectangle -->\n", | |
" <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,129.6046287367406 10.0,59.016393442622956\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", | |
"\n", | |
" <!-- Horizontal lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"128\" y2=\"0\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"15\" y1=\"5\" x2=\"133\" y2=\"5\" />\n", | |
" <line x1=\"21\" y1=\"11\" x2=\"139\" y2=\"11\" />\n", | |
" <line x1=\"27\" y1=\"17\" x2=\"145\" y2=\"17\" />\n", | |
" <line x1=\"33\" y1=\"23\" x2=\"151\" y2=\"23\" />\n", | |
" <line x1=\"38\" y1=\"28\" x2=\"156\" y2=\"28\" />\n", | |
" <line x1=\"44\" y1=\"34\" x2=\"162\" y2=\"34\" />\n", | |
" <line x1=\"50\" y1=\"40\" x2=\"168\" y2=\"40\" />\n", | |
" <line x1=\"56\" y1=\"46\" x2=\"174\" y2=\"46\" />\n", | |
" <line x1=\"62\" y1=\"52\" x2=\"180\" y2=\"52\" />\n", | |
" <line x1=\"67\" y1=\"57\" x2=\"185\" y2=\"57\" />\n", | |
" <line x1=\"73\" y1=\"63\" x2=\"191\" y2=\"63\" />\n", | |
" <line x1=\"79\" y1=\"69\" x2=\"197\" y2=\"69\" />\n", | |
" <line x1=\"80\" y1=\"70\" x2=\"198\" y2=\"70\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Vertical lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"128\" y1=\"0\" x2=\"198\" y2=\"70\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Colored Rectangle -->\n", | |
" <polygon points=\"10.0,0.0 128.0327868852459,0.0 198.62102217936356,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", | |
"\n", | |
" <!-- Horizontal lines -->\n", | |
" <line x1=\"80\" y1=\"70\" x2=\"198\" y2=\"70\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"80\" y1=\"129\" x2=\"198\" y2=\"129\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Vertical lines -->\n", | |
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"129\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"198\" y1=\"70\" x2=\"198\" y2=\"129\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Colored Rectangle -->\n", | |
" <polygon points=\"80.58823529411765,70.58823529411765 198.62102217936356,70.58823529411765 198.62102217936356,129.6046287367406 80.58823529411765,129.6046287367406\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", | |
"\n", | |
" <!-- Text -->\n", | |
" <text x=\"139.604629\" y=\"149.604629\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >360</text>\n", | |
" <text x=\"218.621022\" y=\"100.096432\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,218.621022,100.096432)\">180</text>\n", | |
" <text x=\"35.294118\" y=\"114.310511\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,114.310511)\">366</text>\n", | |
"</svg>\n", | |
" </td>\n", | |
" </tr>\n", | |
"</table></div></li></ul></div></li><li class='xr-section-item'><input id='section-eeba5866-b5ef-41c3-8f77-4b7cacfd4c6f' class='xr-section-summary-in' type='checkbox' ><label for='section-eeba5866-b5ef-41c3-8f77-4b7cacfd4c6f' class='xr-section-summary' >Indexes: <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-index-name'><div>time</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-aca1794e-21ad-4947-ad16-991adb26063d' class='xr-index-data-in' type='checkbox'/><label for='index-aca1794e-21ad-4947-ad16-991adb26063d' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(CFTimeIndex([2021-01-01 00:00:00, 2021-01-02 00:00:00, 2021-01-03 00:00:00,\n", | |
" 2021-01-04 00:00:00, 2021-01-05 00:00:00, 2021-01-06 00:00:00,\n", | |
" 2021-01-07 00:00:00, 2021-01-08 00:00:00, 2021-01-09 00:00:00,\n", | |
" 2021-01-10 00:00:00,\n", | |
" ...\n", | |
" 2021-12-23 00:00:00, 2021-12-24 00:00:00, 2021-12-25 00:00:00,\n", | |
" 2021-12-26 00:00:00, 2021-12-27 00:00:00, 2021-12-28 00:00:00,\n", | |
" 2021-12-29 00:00:00, 2021-12-30 00:00:00, 2021-12-31 00:00:00,\n", | |
" 2022-01-01 00:00:00],\n", | |
" dtype='object', length=366, calendar='noleap', freq='D'))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-1438a5ad-d22d-49f7-bb5b-17fc620eb33e' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-1438a5ad-d22d-49f7-bb5b-17fc620eb33e' 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: (time: 366, nlat: 180, nlon: 360)\n", | |
"Coordinates:\n", | |
" * time (time) object 2021-01-01 00:00:00 ... 2022-01-01 00:00:00\n", | |
"Dimensions without coordinates: nlat, nlon\n", | |
"Data variables:\n", | |
" FG_CO2_2 (time, nlat, nlon) float32 dask.array<chunksize=(30, 180, 360), meta=np.ndarray>" | |
] | |
}, | |
"execution_count": 12, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"da = xr.open_zarr(\"/glade/derecho/scratch/abanihi/fgco2-2021-180x360.zarr\")\n", | |
"da" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 13, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"{'chunks': (30, 180, 360),\n", | |
" 'preferred_chunks': {'time': 30, 'nlat': 180, 'nlon': 360},\n", | |
" 'compressor': Zlib(level=5),\n", | |
" 'filters': None,\n", | |
" '_FillValue': nan,\n", | |
" 'dtype': dtype('float32')}" | |
] | |
}, | |
"execution_count": 13, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"da.FG_CO2_2.encoding" | |
] | |
}, | |
{ | |
"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", | |
"<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", | |
"<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", | |
"html[theme=dark],\n", | |
"body[data-theme=dark],\n", | |
"body.vscode-dark {\n", | |
" --xr-font-color0: rgba(255, 255, 255, 1);\n", | |
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n", | |
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n", | |
" --xr-border-color: #1F1F1F;\n", | |
" --xr-disabled-color: #515151;\n", | |
" --xr-background-color: #111111;\n", | |
" --xr-background-color-row-even: #111111;\n", | |
" --xr-background-color-row-odd: #313131;\n", | |
"}\n", | |
"\n", | |
".xr-wrap {\n", | |
" display: block !important;\n", | |
" min-width: 300px;\n", | |
" max-width: 700px;\n", | |
"}\n", | |
"\n", | |
".xr-text-repr-fallback {\n", | |
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n", | |
" display: none;\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-index-preview {\n", | |
" grid-column: 2 / 5;\n", | |
" color: var(--xr-font-color2);\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", | |
".xr-index-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", | |
".xr-index-data-in:checked ~ .xr-index-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-index-name div,\n", | |
".xr-index-data,\n", | |
".xr-attrs {\n", | |
" padding-left: 25px !important;\n", | |
"}\n", | |
"\n", | |
".xr-attrs,\n", | |
".xr-var-attrs,\n", | |
".xr-var-data,\n", | |
".xr-index-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,\n", | |
".xr-attrs 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", | |
".xr-no-icon {\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><pre class='xr-text-repr-fallback'><xarray.Dataset>\n", | |
"Dimensions: (time: 366, nlat: 180, nlon: 360)\n", | |
"Coordinates:\n", | |
" * time (time) object 2021-01-01 00:00:00 ... 2022-01-01 00:00:00\n", | |
"Dimensions without coordinates: nlat, nlon\n", | |
"Data variables:\n", | |
" FG_CO2_2 (time, nlat, nlon) float32 dask.array<chunksize=(30, 180, 360), meta=np.ndarray></pre><div class='xr-wrap' style='display:none'><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-eaa1cb22-3e65-431a-b6d2-62f5320c301f' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-eaa1cb22-3e65-431a-b6d2-62f5320c301f' 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'>time</span>: 366</li><li><span>nlat</span>: 180</li><li><span>nlon</span>: 360</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-b9e83176-8d98-4d6c-8b38-b297b9c471c1' class='xr-section-summary-in' type='checkbox' checked><label for='section-b9e83176-8d98-4d6c-8b38-b297b9c471c1' 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'>time</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>2021-01-01 00:00:00 ... 2022-01-...</div><input id='attrs-224c6b82-e131-4e67-9a6c-de607748fff5' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-224c6b82-e131-4e67-9a6c-de607748fff5' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-d19d56f4-2fad-4490-ade3-521fac43cd3d' class='xr-var-data-in' type='checkbox'><label for='data-d19d56f4-2fad-4490-ade3-521fac43cd3d' 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>bounds :</span></dt><dd>time_bound</dd><dt><span>long_name :</span></dt><dd>time</dd></dl></div><div class='xr-var-data'><pre>array([cftime.DatetimeNoLeap(2021, 1, 1, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2021, 1, 2, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2021, 1, 3, 0, 0, 0, 0, has_year_zero=True), ...,\n", | |
" cftime.DatetimeNoLeap(2021, 12, 30, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2021, 12, 31, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2022, 1, 1, 0, 0, 0, 0, has_year_zero=True)],\n", | |
" dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-4560e3f3-710f-4f83-afe5-d9c8e22f34c7' class='xr-section-summary-in' type='checkbox' checked><label for='section-4560e3f3-710f-4f83-afe5-d9c8e22f34c7' 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>FG_CO2_2</span></div><div class='xr-var-dims'>(time, nlat, nlon)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(30, 180, 360), meta=np.ndarray></div><input id='attrs-977257c2-17db-4c19-85a1-2648131c6a62' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-977257c2-17db-4c19-85a1-2648131c6a62' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-3e8f4cd9-6079-433c-ab69-a2995a457fab' class='xr-var-data-in' type='checkbox'><label for='data-3e8f4cd9-6079-433c-ab69-a2995a457fab' 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>cell_methods :</span></dt><dd>time: mean</dd><dt><span>grid_loc :</span></dt><dd>2110</dd><dt><span>long_name :</span></dt><dd>DIC Surface Gas Flux</dd><dt><span>units :</span></dt><dd>mol m$^{-2}$ yr$^{-1}$</dd></dl></div><div class='xr-var-data'><table>\n", | |
" <tr>\n", | |
" <td>\n", | |
" <table>\n", | |
" <thead>\n", | |
" <tr>\n", | |
" <td> </td>\n", | |
" <th> Array </th>\n", | |
" <th> Chunk </th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" \n", | |
" <tr>\n", | |
" <th> Bytes </th>\n", | |
" <td> 90.47 MiB </td>\n", | |
" <td> 7.42 MiB </td>\n", | |
" </tr>\n", | |
" \n", | |
" <tr>\n", | |
" <th> Shape </th>\n", | |
" <td> (366, 180, 360) </td>\n", | |
" <td> (30, 180, 360) </td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th> Count </th>\n", | |
" <td> 14 Tasks </td>\n", | |
" <td> 13 Chunks </td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th> Type </th>\n", | |
" <td> float32 </td>\n", | |
" <td> numpy.ndarray </td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
" </table>\n", | |
" </td>\n", | |
" <td>\n", | |
" <svg width=\"248\" height=\"179\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n", | |
"\n", | |
" <!-- Horizontal lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"10\" y1=\"59\" x2=\"80\" y2=\"129\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Vertical lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"59\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"15\" y1=\"5\" x2=\"15\" y2=\"64\" />\n", | |
" <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"70\" />\n", | |
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"76\" />\n", | |
" <line x1=\"33\" y1=\"23\" x2=\"33\" y2=\"82\" />\n", | |
" <line x1=\"38\" y1=\"28\" x2=\"38\" y2=\"87\" />\n", | |
" <line x1=\"44\" y1=\"34\" x2=\"44\" y2=\"93\" />\n", | |
" <line x1=\"50\" y1=\"40\" x2=\"50\" y2=\"99\" />\n", | |
" <line x1=\"56\" y1=\"46\" x2=\"56\" y2=\"105\" />\n", | |
" <line x1=\"62\" y1=\"52\" x2=\"62\" y2=\"111\" />\n", | |
" <line x1=\"67\" y1=\"57\" x2=\"67\" y2=\"116\" />\n", | |
" <line x1=\"73\" y1=\"63\" x2=\"73\" y2=\"122\" />\n", | |
" <line x1=\"79\" y1=\"69\" x2=\"79\" y2=\"128\" />\n", | |
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"129\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Colored Rectangle -->\n", | |
" <polygon points=\"10.0,0.0 80.58823529411765,70.58823529411765 80.58823529411765,129.6046287367406 10.0,59.016393442622956\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", | |
"\n", | |
" <!-- Horizontal lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"128\" y2=\"0\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"15\" y1=\"5\" x2=\"133\" y2=\"5\" />\n", | |
" <line x1=\"21\" y1=\"11\" x2=\"139\" y2=\"11\" />\n", | |
" <line x1=\"27\" y1=\"17\" x2=\"145\" y2=\"17\" />\n", | |
" <line x1=\"33\" y1=\"23\" x2=\"151\" y2=\"23\" />\n", | |
" <line x1=\"38\" y1=\"28\" x2=\"156\" y2=\"28\" />\n", | |
" <line x1=\"44\" y1=\"34\" x2=\"162\" y2=\"34\" />\n", | |
" <line x1=\"50\" y1=\"40\" x2=\"168\" y2=\"40\" />\n", | |
" <line x1=\"56\" y1=\"46\" x2=\"174\" y2=\"46\" />\n", | |
" <line x1=\"62\" y1=\"52\" x2=\"180\" y2=\"52\" />\n", | |
" <line x1=\"67\" y1=\"57\" x2=\"185\" y2=\"57\" />\n", | |
" <line x1=\"73\" y1=\"63\" x2=\"191\" y2=\"63\" />\n", | |
" <line x1=\"79\" y1=\"69\" x2=\"197\" y2=\"69\" />\n", | |
" <line x1=\"80\" y1=\"70\" x2=\"198\" y2=\"70\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Vertical lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"80\" y2=\"70\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"128\" y1=\"0\" x2=\"198\" y2=\"70\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Colored Rectangle -->\n", | |
" <polygon points=\"10.0,0.0 128.0327868852459,0.0 198.62102217936356,70.58823529411765 80.58823529411765,70.58823529411765\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", | |
"\n", | |
" <!-- Horizontal lines -->\n", | |
" <line x1=\"80\" y1=\"70\" x2=\"198\" y2=\"70\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"80\" y1=\"129\" x2=\"198\" y2=\"129\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Vertical lines -->\n", | |
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"129\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"198\" y1=\"70\" x2=\"198\" y2=\"129\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Colored Rectangle -->\n", | |
" <polygon points=\"80.58823529411765,70.58823529411765 198.62102217936356,70.58823529411765 198.62102217936356,129.6046287367406 80.58823529411765,129.6046287367406\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", | |
"\n", | |
" <!-- Text -->\n", | |
" <text x=\"139.604629\" y=\"149.604629\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >360</text>\n", | |
" <text x=\"218.621022\" y=\"100.096432\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,218.621022,100.096432)\">180</text>\n", | |
" <text x=\"35.294118\" y=\"114.310511\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,114.310511)\">366</text>\n", | |
"</svg>\n", | |
" </td>\n", | |
" </tr>\n", | |
"</table></div></li></ul></div></li><li class='xr-section-item'><input id='section-6b13097f-c888-4d48-8e66-41a57a049cdf' class='xr-section-summary-in' type='checkbox' ><label for='section-6b13097f-c888-4d48-8e66-41a57a049cdf' class='xr-section-summary' >Indexes: <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-index-name'><div>time</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-48f4e3f9-0288-498b-9aa4-a7f9327d6e50' class='xr-index-data-in' type='checkbox'/><label for='index-48f4e3f9-0288-498b-9aa4-a7f9327d6e50' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(CFTimeIndex([2021-01-01 00:00:00, 2021-01-02 00:00:00, 2021-01-03 00:00:00,\n", | |
" 2021-01-04 00:00:00, 2021-01-05 00:00:00, 2021-01-06 00:00:00,\n", | |
" 2021-01-07 00:00:00, 2021-01-08 00:00:00, 2021-01-09 00:00:00,\n", | |
" 2021-01-10 00:00:00,\n", | |
" ...\n", | |
" 2021-12-23 00:00:00, 2021-12-24 00:00:00, 2021-12-25 00:00:00,\n", | |
" 2021-12-26 00:00:00, 2021-12-27 00:00:00, 2021-12-28 00:00:00,\n", | |
" 2021-12-29 00:00:00, 2021-12-30 00:00:00, 2021-12-31 00:00:00,\n", | |
" 2022-01-01 00:00:00],\n", | |
" dtype='object', length=366, calendar='noleap', freq='D'))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-cb106b47-4065-4d19-b2be-995461eda284' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-cb106b47-4065-4d19-b2be-995461eda284' 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: (time: 366, nlat: 180, nlon: 360)\n", | |
"Coordinates:\n", | |
" * time (time) object 2021-01-01 00:00:00 ... 2022-01-01 00:00:00\n", | |
"Dimensions without coordinates: nlat, nlon\n", | |
"Data variables:\n", | |
" FG_CO2_2 (time, nlat, nlon) float32 dask.array<chunksize=(30, 180, 360), meta=np.ndarray>" | |
] | |
}, | |
"execution_count": 15, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"xr.open_zarr(\"/glade/derecho/scratch/abanihi/fgco2-2021-180x360.zarr\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 16, | |
"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", | |
"<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", | |
"<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", | |
"html[theme=dark],\n", | |
"body[data-theme=dark],\n", | |
"body.vscode-dark {\n", | |
" --xr-font-color0: rgba(255, 255, 255, 1);\n", | |
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n", | |
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n", | |
" --xr-border-color: #1F1F1F;\n", | |
" --xr-disabled-color: #515151;\n", | |
" --xr-background-color: #111111;\n", | |
" --xr-background-color-row-even: #111111;\n", | |
" --xr-background-color-row-odd: #313131;\n", | |
"}\n", | |
"\n", | |
".xr-wrap {\n", | |
" display: block !important;\n", | |
" min-width: 300px;\n", | |
" max-width: 700px;\n", | |
"}\n", | |
"\n", | |
".xr-text-repr-fallback {\n", | |
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n", | |
" display: none;\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-index-preview {\n", | |
" grid-column: 2 / 5;\n", | |
" color: var(--xr-font-color2);\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", | |
".xr-index-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", | |
".xr-index-data-in:checked ~ .xr-index-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-index-name div,\n", | |
".xr-index-data,\n", | |
".xr-attrs {\n", | |
" padding-left: 25px !important;\n", | |
"}\n", | |
"\n", | |
".xr-attrs,\n", | |
".xr-var-attrs,\n", | |
".xr-var-data,\n", | |
".xr-index-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,\n", | |
".xr-attrs 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", | |
".xr-no-icon {\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><pre class='xr-text-repr-fallback'><xarray.Dataset>\n", | |
"Dimensions: (time: 366, nlat: 360, nlon: 720)\n", | |
"Coordinates:\n", | |
" * time (time) object 2021-01-01 00:00:00 ... 2022-01-01 00:00:00\n", | |
"Dimensions without coordinates: nlat, nlon\n", | |
"Data variables:\n", | |
" FG_CO2_2 (time, nlat, nlon) float32 dask.array<chunksize=(30, 360, 720), meta=np.ndarray></pre><div class='xr-wrap' style='display:none'><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-1ee1c5bf-9a26-43b1-8235-39af92544f70' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-1ee1c5bf-9a26-43b1-8235-39af92544f70' 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'>time</span>: 366</li><li><span>nlat</span>: 360</li><li><span>nlon</span>: 720</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-e7384bb4-80be-4b07-95c4-d86d0ff318ab' class='xr-section-summary-in' type='checkbox' checked><label for='section-e7384bb4-80be-4b07-95c4-d86d0ff318ab' 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'>time</span></div><div class='xr-var-dims'>(time)</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>2021-01-01 00:00:00 ... 2022-01-...</div><input id='attrs-b153a442-9afb-4d1e-8160-8fcae55f9883' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-b153a442-9afb-4d1e-8160-8fcae55f9883' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-912b90e6-90a4-4aa9-8481-cfc94da3604f' class='xr-var-data-in' type='checkbox'><label for='data-912b90e6-90a4-4aa9-8481-cfc94da3604f' 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>bounds :</span></dt><dd>time_bound</dd><dt><span>long_name :</span></dt><dd>time</dd></dl></div><div class='xr-var-data'><pre>array([cftime.DatetimeNoLeap(2021, 1, 1, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2021, 1, 2, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2021, 1, 3, 0, 0, 0, 0, has_year_zero=True), ...,\n", | |
" cftime.DatetimeNoLeap(2021, 12, 30, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2021, 12, 31, 0, 0, 0, 0, has_year_zero=True),\n", | |
" cftime.DatetimeNoLeap(2022, 1, 1, 0, 0, 0, 0, has_year_zero=True)],\n", | |
" dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-83cf99a5-abfb-46c8-9dcd-8d349f6a4ed6' class='xr-section-summary-in' type='checkbox' checked><label for='section-83cf99a5-abfb-46c8-9dcd-8d349f6a4ed6' 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>FG_CO2_2</span></div><div class='xr-var-dims'>(time, nlat, nlon)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>dask.array<chunksize=(30, 360, 720), meta=np.ndarray></div><input id='attrs-bba3e436-557b-4347-9321-eda90a75786e' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-bba3e436-557b-4347-9321-eda90a75786e' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-adf06807-d7c3-4e9b-929f-500b3dd62e19' class='xr-var-data-in' type='checkbox'><label for='data-adf06807-d7c3-4e9b-929f-500b3dd62e19' 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>cell_methods :</span></dt><dd>time: mean</dd><dt><span>grid_loc :</span></dt><dd>2110</dd><dt><span>long_name :</span></dt><dd>DIC Surface Gas Flux</dd><dt><span>units :</span></dt><dd>mol m$^{-2}$ yr$^{-1}$</dd></dl></div><div class='xr-var-data'><table>\n", | |
" <tr>\n", | |
" <td>\n", | |
" <table>\n", | |
" <thead>\n", | |
" <tr>\n", | |
" <td> </td>\n", | |
" <th> Array </th>\n", | |
" <th> Chunk </th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" \n", | |
" <tr>\n", | |
" <th> Bytes </th>\n", | |
" <td> 361.89 MiB </td>\n", | |
" <td> 29.66 MiB </td>\n", | |
" </tr>\n", | |
" \n", | |
" <tr>\n", | |
" <th> Shape </th>\n", | |
" <td> (366, 360, 720) </td>\n", | |
" <td> (30, 360, 720) </td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th> Count </th>\n", | |
" <td> 14 Tasks </td>\n", | |
" <td> 13 Chunks </td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th> Type </th>\n", | |
" <td> float32 </td>\n", | |
" <td> numpy.ndarray </td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
" </table>\n", | |
" </td>\n", | |
" <td>\n", | |
" <svg width=\"215\" height=\"145\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n", | |
"\n", | |
" <!-- Horizontal lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"45\" y2=\"35\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"10\" y1=\"60\" x2=\"45\" y2=\"95\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Vertical lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"60\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"62\" />\n", | |
" <line x1=\"15\" y1=\"5\" x2=\"15\" y2=\"65\" />\n", | |
" <line x1=\"18\" y1=\"8\" x2=\"18\" y2=\"68\" />\n", | |
" <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"71\" />\n", | |
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"74\" />\n", | |
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"77\" />\n", | |
" <line x1=\"30\" y1=\"20\" x2=\"30\" y2=\"80\" />\n", | |
" <line x1=\"33\" y1=\"23\" x2=\"33\" y2=\"83\" />\n", | |
" <line x1=\"36\" y1=\"26\" x2=\"36\" y2=\"86\" />\n", | |
" <line x1=\"39\" y1=\"29\" x2=\"39\" y2=\"89\" />\n", | |
" <line x1=\"42\" y1=\"32\" x2=\"42\" y2=\"92\" />\n", | |
" <line x1=\"45\" y1=\"35\" x2=\"45\" y2=\"95\" />\n", | |
" <line x1=\"45\" y1=\"35\" x2=\"45\" y2=\"95\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Colored Rectangle -->\n", | |
" <polygon points=\"10.0,0.0 45.88235294117647,35.88235294117647 45.88235294117647,95.88235294117646 10.0,60.0\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", | |
"\n", | |
" <!-- Horizontal lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"12\" y1=\"2\" x2=\"132\" y2=\"2\" />\n", | |
" <line x1=\"15\" y1=\"5\" x2=\"135\" y2=\"5\" />\n", | |
" <line x1=\"18\" y1=\"8\" x2=\"138\" y2=\"8\" />\n", | |
" <line x1=\"21\" y1=\"11\" x2=\"141\" y2=\"11\" />\n", | |
" <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" />\n", | |
" <line x1=\"27\" y1=\"17\" x2=\"147\" y2=\"17\" />\n", | |
" <line x1=\"30\" y1=\"20\" x2=\"150\" y2=\"20\" />\n", | |
" <line x1=\"33\" y1=\"23\" x2=\"153\" y2=\"23\" />\n", | |
" <line x1=\"36\" y1=\"26\" x2=\"156\" y2=\"26\" />\n", | |
" <line x1=\"39\" y1=\"29\" x2=\"159\" y2=\"29\" />\n", | |
" <line x1=\"42\" y1=\"32\" x2=\"162\" y2=\"32\" />\n", | |
" <line x1=\"45\" y1=\"35\" x2=\"165\" y2=\"35\" />\n", | |
" <line x1=\"45\" y1=\"35\" x2=\"165\" y2=\"35\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Vertical lines -->\n", | |
" <line x1=\"10\" y1=\"0\" x2=\"45\" y2=\"35\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"130\" y1=\"0\" x2=\"165\" y2=\"35\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Colored Rectangle -->\n", | |
" <polygon points=\"10.0,0.0 130.0,0.0 165.88235294117646,35.88235294117647 45.88235294117647,35.88235294117647\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", | |
"\n", | |
" <!-- Horizontal lines -->\n", | |
" <line x1=\"45\" y1=\"35\" x2=\"165\" y2=\"35\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"45\" y1=\"95\" x2=\"165\" y2=\"95\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Vertical lines -->\n", | |
" <line x1=\"45\" y1=\"35\" x2=\"45\" y2=\"95\" style=\"stroke-width:2\" />\n", | |
" <line x1=\"165\" y1=\"35\" x2=\"165\" y2=\"95\" style=\"stroke-width:2\" />\n", | |
"\n", | |
" <!-- Colored Rectangle -->\n", | |
" <polygon points=\"45.88235294117647,35.88235294117647 165.88235294117646,35.88235294117647 165.88235294117646,95.88235294117646 45.88235294117647,95.88235294117646\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", | |
"\n", | |
" <!-- Text -->\n", | |
" <text x=\"105.882353\" y=\"115.882353\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >720</text>\n", | |
" <text x=\"185.882353\" y=\"65.882353\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,185.882353,65.882353)\">360</text>\n", | |
" <text x=\"17.941176\" y=\"97.941176\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,17.941176,97.941176)\">366</text>\n", | |
"</svg>\n", | |
" </td>\n", | |
" </tr>\n", | |
"</table></div></li></ul></div></li><li class='xr-section-item'><input id='section-ad9c7d5a-c015-40d2-99be-24030c882f3d' class='xr-section-summary-in' type='checkbox' ><label for='section-ad9c7d5a-c015-40d2-99be-24030c882f3d' class='xr-section-summary' >Indexes: <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-index-name'><div>time</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-64b07976-587e-441d-a7d6-58ca39010165' class='xr-index-data-in' type='checkbox'/><label for='index-64b07976-587e-441d-a7d6-58ca39010165' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(CFTimeIndex([2021-01-01 00:00:00, 2021-01-02 00:00:00, 2021-01-03 00:00:00,\n", | |
" 2021-01-04 00:00:00, 2021-01-05 00:00:00, 2021-01-06 00:00:00,\n", | |
" 2021-01-07 00:00:00, 2021-01-08 00:00:00, 2021-01-09 00:00:00,\n", | |
" 2021-01-10 00:00:00,\n", | |
" ...\n", | |
" 2021-12-23 00:00:00, 2021-12-24 00:00:00, 2021-12-25 00:00:00,\n", | |
" 2021-12-26 00:00:00, 2021-12-27 00:00:00, 2021-12-28 00:00:00,\n", | |
" 2021-12-29 00:00:00, 2021-12-30 00:00:00, 2021-12-31 00:00:00,\n", | |
" 2022-01-01 00:00:00],\n", | |
" dtype='object', length=366, calendar='noleap', freq='D'))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-bd3e49e4-00b6-4dbf-a9b2-a3ad74262231' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-bd3e49e4-00b6-4dbf-a9b2-a3ad74262231' 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: (time: 366, nlat: 360, nlon: 720)\n", | |
"Coordinates:\n", | |
" * time (time) object 2021-01-01 00:00:00 ... 2022-01-01 00:00:00\n", | |
"Dimensions without coordinates: nlat, nlon\n", | |
"Data variables:\n", | |
" FG_CO2_2 (time, nlat, nlon) float32 dask.array<chunksize=(30, 360, 720), meta=np.ndarray>" | |
] | |
}, | |
"execution_count": 16, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"xr.open_zarr(\"/glade/derecho/scratch/abanihi/fgco2-2021-360x720.zarr\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python [conda env:miniconda-dev]", | |
"language": "python", | |
"name": "conda-env-miniconda-dev-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.9.15" | |
}, | |
"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