Skip to content

Instantly share code, notes, and snippets.

@aaronspring
Last active February 14, 2020 10:15
Show Gist options
  • Save aaronspring/3b1e5853fdd4ff57d941ce1687cddad9 to your computer and use it in GitHub Desktop.
Save aaronspring/3b1e5853fdd4ff57d941ce1687cddad9 to your computer and use it in GitHub Desktop.
performance analysis of climpred.bootstrap.bootstrap_hindcast based on dummy data
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Bootstrap threshold in parallel\n",
"\n",
"This notebook tries to speed up `bootstrap_hindcast` and `compute_hindcast`.\n",
"https://climpred.readthedocs.io/en/stable/api/climpred.bootstrap.bootstrap_hindcast.html"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# understand what this really means\n",
"#!export OMP_NUM_THREADS=1\n",
"#!export MKL_NUM_THREADS=1\n",
"#!export OPENBLAS_NUM_THREADS=1"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'2.0.0.post4'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# use climpred-dev environment\n",
"import climpred\n",
"\n",
"import dask\n",
"import numpy as np\n",
"import pandas as pd\n",
"import xarray as xr\n",
"from tqdm import trange\n",
"\n",
"from dask.distributed import Client\n",
"import multiprocessing\n",
"import warnings\n",
"\n",
"warnings.filterwarnings(\"ignore\")\n",
"# number of logical cpus: https://www.dkrz.de/up/systems/mistral/configuration\n",
"ncpu = multiprocessing.cpu_count()\n",
"import timeit\n",
"import matplotlib.pyplot as plt\n",
"import xskillscore as xs\n",
"\n",
"climpred.__version__"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# xr.show_versions()"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"%load_ext lab_black"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### distributed on a full node"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Number of CPUs: 72, number of threads: 9, number of workers: 8, processes: False\n"
]
}
],
"source": [
"from dask.distributed import Client\n",
"import multiprocessing\n",
"\n",
"processes = False\n",
"nworker = 8\n",
"threads = ncpu // nworker\n",
"print(\n",
" f\"Number of CPUs: {ncpu}, number of threads: {threads}, number of workers: {nworker}, processes: {processes}\",\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"# client.close()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"client = Client(\n",
" processes=processes,\n",
" threads_per_worker=threads,\n",
" n_workers=nworker,\n",
" memory_limit=\"128GB\",\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### distributed across many nodes"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from dask_jobqueue import SLURMCluster\n",
"\n",
"cluster = SLURMCluster(\n",
" interface=\"ib0\",\n",
" processes=True,\n",
" threads_per_worker=threads,\n",
" n_workers=nworker,\n",
" memory_limit=\"128GB\",\n",
")\n",
"\n",
"cluster.scale(jobs=8) # Deploy 8 single-node jobs"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"client = Client(cluster)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table style=\"border: 2px solid white;\">\n",
"<tr>\n",
"<td style=\"vertical-align: top; border: 0px solid white\">\n",
"<h3 style=\"text-align: left;\">Client</h3>\n",
"<ul style=\"text-align: left; list-style: none; margin: 0; padding: 0;\">\n",
" <li><b>Scheduler: </b>tcp://10.50.38.238:35350</li>\n",
" <li><b>Dashboard: </b><a href='http://localhost:8888/proxy/8787/status' target='_blank'>http://localhost:8888/proxy/8787/status</a>\n",
"</ul>\n",
"</td>\n",
"<td style=\"vertical-align: top; border: 0px solid white\">\n",
"<h3 style=\"text-align: left;\">Cluster</h3>\n",
"<ul style=\"text-align: left; list-style:none; margin: 0; padding: 0;\">\n",
" <li><b>Workers: </b>8</li>\n",
" <li><b>Cores: </b>288</li>\n",
" <li><b>Memory: </b>800.00 GB</li>\n",
"</ul>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"<Client: 'tcp://10.50.38.238:35350' processes=8 threads=288, memory=800.00 GB>"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"client"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## small data"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 124.79 MB </td> <td> 41.60 MB </td></tr>\n",
" <tr><th> Shape </th><td> (34, 59, 72, 36, 3) </td> <td> (34, 59, 72, 36, 1) </td></tr>\n",
" <tr><th> Count </th><td> 3 Tasks </td><td> 3 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"489\" height=\"180\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"98\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"56\" x2=\"98\" y2=\"56\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"56\" style=\"stroke-width:2\" />\n",
" <line x1=\"98\" y1=\"0\" x2=\"98\" y2=\"56\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"0.000000,0.000000 98.333333,0.000000 98.333333,56.666667 0.000000,56.666667\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"49.166667\" y=\"76.666667\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >59</text>\n",
" <text x=\"118.333333\" y=\"28.333333\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,118.333333,28.333333)\">34</text>\n",
"\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"168\" y1=\"0\" x2=\"238\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"168\" y1=\"60\" x2=\"238\" y2=\"130\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"168\" y1=\"0\" x2=\"168\" y2=\"60\" style=\"stroke-width:2\" />\n",
" <line x1=\"238\" y1=\"70\" x2=\"238\" y2=\"130\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"168.000000,0.000000 238.588235,70.588235 238.588235,130.588235 168.000000,60.000000\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"168\" y1=\"0\" x2=\"201\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"238\" y1=\"70\" x2=\"271\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"168\" y1=\"0\" x2=\"238\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"179\" y1=\"0\" x2=\"249\" y2=\"70\" />\n",
" <line x1=\"190\" y1=\"0\" x2=\"260\" y2=\"70\" />\n",
" <line x1=\"201\" y1=\"0\" x2=\"271\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"168.000000,0.000000 201.383698,0.000000 271.971934,70.588235 238.588235,70.588235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"238\" y1=\"70\" x2=\"271\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"238\" y1=\"130\" x2=\"271\" y2=\"130\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"238\" y1=\"70\" x2=\"238\" y2=\"130\" style=\"stroke-width:2\" />\n",
" <line x1=\"249\" y1=\"70\" x2=\"249\" y2=\"130\" />\n",
" <line x1=\"260\" y1=\"70\" x2=\"260\" y2=\"130\" />\n",
" <line x1=\"271\" y1=\"70\" x2=\"271\" y2=\"130\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"238.588235,70.588235 271.971934,70.588235 271.971934,130.588235 238.588235,130.588235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"255.280085\" y=\"150.588235\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >3</text>\n",
" <text x=\"291.971934\" y=\"100.588235\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,291.971934,100.588235)\">36</text>\n",
" <text x=\"193.294118\" y=\"115.294118\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,193.294118,115.294118)\">72</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"dask.array<xarray-<this-array>, shape=(34, 59, 72, 36, 3), dtype=float64, chunksize=(34, 59, 72, 36, 1), chunktype=numpy.ndarray>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 45.12 MB </td> <td> 45.12 MB </td></tr>\n",
" <tr><th> Shape </th><td> (64, 72, 36, 34) </td> <td> (64, 72, 36, 34) </td></tr>\n",
" <tr><th> Count </th><td> 1 Tasks </td><td> 1 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"529\" height=\"180\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"106\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"27\" x2=\"106\" y2=\"27\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"27\" style=\"stroke-width:2\" />\n",
" <line x1=\"106\" y1=\"0\" x2=\"106\" y2=\"27\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"0.000000,0.000000 106.666667,0.000000 106.666667,27.054036 0.000000,27.054036\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"53.333333\" y=\"47.054036\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >64</text>\n",
" <text x=\"126.666667\" y=\"13.527018\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,126.666667,13.527018)\">1</text>\n",
"\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"176\" y1=\"0\" x2=\"246\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"176\" y1=\"60\" x2=\"246\" y2=\"130\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"176\" y1=\"0\" x2=\"176\" y2=\"60\" style=\"stroke-width:2\" />\n",
" <line x1=\"246\" y1=\"70\" x2=\"246\" y2=\"130\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"176.000000,0.000000 246.588235,70.588235 246.588235,130.588235 176.000000,60.000000\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"176\" y1=\"0\" x2=\"232\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"246\" y1=\"70\" x2=\"303\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"176\" y1=\"0\" x2=\"246\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"232\" y1=\"0\" x2=\"303\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"176.000000,0.000000 232.666667,0.000000 303.254902,70.588235 246.588235,70.588235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"246\" y1=\"70\" x2=\"303\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"246\" y1=\"130\" x2=\"303\" y2=\"130\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"246\" y1=\"70\" x2=\"246\" y2=\"130\" style=\"stroke-width:2\" />\n",
" <line x1=\"303\" y1=\"70\" x2=\"303\" y2=\"130\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"246.588235,70.588235 303.254902,70.588235 303.254902,130.588235 246.588235,130.588235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"274.921569\" y=\"150.588235\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >34</text>\n",
" <text x=\"323.254902\" y=\"100.588235\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,323.254902,100.588235)\">36</text>\n",
" <text x=\"201.294118\" y=\"115.294118\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,201.294118,115.294118)\">72</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"dask.array<xarray-<this-array>, shape=(64, 72, 36, 34), dtype=float64, chunksize=(64, 72, 36, 34), chunktype=numpy.ndarray>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 1.22 MB </td> <td> 1.22 MB </td></tr>\n",
" <tr><th> Shape </th><td> (59, 72, 36) </td> <td> (59, 72, 36) </td></tr>\n",
" <tr><th> Count </th><td> 1 Tasks </td><td> 1 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"177\" height=\"227\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"67\" y2=\"57\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"120\" x2=\"67\" y2=\"177\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"120\" style=\"stroke-width:2\" />\n",
" <line x1=\"67\" y1=\"57\" x2=\"67\" y2=\"177\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.000000,0.000000 67.843137,57.843137 67.843137,177.843137 10.000000,120.000000\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"70\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"67\" y1=\"57\" x2=\"127\" y2=\"57\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"67\" y2=\"57\" style=\"stroke-width:2\" />\n",
" <line x1=\"70\" y1=\"0\" x2=\"127\" y2=\"57\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.000000,0.000000 70.000000,0.000000 127.843137,57.843137 67.843137,57.843137\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"67\" y1=\"57\" x2=\"127\" y2=\"57\" style=\"stroke-width:2\" />\n",
" <line x1=\"67\" y1=\"177\" x2=\"127\" y2=\"177\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"67\" y1=\"57\" x2=\"67\" y2=\"177\" style=\"stroke-width:2\" />\n",
" <line x1=\"127\" y1=\"57\" x2=\"127\" y2=\"177\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"67.843137,57.843137 127.843137,57.843137 127.843137,177.843137 67.843137,177.843137\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"97.843137\" y=\"197.843137\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >36</text>\n",
" <text x=\"147.843137\" y=\"117.843137\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,147.843137,117.843137)\">72</text>\n",
" <text x=\"28.921569\" y=\"168.921569\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,28.921569,168.921569)\">59</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"dask.array<xarray-<this-array>, shape=(59, 72, 36), dtype=float64, chunksize=(59, 72, 36), chunktype=numpy.ndarray>"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def gen_input(\n",
" cs=1, no_time_chunks=True, chunk_dim=\"x\", persist=True,\n",
"):\n",
" lats = np.arange(36)\n",
" lons = np.arange(72) # 5x5 spatial\n",
" leads = np.arange(1, 4)\n",
" members = np.arange(34)\n",
" inits = xr.cftime_range(start=\"1960\", freq=\"YS\", end=\"2018\")\n",
" hind = xr.DataArray(\n",
" np.random.random((len(members), len(inits), len(lons), len(lats), len(leads))),\n",
" coords={\n",
" \"member\": members,\n",
" \"init\": inits,\n",
" \"lon\": lons,\n",
" \"lat\": lats,\n",
" \"lead\": leads,\n",
" },\n",
" dims=(\"member\", \"init\", \"lon\", \"lat\", \"lead\"),\n",
" )\n",
" hind.lead.attrs[\"units\"] = \"years\"\n",
" obs = xr.DataArray(\n",
" np.random.random((len(inits), len(lons), len(lats))),\n",
" coords={\"time\": inits, \"lon\": lons, \"lat\": lats,},\n",
" dims=(\"time\", \"lon\", \"lat\"),\n",
" )\n",
" inits = xr.cftime_range(start=\"1960\", freq=\"YS\", end=\"2023\")\n",
" hist = xr.DataArray(\n",
" np.random.random((len(inits), len(lons), len(lats), len(members))),\n",
" coords={\"time\": inits, \"lon\": lons, \"lat\": lats, \"member\": members},\n",
" dims=(\"time\", \"lon\", \"lat\", \"member\"),\n",
" )\n",
" if chunk_dim:\n",
" hind = hind.chunk({chunk_dim: cs})\n",
" obs = obs.chunk({\"lon\": -1})\n",
" hist = hist.chunk({\"member\": -1})\n",
" if persist:\n",
" obs = obs.persist()\n",
" hind = hind.persist()\n",
" hist = hist.persist()\n",
" return hind, hist, obs\n",
"\n",
"\n",
"hind, hist, obs = gen_input(chunk_dim=\"lead\")\n",
"display(hind.data)\n",
"display(hist.data)\n",
"obs.data"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# compute_hindcast"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"from climpred.prediction import compute_hindcast"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"outputs": [],
"source": [
"kw = {\"metric\": \"acc\", \"comparison\": \"e2r\"}"
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 163 ms, sys: 29 ms, total: 192 ms\n",
"Wall time: 164 ms\n"
]
}
],
"source": [
"%time s = compute_hindcast(hind,obs,**kw)"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 62.21 kB </td> <td> 20.74 kB </td></tr>\n",
" <tr><th> Shape </th><td> (3, 72, 36) </td> <td> (1, 72, 36) </td></tr>\n",
" <tr><th> Count </th><td> 51 Tasks </td><td> 3 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"139\" height=\"189\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"29\" y2=\"19\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"120\" x2=\"29\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"120\" style=\"stroke-width:2\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"16\" y2=\"126\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"23\" y2=\"133\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"29\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.000000,0.000000 29.637470,19.637470 29.637470,139.637470 10.000000,120.000000\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"70\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"76\" y2=\"6\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"83\" y2=\"13\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"89\" y2=\"19\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"29\" y2=\"19\" style=\"stroke-width:2\" />\n",
" <line x1=\"70\" y1=\"0\" x2=\"89\" y2=\"19\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.000000,0.000000 70.000000,0.000000 89.637470,19.637470 29.637470,19.637470\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"29\" y1=\"19\" x2=\"89\" y2=\"19\" style=\"stroke-width:2\" />\n",
" <line x1=\"29\" y1=\"139\" x2=\"89\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"29\" y1=\"19\" x2=\"29\" y2=\"139\" style=\"stroke-width:2\" />\n",
" <line x1=\"89\" y1=\"19\" x2=\"89\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"29.637470,19.637470 89.637470,19.637470 89.637470,139.637470 29.637470,139.637470\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"59.637470\" y=\"159.637470\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >36</text>\n",
" <text x=\"109.637470\" y=\"79.637470\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,109.637470,79.637470)\">72</text>\n",
" <text x=\"9.818735\" y=\"149.818735\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,9.818735,149.818735)\">3</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"dask.array<concatenate, shape=(3, 72, 36), dtype=float64, chunksize=(1, 72, 36), chunktype=numpy.ndarray>"
]
},
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"s.data"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 328 ms, sys: 97 ms, total: 425 ms\n",
"Wall time: 195 ms\n"
]
}
],
"source": [
"%time sc=s.compute()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# bootstrap_hindcast"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [],
"source": [
"from climpred.bootstrap import bootstrap_hindcast\n",
"\n",
"# bootstrap_hindcast??"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {},
"outputs": [],
"source": [
"from climpred.bootstrap import bootstrap_compute\n",
"\n",
"# bootstrap_compute??"
]
},
{
"cell_type": "code",
"execution_count": 50,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"256"
]
},
"execution_count": 50,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bootstrap = 16 * 16\n",
"bootstrap"
]
},
{
"cell_type": "code",
"execution_count": 51,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'metric': 'acc', 'comparison': 'e2r'}"
]
},
"execution_count": 51,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"kw"
]
},
{
"cell_type": "code",
"execution_count": 55,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"distributed.comm.inproc - WARNING - Closing dangling queue in <InProc local=inproc://10.50.44.43/18979/96 remote=inproc://10.50.44.43/18979/1>\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 3min 3s, sys: 20.5 s, total: 3min 24s\n",
"Wall time: 3min 8s\n"
]
}
],
"source": [
"%time bs = bootstrap_hindcast(hind, hist, obs, bootstrap=bootstrap, **kw)"
]
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 746.50 kB </td> <td> 20.74 kB </td></tr>\n",
" <tr><th> Shape </th><td> (4, 3, 3, 72, 36) </td> <td> (1, 1, 1, 72, 36) </td></tr>\n",
" <tr><th> Count </th><td> 112042 Tasks </td><td> 36 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"335\" height=\"189\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"33\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"8\" x2=\"33\" y2=\"8\" />\n",
" <line x1=\"0\" y1=\"17\" x2=\"33\" y2=\"17\" />\n",
" <line x1=\"0\" y1=\"26\" x2=\"33\" y2=\"26\" />\n",
" <line x1=\"0\" y1=\"35\" x2=\"33\" y2=\"35\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"35\" style=\"stroke-width:2\" />\n",
" <line x1=\"11\" y1=\"0\" x2=\"11\" y2=\"35\" />\n",
" <line x1=\"22\" y1=\"0\" x2=\"22\" y2=\"35\" />\n",
" <line x1=\"33\" y1=\"0\" x2=\"33\" y2=\"35\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"0.000000,0.000000 33.383698,0.000000 33.383698,35.144829 0.000000,35.144829\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"16.691849\" y=\"55.144829\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >3</text>\n",
" <text x=\"53.383698\" y=\"17.572414\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,53.383698,17.572414)\">4</text>\n",
"\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"103\" y1=\"0\" x2=\"122\" y2=\"19\" style=\"stroke-width:2\" />\n",
" <line x1=\"103\" y1=\"120\" x2=\"122\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"103\" y1=\"0\" x2=\"103\" y2=\"120\" style=\"stroke-width:2\" />\n",
" <line x1=\"109\" y1=\"6\" x2=\"109\" y2=\"126\" />\n",
" <line x1=\"116\" y1=\"13\" x2=\"116\" y2=\"133\" />\n",
" <line x1=\"122\" y1=\"19\" x2=\"122\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"103.000000,0.000000 122.637470,19.637470 122.637470,139.637470 103.000000,120.000000\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"103\" y1=\"0\" x2=\"163\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"109\" y1=\"6\" x2=\"169\" y2=\"6\" />\n",
" <line x1=\"116\" y1=\"13\" x2=\"176\" y2=\"13\" />\n",
" <line x1=\"122\" y1=\"19\" x2=\"182\" y2=\"19\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"103\" y1=\"0\" x2=\"122\" y2=\"19\" style=\"stroke-width:2\" />\n",
" <line x1=\"163\" y1=\"0\" x2=\"182\" y2=\"19\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"103.000000,0.000000 163.000000,0.000000 182.637470,19.637470 122.637470,19.637470\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"122\" y1=\"19\" x2=\"182\" y2=\"19\" style=\"stroke-width:2\" />\n",
" <line x1=\"122\" y1=\"139\" x2=\"182\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"122\" y1=\"19\" x2=\"122\" y2=\"139\" style=\"stroke-width:2\" />\n",
" <line x1=\"182\" y1=\"19\" x2=\"182\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"122.637470,19.637470 182.637470,19.637470 182.637470,139.637470 122.637470,139.637470\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"152.637470\" y=\"159.637470\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >36</text>\n",
" <text x=\"202.637470\" y=\"79.637470\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,202.637470,79.637470)\">72</text>\n",
" <text x=\"102.818735\" y=\"149.818735\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,102.818735,149.818735)\">3</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"dask.array<concatenate, shape=(4, 3, 3, 72, 36), dtype=float64, chunksize=(1, 1, 1, 72, 36), chunktype=numpy.ndarray>"
]
},
"execution_count": 56,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bs.data"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is way too many tasks!"
]
},
{
"cell_type": "code",
"execution_count": 57,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 4min 42s, sys: 2min 3s, total: 6min 45s\n",
"Wall time: 2min 18s\n"
]
}
],
"source": [
"%time bsc = bs.compute()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# identical compute without dask\n",
"%time bs = bootstrap_hindcast(hind.load(), hist.load(), obs.load(), bootstrap=bootstrap, **kw)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# understand bootstrap_hindcast"
]
},
{
"cell_type": "code",
"execution_count": 58,
"metadata": {},
"outputs": [],
"source": [
"from climpred.bootstrap import bootstrap_compute, bootstrap_uninitialized_ensemble"
]
},
{
"cell_type": "code",
"execution_count": 59,
"metadata": {},
"outputs": [],
"source": [
"# bootstrap_hindcast wraps bootstrap_compute\n",
"# bootstrap_compute??"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## understand bootstrap_uninit"
]
},
{
"cell_type": "code",
"execution_count": 60,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 552 ms, sys: 124 ms, total: 676 ms\n",
"Wall time: 3.64 s\n"
]
}
],
"source": [
"%time uhind = bootstrap_uninitialized_ensemble(hind, hist)"
]
},
{
"cell_type": "code",
"execution_count": 61,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 124.79 MB </td> <td> 41.60 MB </td></tr>\n",
" <tr><th> Shape </th><td> (34, 59, 72, 36, 3) </td> <td> (34, 59, 72, 36, 1) </td></tr>\n",
" <tr><th> Count </th><td> 303 Tasks </td><td> 3 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"489\" height=\"180\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"98\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"56\" x2=\"98\" y2=\"56\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"56\" style=\"stroke-width:2\" />\n",
" <line x1=\"98\" y1=\"0\" x2=\"98\" y2=\"56\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"0.000000,0.000000 98.333333,0.000000 98.333333,56.666667 0.000000,56.666667\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"49.166667\" y=\"76.666667\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >59</text>\n",
" <text x=\"118.333333\" y=\"28.333333\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,118.333333,28.333333)\">34</text>\n",
"\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"168\" y1=\"0\" x2=\"238\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"168\" y1=\"60\" x2=\"238\" y2=\"130\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"168\" y1=\"0\" x2=\"168\" y2=\"60\" style=\"stroke-width:2\" />\n",
" <line x1=\"238\" y1=\"70\" x2=\"238\" y2=\"130\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"168.000000,0.000000 238.588235,70.588235 238.588235,130.588235 168.000000,60.000000\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"168\" y1=\"0\" x2=\"201\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"238\" y1=\"70\" x2=\"271\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"168\" y1=\"0\" x2=\"238\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"179\" y1=\"0\" x2=\"249\" y2=\"70\" />\n",
" <line x1=\"190\" y1=\"0\" x2=\"260\" y2=\"70\" />\n",
" <line x1=\"201\" y1=\"0\" x2=\"271\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"168.000000,0.000000 201.383698,0.000000 271.971934,70.588235 238.588235,70.588235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"238\" y1=\"70\" x2=\"271\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"238\" y1=\"130\" x2=\"271\" y2=\"130\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"238\" y1=\"70\" x2=\"238\" y2=\"130\" style=\"stroke-width:2\" />\n",
" <line x1=\"249\" y1=\"70\" x2=\"249\" y2=\"130\" />\n",
" <line x1=\"260\" y1=\"70\" x2=\"260\" y2=\"130\" />\n",
" <line x1=\"271\" y1=\"70\" x2=\"271\" y2=\"130\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"238.588235,70.588235 271.971934,70.588235 271.971934,130.588235 238.588235,130.588235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"255.280085\" y=\"150.588235\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >3</text>\n",
" <text x=\"291.971934\" y=\"100.588235\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,291.971934,100.588235)\">36</text>\n",
" <text x=\"193.294118\" y=\"115.294118\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,193.294118,115.294118)\">72</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"dask.array<rechunk-merge, shape=(34, 59, 72, 36, 3), dtype=float64, chunksize=(34, 59, 72, 36, 1), chunktype=numpy.ndarray>"
]
},
"execution_count": 61,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"uhind.data"
]
},
{
"cell_type": "code",
"execution_count": 62,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 202 ms, sys: 38 ms, total: 240 ms\n",
"Wall time: 259 ms\n"
]
}
],
"source": [
"%time us = compute_hindcast(uhind,obs,**kw)"
]
},
{
"cell_type": "code",
"execution_count": 63,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 62.21 kB </td> <td> 20.74 kB </td></tr>\n",
" <tr><th> Shape </th><td> (3, 72, 36) </td> <td> (1, 72, 36) </td></tr>\n",
" <tr><th> Count </th><td> 351 Tasks </td><td> 3 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"139\" height=\"189\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"29\" y2=\"19\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"120\" x2=\"29\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"120\" style=\"stroke-width:2\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"16\" y2=\"126\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"23\" y2=\"133\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"29\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.000000,0.000000 29.637470,19.637470 29.637470,139.637470 10.000000,120.000000\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"70\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"76\" y2=\"6\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"83\" y2=\"13\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"89\" y2=\"19\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"29\" y2=\"19\" style=\"stroke-width:2\" />\n",
" <line x1=\"70\" y1=\"0\" x2=\"89\" y2=\"19\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.000000,0.000000 70.000000,0.000000 89.637470,19.637470 29.637470,19.637470\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"29\" y1=\"19\" x2=\"89\" y2=\"19\" style=\"stroke-width:2\" />\n",
" <line x1=\"29\" y1=\"139\" x2=\"89\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"29\" y1=\"19\" x2=\"29\" y2=\"139\" style=\"stroke-width:2\" />\n",
" <line x1=\"89\" y1=\"19\" x2=\"89\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"29.637470,19.637470 89.637470,19.637470 89.637470,139.637470 29.637470,139.637470\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"59.637470\" y=\"159.637470\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >36</text>\n",
" <text x=\"109.637470\" y=\"79.637470\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,109.637470,79.637470)\">72</text>\n",
" <text x=\"9.818735\" y=\"149.818735\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,9.818735,149.818735)\">3</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"dask.array<concatenate, shape=(3, 72, 36), dtype=float64, chunksize=(1, 72, 36), chunktype=numpy.ndarray>"
]
},
"execution_count": 63,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"us.data"
]
},
{
"cell_type": "code",
"execution_count": 64,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 868 ms, sys: 215 ms, total: 1.08 s\n",
"Wall time: 978 ms\n"
]
}
],
"source": [
"%time usc = us.compute()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### resample first then skill for all\n",
"step by step"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### init"
]
},
{
"cell_type": "code",
"execution_count": 65,
"metadata": {},
"outputs": [],
"source": [
"bootstrap = 128"
]
},
{
"cell_type": "code",
"execution_count": 66,
"metadata": {},
"outputs": [],
"source": [
"def _resample(hind, shuffle_dim, to_be_shuffled):\n",
" \"\"\"Resample with replacement in dimension `shuffle_dim` from values of\n",
" `to_be_shuffled`\n",
"\n",
" Args:\n",
" hind (xr.object): input xr.object to be shuffled.\n",
" shuffle_dim (str): dimension to shuffle along.\n",
" to_be_shuffled (list, xr.DataArray.values, np.ndarray): values to shuffle from.\n",
"\n",
" Returns:\n",
" xr.object: shuffled along `shuffle_dim`.\n",
"\n",
" \"\"\"\n",
" smp = np.random.choice(to_be_shuffled, len(to_be_shuffled))\n",
" smp_hind = hind.sel({shuffle_dim: smp})\n",
" # ignore because then inits should keep their labels\n",
" if shuffle_dim != \"init\":\n",
" smp_hind[shuffle_dim] = np.arange(1, 1 + smp_hind[shuffle_dim].size)\n",
" return smp_hind"
]
},
{
"cell_type": "code",
"execution_count": 67,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 526 ms, sys: 26 ms, total: 552 ms\n",
"Wall time: 513 ms\n"
]
}
],
"source": [
"%%time\n",
"huge_hind = xr.concat(\n",
" [_resample(hind, \"member\", hind.member) for _ in range(bootstrap)], \"bootstrap\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 68,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 15.97 GB </td> <td> 41.60 MB </td></tr>\n",
" <tr><th> Shape </th><td> (128, 34, 59, 72, 36, 3) </td> <td> (1, 34, 59, 72, 36, 1) </td></tr>\n",
" <tr><th> Count </th><td> 1155 Tasks </td><td> 384 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"529\" height=\"163\" 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=\"43\" x2=\"80\" y2=\"113\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"43\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"43\" />\n",
" <line x1=\"11\" y1=\"1\" x2=\"11\" y2=\"44\" />\n",
" <line x1=\"11\" y1=\"1\" x2=\"11\" y2=\"44\" />\n",
" <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"45\" />\n",
" <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"45\" />\n",
" <line x1=\"13\" y1=\"3\" x2=\"13\" y2=\"46\" />\n",
" <line x1=\"13\" y1=\"3\" x2=\"13\" y2=\"46\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"47\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"48\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"15\" y2=\"48\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"16\" y2=\"49\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"16\" y2=\"49\" />\n",
" <line x1=\"17\" y1=\"7\" x2=\"17\" y2=\"50\" />\n",
" <line x1=\"17\" y1=\"7\" x2=\"17\" y2=\"50\" />\n",
" <line x1=\"18\" y1=\"8\" x2=\"18\" y2=\"51\" />\n",
" <line x1=\"18\" y1=\"8\" x2=\"18\" y2=\"51\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"52\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"53\" />\n",
" <line x1=\"20\" y1=\"10\" x2=\"20\" y2=\"53\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"54\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"54\" />\n",
" <line x1=\"22\" y1=\"12\" x2=\"22\" y2=\"55\" />\n",
" <line x1=\"22\" y1=\"12\" x2=\"22\" y2=\"55\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"23\" y2=\"56\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"23\" y2=\"56\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"57\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"58\" />\n",
" <line x1=\"25\" y1=\"15\" x2=\"25\" y2=\"58\" />\n",
" <line x1=\"25\" y1=\"15\" x2=\"25\" y2=\"59\" />\n",
" <line x1=\"26\" y1=\"16\" x2=\"26\" y2=\"59\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"60\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"60\" />\n",
" <line x1=\"28\" y1=\"18\" x2=\"28\" y2=\"61\" />\n",
" <line x1=\"28\" y1=\"18\" x2=\"28\" y2=\"61\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"29\" y2=\"62\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"29\" y2=\"62\" />\n",
" <line x1=\"30\" y1=\"20\" x2=\"30\" y2=\"63\" />\n",
" <line x1=\"30\" y1=\"20\" x2=\"30\" y2=\"64\" />\n",
" <line x1=\"31\" y1=\"21\" x2=\"31\" y2=\"64\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"65\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"65\" />\n",
" <line x1=\"33\" y1=\"23\" x2=\"33\" y2=\"66\" />\n",
" <line x1=\"33\" y1=\"23\" x2=\"33\" y2=\"66\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"34\" y2=\"67\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"34\" y2=\"67\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"68\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"69\" />\n",
" <line x1=\"36\" y1=\"26\" x2=\"36\" y2=\"69\" />\n",
" <line x1=\"37\" y1=\"27\" x2=\"37\" y2=\"70\" />\n",
" <line x1=\"37\" y1=\"27\" x2=\"37\" y2=\"70\" />\n",
" <line x1=\"38\" y1=\"28\" x2=\"38\" y2=\"71\" />\n",
" <line x1=\"38\" y1=\"28\" x2=\"38\" y2=\"71\" />\n",
" <line x1=\"39\" y1=\"29\" x2=\"39\" y2=\"72\" />\n",
" <line x1=\"39\" y1=\"29\" x2=\"39\" y2=\"72\" />\n",
" <line x1=\"40\" y1=\"30\" x2=\"40\" y2=\"73\" />\n",
" <line x1=\"40\" y1=\"30\" x2=\"40\" y2=\"74\" />\n",
" <line x1=\"41\" y1=\"31\" x2=\"41\" y2=\"74\" />\n",
" <line x1=\"41\" y1=\"31\" x2=\"41\" y2=\"75\" />\n",
" <line x1=\"42\" y1=\"32\" x2=\"42\" y2=\"75\" />\n",
" <line x1=\"43\" y1=\"33\" x2=\"43\" y2=\"76\" />\n",
" <line x1=\"43\" y1=\"33\" x2=\"43\" y2=\"76\" />\n",
" <line x1=\"44\" y1=\"34\" x2=\"44\" y2=\"77\" />\n",
" <line x1=\"44\" y1=\"34\" x2=\"44\" y2=\"77\" />\n",
" <line x1=\"45\" y1=\"35\" x2=\"45\" y2=\"78\" />\n",
" <line x1=\"45\" y1=\"35\" x2=\"45\" y2=\"78\" />\n",
" <line x1=\"46\" y1=\"36\" x2=\"46\" y2=\"79\" />\n",
" <line x1=\"46\" y1=\"36\" x2=\"46\" y2=\"80\" />\n",
" <line x1=\"47\" y1=\"37\" x2=\"47\" y2=\"80\" />\n",
" <line x1=\"48\" y1=\"38\" x2=\"48\" y2=\"81\" />\n",
" <line x1=\"48\" y1=\"38\" x2=\"48\" y2=\"81\" />\n",
" <line x1=\"49\" y1=\"39\" x2=\"49\" y2=\"82\" />\n",
" <line x1=\"49\" y1=\"39\" x2=\"49\" y2=\"82\" />\n",
" <line x1=\"50\" y1=\"40\" x2=\"50\" y2=\"83\" />\n",
" <line x1=\"50\" y1=\"40\" x2=\"50\" y2=\"83\" />\n",
" <line x1=\"51\" y1=\"41\" x2=\"51\" y2=\"84\" />\n",
" <line x1=\"51\" y1=\"41\" x2=\"51\" y2=\"85\" />\n",
" <line x1=\"52\" y1=\"42\" x2=\"52\" y2=\"85\" />\n",
" <line x1=\"53\" y1=\"43\" x2=\"53\" y2=\"86\" />\n",
" <line x1=\"53\" y1=\"43\" x2=\"53\" y2=\"86\" />\n",
" <line x1=\"54\" y1=\"44\" x2=\"54\" y2=\"87\" />\n",
" <line x1=\"54\" y1=\"44\" x2=\"54\" y2=\"87\" />\n",
" <line x1=\"55\" y1=\"45\" x2=\"55\" y2=\"88\" />\n",
" <line x1=\"55\" y1=\"45\" x2=\"55\" y2=\"88\" />\n",
" <line x1=\"56\" y1=\"46\" x2=\"56\" y2=\"89\" />\n",
" <line x1=\"56\" y1=\"46\" x2=\"56\" y2=\"89\" />\n",
" <line x1=\"57\" y1=\"47\" x2=\"57\" y2=\"90\" />\n",
" <line x1=\"57\" y1=\"47\" x2=\"57\" y2=\"91\" />\n",
" <line x1=\"58\" y1=\"48\" x2=\"58\" y2=\"91\" />\n",
" <line x1=\"59\" y1=\"49\" x2=\"59\" y2=\"92\" />\n",
" <line x1=\"59\" y1=\"49\" x2=\"59\" y2=\"92\" />\n",
" <line x1=\"60\" y1=\"50\" x2=\"60\" y2=\"93\" />\n",
" <line x1=\"60\" y1=\"50\" x2=\"60\" y2=\"93\" />\n",
" <line x1=\"61\" y1=\"51\" x2=\"61\" y2=\"94\" />\n",
" <line x1=\"61\" y1=\"51\" x2=\"61\" y2=\"94\" />\n",
" <line x1=\"62\" y1=\"52\" x2=\"62\" y2=\"95\" />\n",
" <line x1=\"62\" y1=\"52\" x2=\"62\" y2=\"96\" />\n",
" <line x1=\"63\" y1=\"53\" x2=\"63\" y2=\"96\" />\n",
" <line x1=\"64\" y1=\"54\" x2=\"64\" y2=\"97\" />\n",
" <line x1=\"64\" y1=\"54\" x2=\"64\" y2=\"97\" />\n",
" <line x1=\"65\" y1=\"55\" x2=\"65\" y2=\"98\" />\n",
" <line x1=\"65\" y1=\"55\" x2=\"65\" y2=\"98\" />\n",
" <line x1=\"66\" y1=\"56\" x2=\"66\" y2=\"99\" />\n",
" <line x1=\"66\" y1=\"56\" x2=\"66\" y2=\"99\" />\n",
" <line x1=\"67\" y1=\"57\" x2=\"67\" y2=\"100\" />\n",
" <line x1=\"67\" y1=\"57\" x2=\"67\" y2=\"101\" />\n",
" <line x1=\"68\" y1=\"58\" x2=\"68\" y2=\"101\" />\n",
" <line x1=\"69\" y1=\"59\" x2=\"69\" y2=\"102\" />\n",
" <line x1=\"69\" y1=\"59\" x2=\"69\" y2=\"102\" />\n",
" <line x1=\"70\" y1=\"60\" x2=\"70\" y2=\"103\" />\n",
" <line x1=\"70\" y1=\"60\" x2=\"70\" y2=\"103\" />\n",
" <line x1=\"71\" y1=\"61\" x2=\"71\" y2=\"104\" />\n",
" <line x1=\"71\" y1=\"61\" x2=\"71\" y2=\"104\" />\n",
" <line x1=\"72\" y1=\"62\" x2=\"72\" y2=\"105\" />\n",
" <line x1=\"72\" y1=\"62\" x2=\"72\" y2=\"105\" />\n",
" <line x1=\"73\" y1=\"63\" x2=\"73\" y2=\"106\" />\n",
" <line x1=\"73\" y1=\"63\" x2=\"73\" y2=\"107\" />\n",
" <line x1=\"74\" y1=\"64\" x2=\"74\" y2=\"107\" />\n",
" <line x1=\"75\" y1=\"65\" x2=\"75\" y2=\"108\" />\n",
" <line x1=\"75\" y1=\"65\" x2=\"75\" y2=\"108\" />\n",
" <line x1=\"76\" y1=\"66\" x2=\"76\" y2=\"109\" />\n",
" <line x1=\"76\" y1=\"66\" x2=\"76\" y2=\"109\" />\n",
" <line x1=\"77\" y1=\"67\" x2=\"77\" y2=\"110\" />\n",
" <line x1=\"77\" y1=\"67\" x2=\"77\" y2=\"110\" />\n",
" <line x1=\"78\" y1=\"68\" x2=\"78\" y2=\"111\" />\n",
" <line x1=\"78\" y1=\"68\" x2=\"78\" y2=\"112\" />\n",
" <line x1=\"79\" y1=\"69\" x2=\"79\" y2=\"112\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"113\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"113\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.000000,0.000000 80.588235,70.588235 80.588235,113.709802 10.000000,43.121567\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"65\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"0\" x2=\"65\" y2=\"0\" />\n",
" <line x1=\"11\" y1=\"1\" x2=\"66\" y2=\"1\" />\n",
" <line x1=\"11\" y1=\"1\" x2=\"66\" y2=\"1\" />\n",
" <line x1=\"12\" y1=\"2\" x2=\"67\" y2=\"2\" />\n",
" <line x1=\"12\" y1=\"2\" x2=\"68\" y2=\"2\" />\n",
" <line x1=\"13\" y1=\"3\" x2=\"68\" y2=\"3\" />\n",
" <line x1=\"13\" y1=\"3\" x2=\"69\" y2=\"3\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"69\" y2=\"4\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"70\" y2=\"4\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"70\" y2=\"5\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"71\" y2=\"6\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"71\" y2=\"6\" />\n",
" <line x1=\"17\" y1=\"7\" x2=\"72\" y2=\"7\" />\n",
" <line x1=\"17\" y1=\"7\" x2=\"73\" y2=\"7\" />\n",
" <line x1=\"18\" y1=\"8\" x2=\"73\" y2=\"8\" />\n",
" <line x1=\"18\" y1=\"8\" x2=\"74\" y2=\"8\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"74\" y2=\"9\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"75\" y2=\"9\" />\n",
" <line x1=\"20\" y1=\"10\" x2=\"75\" y2=\"10\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"76\" y2=\"11\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"76\" y2=\"11\" />\n",
" <line x1=\"22\" y1=\"12\" x2=\"77\" y2=\"12\" />\n",
" <line x1=\"22\" y1=\"12\" x2=\"77\" y2=\"12\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"78\" y2=\"13\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"79\" y2=\"13\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"79\" y2=\"14\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"80\" y2=\"14\" />\n",
" <line x1=\"25\" y1=\"15\" x2=\"80\" y2=\"15\" />\n",
" <line x1=\"25\" y1=\"15\" x2=\"81\" y2=\"15\" />\n",
" <line x1=\"26\" y1=\"16\" x2=\"81\" y2=\"16\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"82\" y2=\"17\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"82\" y2=\"17\" />\n",
" <line x1=\"28\" y1=\"18\" x2=\"83\" y2=\"18\" />\n",
" <line x1=\"28\" y1=\"18\" x2=\"84\" y2=\"18\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"84\" y2=\"19\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"85\" y2=\"19\" />\n",
" <line x1=\"30\" y1=\"20\" x2=\"85\" y2=\"20\" />\n",
" <line x1=\"30\" y1=\"20\" x2=\"86\" y2=\"20\" />\n",
" <line x1=\"31\" y1=\"21\" x2=\"86\" y2=\"21\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"87\" y2=\"22\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"87\" y2=\"22\" />\n",
" <line x1=\"33\" y1=\"23\" x2=\"88\" y2=\"23\" />\n",
" <line x1=\"33\" y1=\"23\" x2=\"89\" y2=\"23\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"89\" y2=\"24\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"90\" y2=\"24\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"90\" y2=\"25\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"91\" y2=\"25\" />\n",
" <line x1=\"36\" y1=\"26\" x2=\"91\" y2=\"26\" />\n",
" <line x1=\"37\" y1=\"27\" x2=\"92\" y2=\"27\" />\n",
" <line x1=\"37\" y1=\"27\" x2=\"92\" y2=\"27\" />\n",
" <line x1=\"38\" y1=\"28\" x2=\"93\" y2=\"28\" />\n",
" <line x1=\"38\" y1=\"28\" x2=\"93\" y2=\"28\" />\n",
" <line x1=\"39\" y1=\"29\" x2=\"94\" y2=\"29\" />\n",
" <line x1=\"39\" y1=\"29\" x2=\"95\" y2=\"29\" />\n",
" <line x1=\"40\" y1=\"30\" x2=\"95\" y2=\"30\" />\n",
" <line x1=\"40\" y1=\"30\" x2=\"96\" y2=\"30\" />\n",
" <line x1=\"41\" y1=\"31\" x2=\"96\" y2=\"31\" />\n",
" <line x1=\"41\" y1=\"31\" x2=\"97\" y2=\"31\" />\n",
" <line x1=\"42\" y1=\"32\" x2=\"97\" y2=\"32\" />\n",
" <line x1=\"43\" y1=\"33\" x2=\"98\" y2=\"33\" />\n",
" <line x1=\"43\" y1=\"33\" x2=\"98\" y2=\"33\" />\n",
" <line x1=\"44\" y1=\"34\" x2=\"99\" y2=\"34\" />\n",
" <line x1=\"44\" y1=\"34\" x2=\"100\" y2=\"34\" />\n",
" <line x1=\"45\" y1=\"35\" x2=\"100\" y2=\"35\" />\n",
" <line x1=\"45\" y1=\"35\" x2=\"101\" y2=\"35\" />\n",
" <line x1=\"46\" y1=\"36\" x2=\"101\" y2=\"36\" />\n",
" <line x1=\"46\" y1=\"36\" x2=\"102\" y2=\"36\" />\n",
" <line x1=\"47\" y1=\"37\" x2=\"102\" y2=\"37\" />\n",
" <line x1=\"48\" y1=\"38\" x2=\"103\" y2=\"38\" />\n",
" <line x1=\"48\" y1=\"38\" x2=\"103\" y2=\"38\" />\n",
" <line x1=\"49\" y1=\"39\" x2=\"104\" y2=\"39\" />\n",
" <line x1=\"49\" y1=\"39\" x2=\"105\" y2=\"39\" />\n",
" <line x1=\"50\" y1=\"40\" x2=\"105\" y2=\"40\" />\n",
" <line x1=\"50\" y1=\"40\" x2=\"106\" y2=\"40\" />\n",
" <line x1=\"51\" y1=\"41\" x2=\"106\" y2=\"41\" />\n",
" <line x1=\"51\" y1=\"41\" x2=\"107\" y2=\"41\" />\n",
" <line x1=\"52\" y1=\"42\" x2=\"107\" y2=\"42\" />\n",
" <line x1=\"53\" y1=\"43\" x2=\"108\" y2=\"43\" />\n",
" <line x1=\"53\" y1=\"43\" x2=\"108\" y2=\"43\" />\n",
" <line x1=\"54\" y1=\"44\" x2=\"109\" y2=\"44\" />\n",
" <line x1=\"54\" y1=\"44\" x2=\"109\" y2=\"44\" />\n",
" <line x1=\"55\" y1=\"45\" x2=\"110\" y2=\"45\" />\n",
" <line x1=\"55\" y1=\"45\" x2=\"111\" y2=\"45\" />\n",
" <line x1=\"56\" y1=\"46\" x2=\"111\" y2=\"46\" />\n",
" <line x1=\"56\" y1=\"46\" x2=\"112\" y2=\"46\" />\n",
" <line x1=\"57\" y1=\"47\" x2=\"112\" y2=\"47\" />\n",
" <line x1=\"57\" y1=\"47\" x2=\"113\" y2=\"47\" />\n",
" <line x1=\"58\" y1=\"48\" x2=\"113\" y2=\"48\" />\n",
" <line x1=\"59\" y1=\"49\" x2=\"114\" y2=\"49\" />\n",
" <line x1=\"59\" y1=\"49\" x2=\"114\" y2=\"49\" />\n",
" <line x1=\"60\" y1=\"50\" x2=\"115\" y2=\"50\" />\n",
" <line x1=\"60\" y1=\"50\" x2=\"116\" y2=\"50\" />\n",
" <line x1=\"61\" y1=\"51\" x2=\"116\" y2=\"51\" />\n",
" <line x1=\"61\" y1=\"51\" x2=\"117\" y2=\"51\" />\n",
" <line x1=\"62\" y1=\"52\" x2=\"117\" y2=\"52\" />\n",
" <line x1=\"62\" y1=\"52\" x2=\"118\" y2=\"52\" />\n",
" <line x1=\"63\" y1=\"53\" x2=\"118\" y2=\"53\" />\n",
" <line x1=\"64\" y1=\"54\" x2=\"119\" y2=\"54\" />\n",
" <line x1=\"64\" y1=\"54\" x2=\"119\" y2=\"54\" />\n",
" <line x1=\"65\" y1=\"55\" x2=\"120\" y2=\"55\" />\n",
" <line x1=\"65\" y1=\"55\" x2=\"121\" y2=\"55\" />\n",
" <line x1=\"66\" y1=\"56\" x2=\"121\" y2=\"56\" />\n",
" <line x1=\"66\" y1=\"56\" x2=\"122\" y2=\"56\" />\n",
" <line x1=\"67\" y1=\"57\" x2=\"122\" y2=\"57\" />\n",
" <line x1=\"67\" y1=\"57\" x2=\"123\" y2=\"57\" />\n",
" <line x1=\"68\" y1=\"58\" x2=\"123\" y2=\"58\" />\n",
" <line x1=\"69\" y1=\"59\" x2=\"124\" y2=\"59\" />\n",
" <line x1=\"69\" y1=\"59\" x2=\"124\" y2=\"59\" />\n",
" <line x1=\"70\" y1=\"60\" x2=\"125\" y2=\"60\" />\n",
" <line x1=\"70\" y1=\"60\" x2=\"125\" y2=\"60\" />\n",
" <line x1=\"71\" y1=\"61\" x2=\"126\" y2=\"61\" />\n",
" <line x1=\"71\" y1=\"61\" x2=\"127\" y2=\"61\" />\n",
" <line x1=\"72\" y1=\"62\" x2=\"127\" y2=\"62\" />\n",
" <line x1=\"72\" y1=\"62\" x2=\"128\" y2=\"62\" />\n",
" <line x1=\"73\" y1=\"63\" x2=\"128\" y2=\"63\" />\n",
" <line x1=\"73\" y1=\"63\" x2=\"129\" y2=\"63\" />\n",
" <line x1=\"74\" y1=\"64\" x2=\"129\" y2=\"64\" />\n",
" <line x1=\"75\" y1=\"65\" x2=\"130\" y2=\"65\" />\n",
" <line x1=\"75\" y1=\"65\" x2=\"130\" y2=\"65\" />\n",
" <line x1=\"76\" y1=\"66\" x2=\"131\" y2=\"66\" />\n",
" <line x1=\"76\" y1=\"66\" x2=\"132\" y2=\"66\" />\n",
" <line x1=\"77\" y1=\"67\" x2=\"132\" y2=\"67\" />\n",
" <line x1=\"77\" y1=\"67\" x2=\"133\" y2=\"67\" />\n",
" <line x1=\"78\" y1=\"68\" x2=\"133\" y2=\"68\" />\n",
" <line x1=\"78\" y1=\"68\" x2=\"134\" y2=\"68\" />\n",
" <line x1=\"79\" y1=\"69\" x2=\"134\" y2=\"69\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"135\" y2=\"70\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"135\" 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=\"65\" y1=\"0\" x2=\"135\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.000000,0.000000 65.312500,0.000000 135.900735,70.588235 80.588235,70.588235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"80\" y1=\"70\" x2=\"135\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"80\" y1=\"113\" x2=\"135\" y2=\"113\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"113\" style=\"stroke-width:2\" />\n",
" <line x1=\"135\" y1=\"70\" x2=\"135\" y2=\"113\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"80.588235,70.588235 135.900735,70.588235 135.900735,113.709802 80.588235,113.709802\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"108.244485\" y=\"133.709802\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >59</text>\n",
" <text x=\"155.900735\" y=\"92.149019\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,155.900735,92.149019)\">34</text>\n",
" <text x=\"35.294118\" y=\"98.415685\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,98.415685)\">128</text>\n",
"\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"205\" y1=\"0\" x2=\"244\" y2=\"39\" style=\"stroke-width:2\" />\n",
" <line x1=\"205\" y1=\"43\" x2=\"244\" y2=\"83\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"205\" y1=\"0\" x2=\"205\" y2=\"43\" style=\"stroke-width:2\" />\n",
" <line x1=\"244\" y1=\"39\" x2=\"244\" y2=\"83\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"205.000000,0.000000 244.705882,39.705882 244.705882,83.030199 205.000000,43.324317\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"205\" y1=\"0\" x2=\"234\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"244\" y1=\"39\" x2=\"274\" y2=\"39\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"205\" y1=\"0\" x2=\"244\" y2=\"39\" style=\"stroke-width:2\" />\n",
" <line x1=\"214\" y1=\"0\" x2=\"254\" y2=\"39\" />\n",
" <line x1=\"224\" y1=\"0\" x2=\"264\" y2=\"39\" />\n",
" <line x1=\"234\" y1=\"0\" x2=\"274\" y2=\"39\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"205.000000,0.000000 234.936052,0.000000 274.641935,39.705882 244.705882,39.705882\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"244\" y1=\"39\" x2=\"274\" y2=\"39\" style=\"stroke-width:2\" />\n",
" <line x1=\"244\" y1=\"83\" x2=\"274\" y2=\"83\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"244\" y1=\"39\" x2=\"244\" y2=\"83\" style=\"stroke-width:2\" />\n",
" <line x1=\"254\" y1=\"39\" x2=\"254\" y2=\"83\" />\n",
" <line x1=\"264\" y1=\"39\" x2=\"264\" y2=\"83\" />\n",
" <line x1=\"274\" y1=\"39\" x2=\"274\" y2=\"83\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"244.705882,39.705882 274.641935,39.705882 274.641935,83.030199 244.705882,83.030199\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"259.673909\" y=\"103.030199\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >3</text>\n",
" <text x=\"294.641935\" y=\"61.368041\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,294.641935,61.368041)\">36</text>\n",
" <text x=\"214.852941\" y=\"83.177258\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,214.852941,83.177258)\">72</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"dask.array<concatenate, shape=(128, 34, 59, 72, 36, 3), dtype=float64, chunksize=(1, 34, 59, 72, 36, 1), chunktype=numpy.ndarray>"
]
},
"execution_count": 68,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"huge_hind.data"
]
},
{
"cell_type": "code",
"execution_count": 69,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 198 ms, sys: 53 ms, total: 251 ms\n",
"Wall time: 194 ms\n"
]
}
],
"source": [
"%time huge_skill = compute_hindcast(huge_hind, obs, **kw)"
]
},
{
"cell_type": "code",
"execution_count": 70,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 7.96 MB </td> <td> 20.74 kB </td></tr>\n",
" <tr><th> Shape </th><td> (3, 128, 72, 36) </td> <td> (1, 1, 72, 36) </td></tr>\n",
" <tr><th> Count </th><td> 5648 Tasks </td><td> 384 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"361\" height=\"188\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"29\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"25\" x2=\"29\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"9\" y1=\"0\" x2=\"9\" y2=\"25\" />\n",
" <line x1=\"19\" y1=\"0\" x2=\"19\" y2=\"25\" />\n",
" <line x1=\"29\" y1=\"0\" x2=\"29\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"0.000000,0.000000 29.936052,0.000000 29.936052,25.412617 0.000000,25.412617\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"14.968026\" y=\"45.412617\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >3</text>\n",
" <text x=\"49.936052\" y=\"12.706308\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,49.936052,12.706308)\">1</text>\n",
"\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"99\" y1=\"0\" x2=\"169\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"99\" y1=\"67\" x2=\"169\" y2=\"138\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"99\" y1=\"0\" x2=\"99\" y2=\"67\" style=\"stroke-width:2\" />\n",
" <line x1=\"99\" y1=\"0\" x2=\"99\" y2=\"68\" />\n",
" <line x1=\"100\" y1=\"1\" x2=\"100\" y2=\"68\" />\n",
" <line x1=\"100\" y1=\"1\" x2=\"100\" y2=\"69\" />\n",
" <line x1=\"101\" y1=\"2\" x2=\"101\" y2=\"69\" />\n",
" <line x1=\"101\" y1=\"2\" x2=\"101\" y2=\"70\" />\n",
" <line x1=\"102\" y1=\"3\" x2=\"102\" y2=\"70\" />\n",
" <line x1=\"102\" y1=\"3\" x2=\"102\" y2=\"71\" />\n",
" <line x1=\"103\" y1=\"4\" x2=\"103\" y2=\"71\" />\n",
" <line x1=\"103\" y1=\"4\" x2=\"103\" y2=\"72\" />\n",
" <line x1=\"104\" y1=\"5\" x2=\"104\" y2=\"73\" />\n",
" <line x1=\"105\" y1=\"6\" x2=\"105\" y2=\"73\" />\n",
" <line x1=\"105\" y1=\"6\" x2=\"105\" y2=\"74\" />\n",
" <line x1=\"106\" y1=\"7\" x2=\"106\" y2=\"74\" />\n",
" <line x1=\"106\" y1=\"7\" x2=\"106\" y2=\"75\" />\n",
" <line x1=\"107\" y1=\"8\" x2=\"107\" y2=\"75\" />\n",
" <line x1=\"107\" y1=\"8\" x2=\"107\" y2=\"76\" />\n",
" <line x1=\"108\" y1=\"9\" x2=\"108\" y2=\"76\" />\n",
" <line x1=\"108\" y1=\"9\" x2=\"108\" y2=\"77\" />\n",
" <line x1=\"109\" y1=\"10\" x2=\"109\" y2=\"77\" />\n",
" <line x1=\"110\" y1=\"11\" x2=\"110\" y2=\"78\" />\n",
" <line x1=\"110\" y1=\"11\" x2=\"110\" y2=\"79\" />\n",
" <line x1=\"111\" y1=\"12\" x2=\"111\" y2=\"79\" />\n",
" <line x1=\"111\" y1=\"12\" x2=\"111\" y2=\"80\" />\n",
" <line x1=\"112\" y1=\"13\" x2=\"112\" y2=\"80\" />\n",
" <line x1=\"112\" y1=\"13\" x2=\"112\" y2=\"81\" />\n",
" <line x1=\"113\" y1=\"14\" x2=\"113\" y2=\"81\" />\n",
" <line x1=\"113\" y1=\"14\" x2=\"113\" y2=\"82\" />\n",
" <line x1=\"114\" y1=\"15\" x2=\"114\" y2=\"82\" />\n",
" <line x1=\"114\" y1=\"15\" x2=\"114\" y2=\"83\" />\n",
" <line x1=\"115\" y1=\"16\" x2=\"115\" y2=\"84\" />\n",
" <line x1=\"116\" y1=\"17\" x2=\"116\" y2=\"84\" />\n",
" <line x1=\"116\" y1=\"17\" x2=\"116\" y2=\"85\" />\n",
" <line x1=\"117\" y1=\"18\" x2=\"117\" y2=\"85\" />\n",
" <line x1=\"117\" y1=\"18\" x2=\"117\" y2=\"86\" />\n",
" <line x1=\"118\" y1=\"19\" x2=\"118\" y2=\"86\" />\n",
" <line x1=\"118\" y1=\"19\" x2=\"118\" y2=\"87\" />\n",
" <line x1=\"119\" y1=\"20\" x2=\"119\" y2=\"87\" />\n",
" <line x1=\"119\" y1=\"20\" x2=\"119\" y2=\"88\" />\n",
" <line x1=\"120\" y1=\"21\" x2=\"120\" y2=\"89\" />\n",
" <line x1=\"121\" y1=\"22\" x2=\"121\" y2=\"89\" />\n",
" <line x1=\"121\" y1=\"22\" x2=\"121\" y2=\"90\" />\n",
" <line x1=\"122\" y1=\"23\" x2=\"122\" y2=\"90\" />\n",
" <line x1=\"122\" y1=\"23\" x2=\"122\" y2=\"91\" />\n",
" <line x1=\"123\" y1=\"24\" x2=\"123\" y2=\"91\" />\n",
" <line x1=\"123\" y1=\"24\" x2=\"123\" y2=\"92\" />\n",
" <line x1=\"124\" y1=\"25\" x2=\"124\" y2=\"92\" />\n",
" <line x1=\"124\" y1=\"25\" x2=\"124\" y2=\"93\" />\n",
" <line x1=\"125\" y1=\"26\" x2=\"125\" y2=\"93\" />\n",
" <line x1=\"126\" y1=\"27\" x2=\"126\" y2=\"94\" />\n",
" <line x1=\"126\" y1=\"27\" x2=\"126\" y2=\"95\" />\n",
" <line x1=\"127\" y1=\"28\" x2=\"127\" y2=\"95\" />\n",
" <line x1=\"127\" y1=\"28\" x2=\"127\" y2=\"96\" />\n",
" <line x1=\"128\" y1=\"29\" x2=\"128\" y2=\"96\" />\n",
" <line x1=\"128\" y1=\"29\" x2=\"128\" y2=\"97\" />\n",
" <line x1=\"129\" y1=\"30\" x2=\"129\" y2=\"97\" />\n",
" <line x1=\"129\" y1=\"30\" x2=\"129\" y2=\"98\" />\n",
" <line x1=\"130\" y1=\"31\" x2=\"130\" y2=\"98\" />\n",
" <line x1=\"130\" y1=\"31\" x2=\"130\" y2=\"99\" />\n",
" <line x1=\"131\" y1=\"32\" x2=\"131\" y2=\"100\" />\n",
" <line x1=\"132\" y1=\"33\" x2=\"132\" y2=\"100\" />\n",
" <line x1=\"132\" y1=\"33\" x2=\"132\" y2=\"101\" />\n",
" <line x1=\"133\" y1=\"34\" x2=\"133\" y2=\"101\" />\n",
" <line x1=\"133\" y1=\"34\" x2=\"133\" y2=\"102\" />\n",
" <line x1=\"134\" y1=\"35\" x2=\"134\" y2=\"102\" />\n",
" <line x1=\"134\" y1=\"35\" x2=\"134\" y2=\"103\" />\n",
" <line x1=\"135\" y1=\"36\" x2=\"135\" y2=\"103\" />\n",
" <line x1=\"135\" y1=\"36\" x2=\"135\" y2=\"104\" />\n",
" <line x1=\"136\" y1=\"37\" x2=\"136\" y2=\"105\" />\n",
" <line x1=\"137\" y1=\"38\" x2=\"137\" y2=\"105\" />\n",
" <line x1=\"137\" y1=\"38\" x2=\"137\" y2=\"106\" />\n",
" <line x1=\"138\" y1=\"39\" x2=\"138\" y2=\"106\" />\n",
" <line x1=\"138\" y1=\"39\" x2=\"138\" y2=\"107\" />\n",
" <line x1=\"139\" y1=\"40\" x2=\"139\" y2=\"107\" />\n",
" <line x1=\"139\" y1=\"40\" x2=\"139\" y2=\"108\" />\n",
" <line x1=\"140\" y1=\"41\" x2=\"140\" y2=\"108\" />\n",
" <line x1=\"140\" y1=\"41\" x2=\"140\" y2=\"109\" />\n",
" <line x1=\"141\" y1=\"42\" x2=\"141\" y2=\"109\" />\n",
" <line x1=\"142\" y1=\"43\" x2=\"142\" y2=\"110\" />\n",
" <line x1=\"142\" y1=\"43\" x2=\"142\" y2=\"111\" />\n",
" <line x1=\"143\" y1=\"44\" x2=\"143\" y2=\"111\" />\n",
" <line x1=\"143\" y1=\"44\" x2=\"143\" y2=\"112\" />\n",
" <line x1=\"144\" y1=\"45\" x2=\"144\" y2=\"112\" />\n",
" <line x1=\"144\" y1=\"45\" x2=\"144\" y2=\"113\" />\n",
" <line x1=\"145\" y1=\"46\" x2=\"145\" y2=\"113\" />\n",
" <line x1=\"145\" y1=\"46\" x2=\"145\" y2=\"114\" />\n",
" <line x1=\"146\" y1=\"47\" x2=\"146\" y2=\"114\" />\n",
" <line x1=\"146\" y1=\"47\" x2=\"146\" y2=\"115\" />\n",
" <line x1=\"147\" y1=\"48\" x2=\"147\" y2=\"116\" />\n",
" <line x1=\"148\" y1=\"49\" x2=\"148\" y2=\"116\" />\n",
" <line x1=\"148\" y1=\"49\" x2=\"148\" y2=\"117\" />\n",
" <line x1=\"149\" y1=\"50\" x2=\"149\" y2=\"117\" />\n",
" <line x1=\"149\" y1=\"50\" x2=\"149\" y2=\"118\" />\n",
" <line x1=\"150\" y1=\"51\" x2=\"150\" y2=\"118\" />\n",
" <line x1=\"150\" y1=\"51\" x2=\"150\" y2=\"119\" />\n",
" <line x1=\"151\" y1=\"52\" x2=\"151\" y2=\"119\" />\n",
" <line x1=\"151\" y1=\"52\" x2=\"151\" y2=\"120\" />\n",
" <line x1=\"152\" y1=\"53\" x2=\"152\" y2=\"120\" />\n",
" <line x1=\"153\" y1=\"54\" x2=\"153\" y2=\"121\" />\n",
" <line x1=\"153\" y1=\"54\" x2=\"153\" y2=\"122\" />\n",
" <line x1=\"154\" y1=\"55\" x2=\"154\" y2=\"122\" />\n",
" <line x1=\"154\" y1=\"55\" x2=\"154\" y2=\"123\" />\n",
" <line x1=\"155\" y1=\"56\" x2=\"155\" y2=\"123\" />\n",
" <line x1=\"155\" y1=\"56\" x2=\"155\" y2=\"124\" />\n",
" <line x1=\"156\" y1=\"57\" x2=\"156\" y2=\"124\" />\n",
" <line x1=\"156\" y1=\"57\" x2=\"156\" y2=\"125\" />\n",
" <line x1=\"157\" y1=\"58\" x2=\"157\" y2=\"125\" />\n",
" <line x1=\"158\" y1=\"59\" x2=\"158\" y2=\"126\" />\n",
" <line x1=\"158\" y1=\"59\" x2=\"158\" y2=\"127\" />\n",
" <line x1=\"159\" y1=\"60\" x2=\"159\" y2=\"127\" />\n",
" <line x1=\"159\" y1=\"60\" x2=\"159\" y2=\"128\" />\n",
" <line x1=\"160\" y1=\"61\" x2=\"160\" y2=\"128\" />\n",
" <line x1=\"160\" y1=\"61\" x2=\"160\" y2=\"129\" />\n",
" <line x1=\"161\" y1=\"62\" x2=\"161\" y2=\"129\" />\n",
" <line x1=\"161\" y1=\"62\" x2=\"161\" y2=\"130\" />\n",
" <line x1=\"162\" y1=\"63\" x2=\"162\" y2=\"130\" />\n",
" <line x1=\"162\" y1=\"63\" x2=\"162\" y2=\"131\" />\n",
" <line x1=\"163\" y1=\"64\" x2=\"163\" y2=\"132\" />\n",
" <line x1=\"164\" y1=\"65\" x2=\"164\" y2=\"132\" />\n",
" <line x1=\"164\" y1=\"65\" x2=\"164\" y2=\"133\" />\n",
" <line x1=\"165\" y1=\"66\" x2=\"165\" y2=\"133\" />\n",
" <line x1=\"165\" y1=\"66\" x2=\"165\" y2=\"134\" />\n",
" <line x1=\"166\" y1=\"67\" x2=\"166\" y2=\"134\" />\n",
" <line x1=\"166\" y1=\"67\" x2=\"166\" y2=\"135\" />\n",
" <line x1=\"167\" y1=\"68\" x2=\"167\" y2=\"135\" />\n",
" <line x1=\"167\" y1=\"68\" x2=\"167\" y2=\"136\" />\n",
" <line x1=\"168\" y1=\"69\" x2=\"168\" y2=\"136\" />\n",
" <line x1=\"169\" y1=\"70\" x2=\"169\" y2=\"137\" />\n",
" <line x1=\"169\" y1=\"70\" x2=\"169\" y2=\"138\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"99.000000,0.000000 169.588235,70.588235 169.588235,138.088235 99.000000,67.500000\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"99\" y1=\"0\" x2=\"142\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"99\" y1=\"0\" x2=\"142\" y2=\"0\" />\n",
" <line x1=\"100\" y1=\"1\" x2=\"143\" y2=\"1\" />\n",
" <line x1=\"100\" y1=\"1\" x2=\"143\" y2=\"1\" />\n",
" <line x1=\"101\" y1=\"2\" x2=\"144\" y2=\"2\" />\n",
" <line x1=\"101\" y1=\"2\" x2=\"145\" y2=\"2\" />\n",
" <line x1=\"102\" y1=\"3\" x2=\"145\" y2=\"3\" />\n",
" <line x1=\"102\" y1=\"3\" x2=\"146\" y2=\"3\" />\n",
" <line x1=\"103\" y1=\"4\" x2=\"146\" y2=\"4\" />\n",
" <line x1=\"103\" y1=\"4\" x2=\"147\" y2=\"4\" />\n",
" <line x1=\"104\" y1=\"5\" x2=\"147\" y2=\"5\" />\n",
" <line x1=\"105\" y1=\"6\" x2=\"148\" y2=\"6\" />\n",
" <line x1=\"105\" y1=\"6\" x2=\"148\" y2=\"6\" />\n",
" <line x1=\"106\" y1=\"7\" x2=\"149\" y2=\"7\" />\n",
" <line x1=\"106\" y1=\"7\" x2=\"150\" y2=\"7\" />\n",
" <line x1=\"107\" y1=\"8\" x2=\"150\" y2=\"8\" />\n",
" <line x1=\"107\" y1=\"8\" x2=\"151\" y2=\"8\" />\n",
" <line x1=\"108\" y1=\"9\" x2=\"151\" y2=\"9\" />\n",
" <line x1=\"108\" y1=\"9\" x2=\"152\" y2=\"9\" />\n",
" <line x1=\"109\" y1=\"10\" x2=\"152\" y2=\"10\" />\n",
" <line x1=\"110\" y1=\"11\" x2=\"153\" y2=\"11\" />\n",
" <line x1=\"110\" y1=\"11\" x2=\"153\" y2=\"11\" />\n",
" <line x1=\"111\" y1=\"12\" x2=\"154\" y2=\"12\" />\n",
" <line x1=\"111\" y1=\"12\" x2=\"155\" y2=\"12\" />\n",
" <line x1=\"112\" y1=\"13\" x2=\"155\" y2=\"13\" />\n",
" <line x1=\"112\" y1=\"13\" x2=\"156\" y2=\"13\" />\n",
" <line x1=\"113\" y1=\"14\" x2=\"156\" y2=\"14\" />\n",
" <line x1=\"113\" y1=\"14\" x2=\"157\" y2=\"14\" />\n",
" <line x1=\"114\" y1=\"15\" x2=\"157\" y2=\"15\" />\n",
" <line x1=\"114\" y1=\"15\" x2=\"158\" y2=\"15\" />\n",
" <line x1=\"115\" y1=\"16\" x2=\"158\" y2=\"16\" />\n",
" <line x1=\"116\" y1=\"17\" x2=\"159\" y2=\"17\" />\n",
" <line x1=\"116\" y1=\"17\" x2=\"159\" y2=\"17\" />\n",
" <line x1=\"117\" y1=\"18\" x2=\"160\" y2=\"18\" />\n",
" <line x1=\"117\" y1=\"18\" x2=\"161\" y2=\"18\" />\n",
" <line x1=\"118\" y1=\"19\" x2=\"161\" y2=\"19\" />\n",
" <line x1=\"118\" y1=\"19\" x2=\"162\" y2=\"19\" />\n",
" <line x1=\"119\" y1=\"20\" x2=\"162\" y2=\"20\" />\n",
" <line x1=\"119\" y1=\"20\" x2=\"163\" y2=\"20\" />\n",
" <line x1=\"120\" y1=\"21\" x2=\"163\" y2=\"21\" />\n",
" <line x1=\"121\" y1=\"22\" x2=\"164\" y2=\"22\" />\n",
" <line x1=\"121\" y1=\"22\" x2=\"164\" y2=\"22\" />\n",
" <line x1=\"122\" y1=\"23\" x2=\"165\" y2=\"23\" />\n",
" <line x1=\"122\" y1=\"23\" x2=\"166\" y2=\"23\" />\n",
" <line x1=\"123\" y1=\"24\" x2=\"166\" y2=\"24\" />\n",
" <line x1=\"123\" y1=\"24\" x2=\"167\" y2=\"24\" />\n",
" <line x1=\"124\" y1=\"25\" x2=\"167\" y2=\"25\" />\n",
" <line x1=\"124\" y1=\"25\" x2=\"168\" y2=\"25\" />\n",
" <line x1=\"125\" y1=\"26\" x2=\"168\" y2=\"26\" />\n",
" <line x1=\"126\" y1=\"27\" x2=\"169\" y2=\"27\" />\n",
" <line x1=\"126\" y1=\"27\" x2=\"169\" y2=\"27\" />\n",
" <line x1=\"127\" y1=\"28\" x2=\"170\" y2=\"28\" />\n",
" <line x1=\"127\" y1=\"28\" x2=\"171\" y2=\"28\" />\n",
" <line x1=\"128\" y1=\"29\" x2=\"171\" y2=\"29\" />\n",
" <line x1=\"128\" y1=\"29\" x2=\"172\" y2=\"29\" />\n",
" <line x1=\"129\" y1=\"30\" x2=\"172\" y2=\"30\" />\n",
" <line x1=\"129\" y1=\"30\" x2=\"173\" y2=\"30\" />\n",
" <line x1=\"130\" y1=\"31\" x2=\"173\" y2=\"31\" />\n",
" <line x1=\"130\" y1=\"31\" x2=\"174\" y2=\"31\" />\n",
" <line x1=\"131\" y1=\"32\" x2=\"174\" y2=\"32\" />\n",
" <line x1=\"132\" y1=\"33\" x2=\"175\" y2=\"33\" />\n",
" <line x1=\"132\" y1=\"33\" x2=\"175\" y2=\"33\" />\n",
" <line x1=\"133\" y1=\"34\" x2=\"176\" y2=\"34\" />\n",
" <line x1=\"133\" y1=\"34\" x2=\"177\" y2=\"34\" />\n",
" <line x1=\"134\" y1=\"35\" x2=\"177\" y2=\"35\" />\n",
" <line x1=\"134\" y1=\"35\" x2=\"178\" y2=\"35\" />\n",
" <line x1=\"135\" y1=\"36\" x2=\"178\" y2=\"36\" />\n",
" <line x1=\"135\" y1=\"36\" x2=\"179\" y2=\"36\" />\n",
" <line x1=\"136\" y1=\"37\" x2=\"179\" y2=\"37\" />\n",
" <line x1=\"137\" y1=\"38\" x2=\"180\" y2=\"38\" />\n",
" <line x1=\"137\" y1=\"38\" x2=\"180\" y2=\"38\" />\n",
" <line x1=\"138\" y1=\"39\" x2=\"181\" y2=\"39\" />\n",
" <line x1=\"138\" y1=\"39\" x2=\"182\" y2=\"39\" />\n",
" <line x1=\"139\" y1=\"40\" x2=\"182\" y2=\"40\" />\n",
" <line x1=\"139\" y1=\"40\" x2=\"183\" y2=\"40\" />\n",
" <line x1=\"140\" y1=\"41\" x2=\"183\" y2=\"41\" />\n",
" <line x1=\"140\" y1=\"41\" x2=\"184\" y2=\"41\" />\n",
" <line x1=\"141\" y1=\"42\" x2=\"184\" y2=\"42\" />\n",
" <line x1=\"142\" y1=\"43\" x2=\"185\" y2=\"43\" />\n",
" <line x1=\"142\" y1=\"43\" x2=\"185\" y2=\"43\" />\n",
" <line x1=\"143\" y1=\"44\" x2=\"186\" y2=\"44\" />\n",
" <line x1=\"143\" y1=\"44\" x2=\"186\" y2=\"44\" />\n",
" <line x1=\"144\" y1=\"45\" x2=\"187\" y2=\"45\" />\n",
" <line x1=\"144\" y1=\"45\" x2=\"188\" y2=\"45\" />\n",
" <line x1=\"145\" y1=\"46\" x2=\"188\" y2=\"46\" />\n",
" <line x1=\"145\" y1=\"46\" x2=\"189\" y2=\"46\" />\n",
" <line x1=\"146\" y1=\"47\" x2=\"189\" y2=\"47\" />\n",
" <line x1=\"146\" y1=\"47\" x2=\"190\" y2=\"47\" />\n",
" <line x1=\"147\" y1=\"48\" x2=\"190\" y2=\"48\" />\n",
" <line x1=\"148\" y1=\"49\" x2=\"191\" y2=\"49\" />\n",
" <line x1=\"148\" y1=\"49\" x2=\"191\" y2=\"49\" />\n",
" <line x1=\"149\" y1=\"50\" x2=\"192\" y2=\"50\" />\n",
" <line x1=\"149\" y1=\"50\" x2=\"193\" y2=\"50\" />\n",
" <line x1=\"150\" y1=\"51\" x2=\"193\" y2=\"51\" />\n",
" <line x1=\"150\" y1=\"51\" x2=\"194\" y2=\"51\" />\n",
" <line x1=\"151\" y1=\"52\" x2=\"194\" y2=\"52\" />\n",
" <line x1=\"151\" y1=\"52\" x2=\"195\" y2=\"52\" />\n",
" <line x1=\"152\" y1=\"53\" x2=\"195\" y2=\"53\" />\n",
" <line x1=\"153\" y1=\"54\" x2=\"196\" y2=\"54\" />\n",
" <line x1=\"153\" y1=\"54\" x2=\"196\" y2=\"54\" />\n",
" <line x1=\"154\" y1=\"55\" x2=\"197\" y2=\"55\" />\n",
" <line x1=\"154\" y1=\"55\" x2=\"198\" y2=\"55\" />\n",
" <line x1=\"155\" y1=\"56\" x2=\"198\" y2=\"56\" />\n",
" <line x1=\"155\" y1=\"56\" x2=\"199\" y2=\"56\" />\n",
" <line x1=\"156\" y1=\"57\" x2=\"199\" y2=\"57\" />\n",
" <line x1=\"156\" y1=\"57\" x2=\"200\" y2=\"57\" />\n",
" <line x1=\"157\" y1=\"58\" x2=\"200\" y2=\"58\" />\n",
" <line x1=\"158\" y1=\"59\" x2=\"201\" y2=\"59\" />\n",
" <line x1=\"158\" y1=\"59\" x2=\"201\" y2=\"59\" />\n",
" <line x1=\"159\" y1=\"60\" x2=\"202\" y2=\"60\" />\n",
" <line x1=\"159\" y1=\"60\" x2=\"202\" y2=\"60\" />\n",
" <line x1=\"160\" y1=\"61\" x2=\"203\" y2=\"61\" />\n",
" <line x1=\"160\" y1=\"61\" x2=\"204\" y2=\"61\" />\n",
" <line x1=\"161\" y1=\"62\" x2=\"204\" y2=\"62\" />\n",
" <line x1=\"161\" y1=\"62\" x2=\"205\" y2=\"62\" />\n",
" <line x1=\"162\" y1=\"63\" x2=\"205\" y2=\"63\" />\n",
" <line x1=\"162\" y1=\"63\" x2=\"206\" y2=\"63\" />\n",
" <line x1=\"163\" y1=\"64\" x2=\"206\" y2=\"64\" />\n",
" <line x1=\"164\" y1=\"65\" x2=\"207\" y2=\"65\" />\n",
" <line x1=\"164\" y1=\"65\" x2=\"207\" y2=\"65\" />\n",
" <line x1=\"165\" y1=\"66\" x2=\"208\" y2=\"66\" />\n",
" <line x1=\"165\" y1=\"66\" x2=\"209\" y2=\"66\" />\n",
" <line x1=\"166\" y1=\"67\" x2=\"209\" y2=\"67\" />\n",
" <line x1=\"166\" y1=\"67\" x2=\"210\" y2=\"67\" />\n",
" <line x1=\"167\" y1=\"68\" x2=\"210\" y2=\"68\" />\n",
" <line x1=\"167\" y1=\"68\" x2=\"211\" y2=\"68\" />\n",
" <line x1=\"168\" y1=\"69\" x2=\"211\" y2=\"69\" />\n",
" <line x1=\"169\" y1=\"70\" x2=\"212\" y2=\"70\" />\n",
" <line x1=\"169\" y1=\"70\" x2=\"212\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"99\" y1=\"0\" x2=\"169\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"142\" y1=\"0\" x2=\"212\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"99.000000,0.000000 142.324317,0.000000 212.912552,70.588235 169.588235,70.588235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"169\" y1=\"70\" x2=\"212\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"169\" y1=\"138\" x2=\"212\" y2=\"138\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"169\" y1=\"70\" x2=\"169\" y2=\"138\" style=\"stroke-width:2\" />\n",
" <line x1=\"212\" y1=\"70\" x2=\"212\" y2=\"138\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"169.588235,70.588235 212.912552,70.588235 212.912552,138.088235 169.588235,138.088235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"191.250394\" y=\"158.088235\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >36</text>\n",
" <text x=\"232.912552\" y=\"104.338235\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,232.912552,104.338235)\">72</text>\n",
" <text x=\"124.294118\" y=\"122.794118\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,124.294118,122.794118)\">128</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"dask.array<concatenate, shape=(3, 128, 72, 36), dtype=float64, chunksize=(1, 1, 72, 36), chunktype=numpy.ndarray>"
]
},
"execution_count": 70,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"huge_skill.data"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%time huge_skillc = huge_skill.compute()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### uninit"
]
},
{
"cell_type": "code",
"execution_count": 67,
"metadata": {},
"outputs": [],
"source": [
"# bootstrap_uninitialized_ensemble??"
]
},
{
"cell_type": "code",
"execution_count": 72,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 43.7 s, sys: 2.64 s, total: 46.4 s\n",
"Wall time: 45.2 s\n"
]
}
],
"source": [
"%%time\n",
"huge_uhind = xr.concat(\n",
" [bootstrap_uninitialized_ensemble(hind, hist) for _ in range(bootstrap)], \"bootstrap\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 73,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 15.97 GB </td> <td> 41.60 MB </td></tr>\n",
" <tr><th> Shape </th><td> (128, 34, 59, 72, 36, 3) </td> <td> (1, 34, 59, 72, 36, 1) </td></tr>\n",
" <tr><th> Count </th><td> 39425 Tasks </td><td> 384 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"529\" height=\"163\" 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=\"43\" x2=\"80\" y2=\"113\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"43\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"43\" />\n",
" <line x1=\"11\" y1=\"1\" x2=\"11\" y2=\"44\" />\n",
" <line x1=\"11\" y1=\"1\" x2=\"11\" y2=\"44\" />\n",
" <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"45\" />\n",
" <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"45\" />\n",
" <line x1=\"13\" y1=\"3\" x2=\"13\" y2=\"46\" />\n",
" <line x1=\"13\" y1=\"3\" x2=\"13\" y2=\"46\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"47\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"48\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"15\" y2=\"48\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"16\" y2=\"49\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"16\" y2=\"49\" />\n",
" <line x1=\"17\" y1=\"7\" x2=\"17\" y2=\"50\" />\n",
" <line x1=\"17\" y1=\"7\" x2=\"17\" y2=\"50\" />\n",
" <line x1=\"18\" y1=\"8\" x2=\"18\" y2=\"51\" />\n",
" <line x1=\"18\" y1=\"8\" x2=\"18\" y2=\"51\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"52\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"53\" />\n",
" <line x1=\"20\" y1=\"10\" x2=\"20\" y2=\"53\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"54\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"54\" />\n",
" <line x1=\"22\" y1=\"12\" x2=\"22\" y2=\"55\" />\n",
" <line x1=\"22\" y1=\"12\" x2=\"22\" y2=\"55\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"23\" y2=\"56\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"23\" y2=\"56\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"57\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"58\" />\n",
" <line x1=\"25\" y1=\"15\" x2=\"25\" y2=\"58\" />\n",
" <line x1=\"25\" y1=\"15\" x2=\"25\" y2=\"59\" />\n",
" <line x1=\"26\" y1=\"16\" x2=\"26\" y2=\"59\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"60\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"60\" />\n",
" <line x1=\"28\" y1=\"18\" x2=\"28\" y2=\"61\" />\n",
" <line x1=\"28\" y1=\"18\" x2=\"28\" y2=\"61\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"29\" y2=\"62\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"29\" y2=\"62\" />\n",
" <line x1=\"30\" y1=\"20\" x2=\"30\" y2=\"63\" />\n",
" <line x1=\"30\" y1=\"20\" x2=\"30\" y2=\"64\" />\n",
" <line x1=\"31\" y1=\"21\" x2=\"31\" y2=\"64\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"65\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"65\" />\n",
" <line x1=\"33\" y1=\"23\" x2=\"33\" y2=\"66\" />\n",
" <line x1=\"33\" y1=\"23\" x2=\"33\" y2=\"66\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"34\" y2=\"67\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"34\" y2=\"67\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"68\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"69\" />\n",
" <line x1=\"36\" y1=\"26\" x2=\"36\" y2=\"69\" />\n",
" <line x1=\"37\" y1=\"27\" x2=\"37\" y2=\"70\" />\n",
" <line x1=\"37\" y1=\"27\" x2=\"37\" y2=\"70\" />\n",
" <line x1=\"38\" y1=\"28\" x2=\"38\" y2=\"71\" />\n",
" <line x1=\"38\" y1=\"28\" x2=\"38\" y2=\"71\" />\n",
" <line x1=\"39\" y1=\"29\" x2=\"39\" y2=\"72\" />\n",
" <line x1=\"39\" y1=\"29\" x2=\"39\" y2=\"72\" />\n",
" <line x1=\"40\" y1=\"30\" x2=\"40\" y2=\"73\" />\n",
" <line x1=\"40\" y1=\"30\" x2=\"40\" y2=\"74\" />\n",
" <line x1=\"41\" y1=\"31\" x2=\"41\" y2=\"74\" />\n",
" <line x1=\"41\" y1=\"31\" x2=\"41\" y2=\"75\" />\n",
" <line x1=\"42\" y1=\"32\" x2=\"42\" y2=\"75\" />\n",
" <line x1=\"43\" y1=\"33\" x2=\"43\" y2=\"76\" />\n",
" <line x1=\"43\" y1=\"33\" x2=\"43\" y2=\"76\" />\n",
" <line x1=\"44\" y1=\"34\" x2=\"44\" y2=\"77\" />\n",
" <line x1=\"44\" y1=\"34\" x2=\"44\" y2=\"77\" />\n",
" <line x1=\"45\" y1=\"35\" x2=\"45\" y2=\"78\" />\n",
" <line x1=\"45\" y1=\"35\" x2=\"45\" y2=\"78\" />\n",
" <line x1=\"46\" y1=\"36\" x2=\"46\" y2=\"79\" />\n",
" <line x1=\"46\" y1=\"36\" x2=\"46\" y2=\"80\" />\n",
" <line x1=\"47\" y1=\"37\" x2=\"47\" y2=\"80\" />\n",
" <line x1=\"48\" y1=\"38\" x2=\"48\" y2=\"81\" />\n",
" <line x1=\"48\" y1=\"38\" x2=\"48\" y2=\"81\" />\n",
" <line x1=\"49\" y1=\"39\" x2=\"49\" y2=\"82\" />\n",
" <line x1=\"49\" y1=\"39\" x2=\"49\" y2=\"82\" />\n",
" <line x1=\"50\" y1=\"40\" x2=\"50\" y2=\"83\" />\n",
" <line x1=\"50\" y1=\"40\" x2=\"50\" y2=\"83\" />\n",
" <line x1=\"51\" y1=\"41\" x2=\"51\" y2=\"84\" />\n",
" <line x1=\"51\" y1=\"41\" x2=\"51\" y2=\"85\" />\n",
" <line x1=\"52\" y1=\"42\" x2=\"52\" y2=\"85\" />\n",
" <line x1=\"53\" y1=\"43\" x2=\"53\" y2=\"86\" />\n",
" <line x1=\"53\" y1=\"43\" x2=\"53\" y2=\"86\" />\n",
" <line x1=\"54\" y1=\"44\" x2=\"54\" y2=\"87\" />\n",
" <line x1=\"54\" y1=\"44\" x2=\"54\" y2=\"87\" />\n",
" <line x1=\"55\" y1=\"45\" x2=\"55\" y2=\"88\" />\n",
" <line x1=\"55\" y1=\"45\" x2=\"55\" y2=\"88\" />\n",
" <line x1=\"56\" y1=\"46\" x2=\"56\" y2=\"89\" />\n",
" <line x1=\"56\" y1=\"46\" x2=\"56\" y2=\"89\" />\n",
" <line x1=\"57\" y1=\"47\" x2=\"57\" y2=\"90\" />\n",
" <line x1=\"57\" y1=\"47\" x2=\"57\" y2=\"91\" />\n",
" <line x1=\"58\" y1=\"48\" x2=\"58\" y2=\"91\" />\n",
" <line x1=\"59\" y1=\"49\" x2=\"59\" y2=\"92\" />\n",
" <line x1=\"59\" y1=\"49\" x2=\"59\" y2=\"92\" />\n",
" <line x1=\"60\" y1=\"50\" x2=\"60\" y2=\"93\" />\n",
" <line x1=\"60\" y1=\"50\" x2=\"60\" y2=\"93\" />\n",
" <line x1=\"61\" y1=\"51\" x2=\"61\" y2=\"94\" />\n",
" <line x1=\"61\" y1=\"51\" x2=\"61\" y2=\"94\" />\n",
" <line x1=\"62\" y1=\"52\" x2=\"62\" y2=\"95\" />\n",
" <line x1=\"62\" y1=\"52\" x2=\"62\" y2=\"96\" />\n",
" <line x1=\"63\" y1=\"53\" x2=\"63\" y2=\"96\" />\n",
" <line x1=\"64\" y1=\"54\" x2=\"64\" y2=\"97\" />\n",
" <line x1=\"64\" y1=\"54\" x2=\"64\" y2=\"97\" />\n",
" <line x1=\"65\" y1=\"55\" x2=\"65\" y2=\"98\" />\n",
" <line x1=\"65\" y1=\"55\" x2=\"65\" y2=\"98\" />\n",
" <line x1=\"66\" y1=\"56\" x2=\"66\" y2=\"99\" />\n",
" <line x1=\"66\" y1=\"56\" x2=\"66\" y2=\"99\" />\n",
" <line x1=\"67\" y1=\"57\" x2=\"67\" y2=\"100\" />\n",
" <line x1=\"67\" y1=\"57\" x2=\"67\" y2=\"101\" />\n",
" <line x1=\"68\" y1=\"58\" x2=\"68\" y2=\"101\" />\n",
" <line x1=\"69\" y1=\"59\" x2=\"69\" y2=\"102\" />\n",
" <line x1=\"69\" y1=\"59\" x2=\"69\" y2=\"102\" />\n",
" <line x1=\"70\" y1=\"60\" x2=\"70\" y2=\"103\" />\n",
" <line x1=\"70\" y1=\"60\" x2=\"70\" y2=\"103\" />\n",
" <line x1=\"71\" y1=\"61\" x2=\"71\" y2=\"104\" />\n",
" <line x1=\"71\" y1=\"61\" x2=\"71\" y2=\"104\" />\n",
" <line x1=\"72\" y1=\"62\" x2=\"72\" y2=\"105\" />\n",
" <line x1=\"72\" y1=\"62\" x2=\"72\" y2=\"105\" />\n",
" <line x1=\"73\" y1=\"63\" x2=\"73\" y2=\"106\" />\n",
" <line x1=\"73\" y1=\"63\" x2=\"73\" y2=\"107\" />\n",
" <line x1=\"74\" y1=\"64\" x2=\"74\" y2=\"107\" />\n",
" <line x1=\"75\" y1=\"65\" x2=\"75\" y2=\"108\" />\n",
" <line x1=\"75\" y1=\"65\" x2=\"75\" y2=\"108\" />\n",
" <line x1=\"76\" y1=\"66\" x2=\"76\" y2=\"109\" />\n",
" <line x1=\"76\" y1=\"66\" x2=\"76\" y2=\"109\" />\n",
" <line x1=\"77\" y1=\"67\" x2=\"77\" y2=\"110\" />\n",
" <line x1=\"77\" y1=\"67\" x2=\"77\" y2=\"110\" />\n",
" <line x1=\"78\" y1=\"68\" x2=\"78\" y2=\"111\" />\n",
" <line x1=\"78\" y1=\"68\" x2=\"78\" y2=\"112\" />\n",
" <line x1=\"79\" y1=\"69\" x2=\"79\" y2=\"112\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"113\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"113\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.000000,0.000000 80.588235,70.588235 80.588235,113.709802 10.000000,43.121567\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"65\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"0\" x2=\"65\" y2=\"0\" />\n",
" <line x1=\"11\" y1=\"1\" x2=\"66\" y2=\"1\" />\n",
" <line x1=\"11\" y1=\"1\" x2=\"66\" y2=\"1\" />\n",
" <line x1=\"12\" y1=\"2\" x2=\"67\" y2=\"2\" />\n",
" <line x1=\"12\" y1=\"2\" x2=\"68\" y2=\"2\" />\n",
" <line x1=\"13\" y1=\"3\" x2=\"68\" y2=\"3\" />\n",
" <line x1=\"13\" y1=\"3\" x2=\"69\" y2=\"3\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"69\" y2=\"4\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"70\" y2=\"4\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"70\" y2=\"5\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"71\" y2=\"6\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"71\" y2=\"6\" />\n",
" <line x1=\"17\" y1=\"7\" x2=\"72\" y2=\"7\" />\n",
" <line x1=\"17\" y1=\"7\" x2=\"73\" y2=\"7\" />\n",
" <line x1=\"18\" y1=\"8\" x2=\"73\" y2=\"8\" />\n",
" <line x1=\"18\" y1=\"8\" x2=\"74\" y2=\"8\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"74\" y2=\"9\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"75\" y2=\"9\" />\n",
" <line x1=\"20\" y1=\"10\" x2=\"75\" y2=\"10\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"76\" y2=\"11\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"76\" y2=\"11\" />\n",
" <line x1=\"22\" y1=\"12\" x2=\"77\" y2=\"12\" />\n",
" <line x1=\"22\" y1=\"12\" x2=\"77\" y2=\"12\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"78\" y2=\"13\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"79\" y2=\"13\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"79\" y2=\"14\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"80\" y2=\"14\" />\n",
" <line x1=\"25\" y1=\"15\" x2=\"80\" y2=\"15\" />\n",
" <line x1=\"25\" y1=\"15\" x2=\"81\" y2=\"15\" />\n",
" <line x1=\"26\" y1=\"16\" x2=\"81\" y2=\"16\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"82\" y2=\"17\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"82\" y2=\"17\" />\n",
" <line x1=\"28\" y1=\"18\" x2=\"83\" y2=\"18\" />\n",
" <line x1=\"28\" y1=\"18\" x2=\"84\" y2=\"18\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"84\" y2=\"19\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"85\" y2=\"19\" />\n",
" <line x1=\"30\" y1=\"20\" x2=\"85\" y2=\"20\" />\n",
" <line x1=\"30\" y1=\"20\" x2=\"86\" y2=\"20\" />\n",
" <line x1=\"31\" y1=\"21\" x2=\"86\" y2=\"21\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"87\" y2=\"22\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"87\" y2=\"22\" />\n",
" <line x1=\"33\" y1=\"23\" x2=\"88\" y2=\"23\" />\n",
" <line x1=\"33\" y1=\"23\" x2=\"89\" y2=\"23\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"89\" y2=\"24\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"90\" y2=\"24\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"90\" y2=\"25\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"91\" y2=\"25\" />\n",
" <line x1=\"36\" y1=\"26\" x2=\"91\" y2=\"26\" />\n",
" <line x1=\"37\" y1=\"27\" x2=\"92\" y2=\"27\" />\n",
" <line x1=\"37\" y1=\"27\" x2=\"92\" y2=\"27\" />\n",
" <line x1=\"38\" y1=\"28\" x2=\"93\" y2=\"28\" />\n",
" <line x1=\"38\" y1=\"28\" x2=\"93\" y2=\"28\" />\n",
" <line x1=\"39\" y1=\"29\" x2=\"94\" y2=\"29\" />\n",
" <line x1=\"39\" y1=\"29\" x2=\"95\" y2=\"29\" />\n",
" <line x1=\"40\" y1=\"30\" x2=\"95\" y2=\"30\" />\n",
" <line x1=\"40\" y1=\"30\" x2=\"96\" y2=\"30\" />\n",
" <line x1=\"41\" y1=\"31\" x2=\"96\" y2=\"31\" />\n",
" <line x1=\"41\" y1=\"31\" x2=\"97\" y2=\"31\" />\n",
" <line x1=\"42\" y1=\"32\" x2=\"97\" y2=\"32\" />\n",
" <line x1=\"43\" y1=\"33\" x2=\"98\" y2=\"33\" />\n",
" <line x1=\"43\" y1=\"33\" x2=\"98\" y2=\"33\" />\n",
" <line x1=\"44\" y1=\"34\" x2=\"99\" y2=\"34\" />\n",
" <line x1=\"44\" y1=\"34\" x2=\"100\" y2=\"34\" />\n",
" <line x1=\"45\" y1=\"35\" x2=\"100\" y2=\"35\" />\n",
" <line x1=\"45\" y1=\"35\" x2=\"101\" y2=\"35\" />\n",
" <line x1=\"46\" y1=\"36\" x2=\"101\" y2=\"36\" />\n",
" <line x1=\"46\" y1=\"36\" x2=\"102\" y2=\"36\" />\n",
" <line x1=\"47\" y1=\"37\" x2=\"102\" y2=\"37\" />\n",
" <line x1=\"48\" y1=\"38\" x2=\"103\" y2=\"38\" />\n",
" <line x1=\"48\" y1=\"38\" x2=\"103\" y2=\"38\" />\n",
" <line x1=\"49\" y1=\"39\" x2=\"104\" y2=\"39\" />\n",
" <line x1=\"49\" y1=\"39\" x2=\"105\" y2=\"39\" />\n",
" <line x1=\"50\" y1=\"40\" x2=\"105\" y2=\"40\" />\n",
" <line x1=\"50\" y1=\"40\" x2=\"106\" y2=\"40\" />\n",
" <line x1=\"51\" y1=\"41\" x2=\"106\" y2=\"41\" />\n",
" <line x1=\"51\" y1=\"41\" x2=\"107\" y2=\"41\" />\n",
" <line x1=\"52\" y1=\"42\" x2=\"107\" y2=\"42\" />\n",
" <line x1=\"53\" y1=\"43\" x2=\"108\" y2=\"43\" />\n",
" <line x1=\"53\" y1=\"43\" x2=\"108\" y2=\"43\" />\n",
" <line x1=\"54\" y1=\"44\" x2=\"109\" y2=\"44\" />\n",
" <line x1=\"54\" y1=\"44\" x2=\"109\" y2=\"44\" />\n",
" <line x1=\"55\" y1=\"45\" x2=\"110\" y2=\"45\" />\n",
" <line x1=\"55\" y1=\"45\" x2=\"111\" y2=\"45\" />\n",
" <line x1=\"56\" y1=\"46\" x2=\"111\" y2=\"46\" />\n",
" <line x1=\"56\" y1=\"46\" x2=\"112\" y2=\"46\" />\n",
" <line x1=\"57\" y1=\"47\" x2=\"112\" y2=\"47\" />\n",
" <line x1=\"57\" y1=\"47\" x2=\"113\" y2=\"47\" />\n",
" <line x1=\"58\" y1=\"48\" x2=\"113\" y2=\"48\" />\n",
" <line x1=\"59\" y1=\"49\" x2=\"114\" y2=\"49\" />\n",
" <line x1=\"59\" y1=\"49\" x2=\"114\" y2=\"49\" />\n",
" <line x1=\"60\" y1=\"50\" x2=\"115\" y2=\"50\" />\n",
" <line x1=\"60\" y1=\"50\" x2=\"116\" y2=\"50\" />\n",
" <line x1=\"61\" y1=\"51\" x2=\"116\" y2=\"51\" />\n",
" <line x1=\"61\" y1=\"51\" x2=\"117\" y2=\"51\" />\n",
" <line x1=\"62\" y1=\"52\" x2=\"117\" y2=\"52\" />\n",
" <line x1=\"62\" y1=\"52\" x2=\"118\" y2=\"52\" />\n",
" <line x1=\"63\" y1=\"53\" x2=\"118\" y2=\"53\" />\n",
" <line x1=\"64\" y1=\"54\" x2=\"119\" y2=\"54\" />\n",
" <line x1=\"64\" y1=\"54\" x2=\"119\" y2=\"54\" />\n",
" <line x1=\"65\" y1=\"55\" x2=\"120\" y2=\"55\" />\n",
" <line x1=\"65\" y1=\"55\" x2=\"121\" y2=\"55\" />\n",
" <line x1=\"66\" y1=\"56\" x2=\"121\" y2=\"56\" />\n",
" <line x1=\"66\" y1=\"56\" x2=\"122\" y2=\"56\" />\n",
" <line x1=\"67\" y1=\"57\" x2=\"122\" y2=\"57\" />\n",
" <line x1=\"67\" y1=\"57\" x2=\"123\" y2=\"57\" />\n",
" <line x1=\"68\" y1=\"58\" x2=\"123\" y2=\"58\" />\n",
" <line x1=\"69\" y1=\"59\" x2=\"124\" y2=\"59\" />\n",
" <line x1=\"69\" y1=\"59\" x2=\"124\" y2=\"59\" />\n",
" <line x1=\"70\" y1=\"60\" x2=\"125\" y2=\"60\" />\n",
" <line x1=\"70\" y1=\"60\" x2=\"125\" y2=\"60\" />\n",
" <line x1=\"71\" y1=\"61\" x2=\"126\" y2=\"61\" />\n",
" <line x1=\"71\" y1=\"61\" x2=\"127\" y2=\"61\" />\n",
" <line x1=\"72\" y1=\"62\" x2=\"127\" y2=\"62\" />\n",
" <line x1=\"72\" y1=\"62\" x2=\"128\" y2=\"62\" />\n",
" <line x1=\"73\" y1=\"63\" x2=\"128\" y2=\"63\" />\n",
" <line x1=\"73\" y1=\"63\" x2=\"129\" y2=\"63\" />\n",
" <line x1=\"74\" y1=\"64\" x2=\"129\" y2=\"64\" />\n",
" <line x1=\"75\" y1=\"65\" x2=\"130\" y2=\"65\" />\n",
" <line x1=\"75\" y1=\"65\" x2=\"130\" y2=\"65\" />\n",
" <line x1=\"76\" y1=\"66\" x2=\"131\" y2=\"66\" />\n",
" <line x1=\"76\" y1=\"66\" x2=\"132\" y2=\"66\" />\n",
" <line x1=\"77\" y1=\"67\" x2=\"132\" y2=\"67\" />\n",
" <line x1=\"77\" y1=\"67\" x2=\"133\" y2=\"67\" />\n",
" <line x1=\"78\" y1=\"68\" x2=\"133\" y2=\"68\" />\n",
" <line x1=\"78\" y1=\"68\" x2=\"134\" y2=\"68\" />\n",
" <line x1=\"79\" y1=\"69\" x2=\"134\" y2=\"69\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"135\" y2=\"70\" />\n",
" <line x1=\"80\" y1=\"70\" x2=\"135\" 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=\"65\" y1=\"0\" x2=\"135\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.000000,0.000000 65.312500,0.000000 135.900735,70.588235 80.588235,70.588235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"80\" y1=\"70\" x2=\"135\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"80\" y1=\"113\" x2=\"135\" y2=\"113\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"80\" y1=\"70\" x2=\"80\" y2=\"113\" style=\"stroke-width:2\" />\n",
" <line x1=\"135\" y1=\"70\" x2=\"135\" y2=\"113\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"80.588235,70.588235 135.900735,70.588235 135.900735,113.709802 80.588235,113.709802\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"108.244485\" y=\"133.709802\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >59</text>\n",
" <text x=\"155.900735\" y=\"92.149019\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,155.900735,92.149019)\">34</text>\n",
" <text x=\"35.294118\" y=\"98.415685\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,35.294118,98.415685)\">128</text>\n",
"\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"205\" y1=\"0\" x2=\"244\" y2=\"39\" style=\"stroke-width:2\" />\n",
" <line x1=\"205\" y1=\"43\" x2=\"244\" y2=\"83\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"205\" y1=\"0\" x2=\"205\" y2=\"43\" style=\"stroke-width:2\" />\n",
" <line x1=\"244\" y1=\"39\" x2=\"244\" y2=\"83\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"205.000000,0.000000 244.705882,39.705882 244.705882,83.030199 205.000000,43.324317\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"205\" y1=\"0\" x2=\"234\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"244\" y1=\"39\" x2=\"274\" y2=\"39\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"205\" y1=\"0\" x2=\"244\" y2=\"39\" style=\"stroke-width:2\" />\n",
" <line x1=\"214\" y1=\"0\" x2=\"254\" y2=\"39\" />\n",
" <line x1=\"224\" y1=\"0\" x2=\"264\" y2=\"39\" />\n",
" <line x1=\"234\" y1=\"0\" x2=\"274\" y2=\"39\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"205.000000,0.000000 234.936052,0.000000 274.641935,39.705882 244.705882,39.705882\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"244\" y1=\"39\" x2=\"274\" y2=\"39\" style=\"stroke-width:2\" />\n",
" <line x1=\"244\" y1=\"83\" x2=\"274\" y2=\"83\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"244\" y1=\"39\" x2=\"244\" y2=\"83\" style=\"stroke-width:2\" />\n",
" <line x1=\"254\" y1=\"39\" x2=\"254\" y2=\"83\" />\n",
" <line x1=\"264\" y1=\"39\" x2=\"264\" y2=\"83\" />\n",
" <line x1=\"274\" y1=\"39\" x2=\"274\" y2=\"83\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"244.705882,39.705882 274.641935,39.705882 274.641935,83.030199 244.705882,83.030199\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"259.673909\" y=\"103.030199\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >3</text>\n",
" <text x=\"294.641935\" y=\"61.368041\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,294.641935,61.368041)\">36</text>\n",
" <text x=\"214.852941\" y=\"83.177258\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,214.852941,83.177258)\">72</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"dask.array<concatenate, shape=(128, 34, 59, 72, 36, 3), dtype=float64, chunksize=(1, 34, 59, 72, 36, 1), chunktype=numpy.ndarray>"
]
},
"execution_count": 73,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"huge_uhind.data"
]
},
{
"cell_type": "code",
"execution_count": 74,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 272 ms, sys: 18 ms, total: 290 ms\n",
"Wall time: 350 ms\n"
]
}
],
"source": [
"%time huge_uskill = compute_hindcast(huge_uhind, obs, **kw)"
]
},
{
"cell_type": "code",
"execution_count": 75,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 7.96 MB </td> <td> 20.74 kB </td></tr>\n",
" <tr><th> Shape </th><td> (3, 128, 72, 36) </td> <td> (1, 1, 72, 36) </td></tr>\n",
" <tr><th> Count </th><td> 43918 Tasks </td><td> 384 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"361\" height=\"188\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"29\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"25\" x2=\"29\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"9\" y1=\"0\" x2=\"9\" y2=\"25\" />\n",
" <line x1=\"19\" y1=\"0\" x2=\"19\" y2=\"25\" />\n",
" <line x1=\"29\" y1=\"0\" x2=\"29\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"0.000000,0.000000 29.936052,0.000000 29.936052,25.412617 0.000000,25.412617\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"14.968026\" y=\"45.412617\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >3</text>\n",
" <text x=\"49.936052\" y=\"12.706308\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,49.936052,12.706308)\">1</text>\n",
"\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"99\" y1=\"0\" x2=\"169\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"99\" y1=\"67\" x2=\"169\" y2=\"138\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"99\" y1=\"0\" x2=\"99\" y2=\"67\" style=\"stroke-width:2\" />\n",
" <line x1=\"99\" y1=\"0\" x2=\"99\" y2=\"68\" />\n",
" <line x1=\"100\" y1=\"1\" x2=\"100\" y2=\"68\" />\n",
" <line x1=\"100\" y1=\"1\" x2=\"100\" y2=\"69\" />\n",
" <line x1=\"101\" y1=\"2\" x2=\"101\" y2=\"69\" />\n",
" <line x1=\"101\" y1=\"2\" x2=\"101\" y2=\"70\" />\n",
" <line x1=\"102\" y1=\"3\" x2=\"102\" y2=\"70\" />\n",
" <line x1=\"102\" y1=\"3\" x2=\"102\" y2=\"71\" />\n",
" <line x1=\"103\" y1=\"4\" x2=\"103\" y2=\"71\" />\n",
" <line x1=\"103\" y1=\"4\" x2=\"103\" y2=\"72\" />\n",
" <line x1=\"104\" y1=\"5\" x2=\"104\" y2=\"73\" />\n",
" <line x1=\"105\" y1=\"6\" x2=\"105\" y2=\"73\" />\n",
" <line x1=\"105\" y1=\"6\" x2=\"105\" y2=\"74\" />\n",
" <line x1=\"106\" y1=\"7\" x2=\"106\" y2=\"74\" />\n",
" <line x1=\"106\" y1=\"7\" x2=\"106\" y2=\"75\" />\n",
" <line x1=\"107\" y1=\"8\" x2=\"107\" y2=\"75\" />\n",
" <line x1=\"107\" y1=\"8\" x2=\"107\" y2=\"76\" />\n",
" <line x1=\"108\" y1=\"9\" x2=\"108\" y2=\"76\" />\n",
" <line x1=\"108\" y1=\"9\" x2=\"108\" y2=\"77\" />\n",
" <line x1=\"109\" y1=\"10\" x2=\"109\" y2=\"77\" />\n",
" <line x1=\"110\" y1=\"11\" x2=\"110\" y2=\"78\" />\n",
" <line x1=\"110\" y1=\"11\" x2=\"110\" y2=\"79\" />\n",
" <line x1=\"111\" y1=\"12\" x2=\"111\" y2=\"79\" />\n",
" <line x1=\"111\" y1=\"12\" x2=\"111\" y2=\"80\" />\n",
" <line x1=\"112\" y1=\"13\" x2=\"112\" y2=\"80\" />\n",
" <line x1=\"112\" y1=\"13\" x2=\"112\" y2=\"81\" />\n",
" <line x1=\"113\" y1=\"14\" x2=\"113\" y2=\"81\" />\n",
" <line x1=\"113\" y1=\"14\" x2=\"113\" y2=\"82\" />\n",
" <line x1=\"114\" y1=\"15\" x2=\"114\" y2=\"82\" />\n",
" <line x1=\"114\" y1=\"15\" x2=\"114\" y2=\"83\" />\n",
" <line x1=\"115\" y1=\"16\" x2=\"115\" y2=\"84\" />\n",
" <line x1=\"116\" y1=\"17\" x2=\"116\" y2=\"84\" />\n",
" <line x1=\"116\" y1=\"17\" x2=\"116\" y2=\"85\" />\n",
" <line x1=\"117\" y1=\"18\" x2=\"117\" y2=\"85\" />\n",
" <line x1=\"117\" y1=\"18\" x2=\"117\" y2=\"86\" />\n",
" <line x1=\"118\" y1=\"19\" x2=\"118\" y2=\"86\" />\n",
" <line x1=\"118\" y1=\"19\" x2=\"118\" y2=\"87\" />\n",
" <line x1=\"119\" y1=\"20\" x2=\"119\" y2=\"87\" />\n",
" <line x1=\"119\" y1=\"20\" x2=\"119\" y2=\"88\" />\n",
" <line x1=\"120\" y1=\"21\" x2=\"120\" y2=\"89\" />\n",
" <line x1=\"121\" y1=\"22\" x2=\"121\" y2=\"89\" />\n",
" <line x1=\"121\" y1=\"22\" x2=\"121\" y2=\"90\" />\n",
" <line x1=\"122\" y1=\"23\" x2=\"122\" y2=\"90\" />\n",
" <line x1=\"122\" y1=\"23\" x2=\"122\" y2=\"91\" />\n",
" <line x1=\"123\" y1=\"24\" x2=\"123\" y2=\"91\" />\n",
" <line x1=\"123\" y1=\"24\" x2=\"123\" y2=\"92\" />\n",
" <line x1=\"124\" y1=\"25\" x2=\"124\" y2=\"92\" />\n",
" <line x1=\"124\" y1=\"25\" x2=\"124\" y2=\"93\" />\n",
" <line x1=\"125\" y1=\"26\" x2=\"125\" y2=\"93\" />\n",
" <line x1=\"126\" y1=\"27\" x2=\"126\" y2=\"94\" />\n",
" <line x1=\"126\" y1=\"27\" x2=\"126\" y2=\"95\" />\n",
" <line x1=\"127\" y1=\"28\" x2=\"127\" y2=\"95\" />\n",
" <line x1=\"127\" y1=\"28\" x2=\"127\" y2=\"96\" />\n",
" <line x1=\"128\" y1=\"29\" x2=\"128\" y2=\"96\" />\n",
" <line x1=\"128\" y1=\"29\" x2=\"128\" y2=\"97\" />\n",
" <line x1=\"129\" y1=\"30\" x2=\"129\" y2=\"97\" />\n",
" <line x1=\"129\" y1=\"30\" x2=\"129\" y2=\"98\" />\n",
" <line x1=\"130\" y1=\"31\" x2=\"130\" y2=\"98\" />\n",
" <line x1=\"130\" y1=\"31\" x2=\"130\" y2=\"99\" />\n",
" <line x1=\"131\" y1=\"32\" x2=\"131\" y2=\"100\" />\n",
" <line x1=\"132\" y1=\"33\" x2=\"132\" y2=\"100\" />\n",
" <line x1=\"132\" y1=\"33\" x2=\"132\" y2=\"101\" />\n",
" <line x1=\"133\" y1=\"34\" x2=\"133\" y2=\"101\" />\n",
" <line x1=\"133\" y1=\"34\" x2=\"133\" y2=\"102\" />\n",
" <line x1=\"134\" y1=\"35\" x2=\"134\" y2=\"102\" />\n",
" <line x1=\"134\" y1=\"35\" x2=\"134\" y2=\"103\" />\n",
" <line x1=\"135\" y1=\"36\" x2=\"135\" y2=\"103\" />\n",
" <line x1=\"135\" y1=\"36\" x2=\"135\" y2=\"104\" />\n",
" <line x1=\"136\" y1=\"37\" x2=\"136\" y2=\"105\" />\n",
" <line x1=\"137\" y1=\"38\" x2=\"137\" y2=\"105\" />\n",
" <line x1=\"137\" y1=\"38\" x2=\"137\" y2=\"106\" />\n",
" <line x1=\"138\" y1=\"39\" x2=\"138\" y2=\"106\" />\n",
" <line x1=\"138\" y1=\"39\" x2=\"138\" y2=\"107\" />\n",
" <line x1=\"139\" y1=\"40\" x2=\"139\" y2=\"107\" />\n",
" <line x1=\"139\" y1=\"40\" x2=\"139\" y2=\"108\" />\n",
" <line x1=\"140\" y1=\"41\" x2=\"140\" y2=\"108\" />\n",
" <line x1=\"140\" y1=\"41\" x2=\"140\" y2=\"109\" />\n",
" <line x1=\"141\" y1=\"42\" x2=\"141\" y2=\"109\" />\n",
" <line x1=\"142\" y1=\"43\" x2=\"142\" y2=\"110\" />\n",
" <line x1=\"142\" y1=\"43\" x2=\"142\" y2=\"111\" />\n",
" <line x1=\"143\" y1=\"44\" x2=\"143\" y2=\"111\" />\n",
" <line x1=\"143\" y1=\"44\" x2=\"143\" y2=\"112\" />\n",
" <line x1=\"144\" y1=\"45\" x2=\"144\" y2=\"112\" />\n",
" <line x1=\"144\" y1=\"45\" x2=\"144\" y2=\"113\" />\n",
" <line x1=\"145\" y1=\"46\" x2=\"145\" y2=\"113\" />\n",
" <line x1=\"145\" y1=\"46\" x2=\"145\" y2=\"114\" />\n",
" <line x1=\"146\" y1=\"47\" x2=\"146\" y2=\"114\" />\n",
" <line x1=\"146\" y1=\"47\" x2=\"146\" y2=\"115\" />\n",
" <line x1=\"147\" y1=\"48\" x2=\"147\" y2=\"116\" />\n",
" <line x1=\"148\" y1=\"49\" x2=\"148\" y2=\"116\" />\n",
" <line x1=\"148\" y1=\"49\" x2=\"148\" y2=\"117\" />\n",
" <line x1=\"149\" y1=\"50\" x2=\"149\" y2=\"117\" />\n",
" <line x1=\"149\" y1=\"50\" x2=\"149\" y2=\"118\" />\n",
" <line x1=\"150\" y1=\"51\" x2=\"150\" y2=\"118\" />\n",
" <line x1=\"150\" y1=\"51\" x2=\"150\" y2=\"119\" />\n",
" <line x1=\"151\" y1=\"52\" x2=\"151\" y2=\"119\" />\n",
" <line x1=\"151\" y1=\"52\" x2=\"151\" y2=\"120\" />\n",
" <line x1=\"152\" y1=\"53\" x2=\"152\" y2=\"120\" />\n",
" <line x1=\"153\" y1=\"54\" x2=\"153\" y2=\"121\" />\n",
" <line x1=\"153\" y1=\"54\" x2=\"153\" y2=\"122\" />\n",
" <line x1=\"154\" y1=\"55\" x2=\"154\" y2=\"122\" />\n",
" <line x1=\"154\" y1=\"55\" x2=\"154\" y2=\"123\" />\n",
" <line x1=\"155\" y1=\"56\" x2=\"155\" y2=\"123\" />\n",
" <line x1=\"155\" y1=\"56\" x2=\"155\" y2=\"124\" />\n",
" <line x1=\"156\" y1=\"57\" x2=\"156\" y2=\"124\" />\n",
" <line x1=\"156\" y1=\"57\" x2=\"156\" y2=\"125\" />\n",
" <line x1=\"157\" y1=\"58\" x2=\"157\" y2=\"125\" />\n",
" <line x1=\"158\" y1=\"59\" x2=\"158\" y2=\"126\" />\n",
" <line x1=\"158\" y1=\"59\" x2=\"158\" y2=\"127\" />\n",
" <line x1=\"159\" y1=\"60\" x2=\"159\" y2=\"127\" />\n",
" <line x1=\"159\" y1=\"60\" x2=\"159\" y2=\"128\" />\n",
" <line x1=\"160\" y1=\"61\" x2=\"160\" y2=\"128\" />\n",
" <line x1=\"160\" y1=\"61\" x2=\"160\" y2=\"129\" />\n",
" <line x1=\"161\" y1=\"62\" x2=\"161\" y2=\"129\" />\n",
" <line x1=\"161\" y1=\"62\" x2=\"161\" y2=\"130\" />\n",
" <line x1=\"162\" y1=\"63\" x2=\"162\" y2=\"130\" />\n",
" <line x1=\"162\" y1=\"63\" x2=\"162\" y2=\"131\" />\n",
" <line x1=\"163\" y1=\"64\" x2=\"163\" y2=\"132\" />\n",
" <line x1=\"164\" y1=\"65\" x2=\"164\" y2=\"132\" />\n",
" <line x1=\"164\" y1=\"65\" x2=\"164\" y2=\"133\" />\n",
" <line x1=\"165\" y1=\"66\" x2=\"165\" y2=\"133\" />\n",
" <line x1=\"165\" y1=\"66\" x2=\"165\" y2=\"134\" />\n",
" <line x1=\"166\" y1=\"67\" x2=\"166\" y2=\"134\" />\n",
" <line x1=\"166\" y1=\"67\" x2=\"166\" y2=\"135\" />\n",
" <line x1=\"167\" y1=\"68\" x2=\"167\" y2=\"135\" />\n",
" <line x1=\"167\" y1=\"68\" x2=\"167\" y2=\"136\" />\n",
" <line x1=\"168\" y1=\"69\" x2=\"168\" y2=\"136\" />\n",
" <line x1=\"169\" y1=\"70\" x2=\"169\" y2=\"137\" />\n",
" <line x1=\"169\" y1=\"70\" x2=\"169\" y2=\"138\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"99.000000,0.000000 169.588235,70.588235 169.588235,138.088235 99.000000,67.500000\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"99\" y1=\"0\" x2=\"142\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"99\" y1=\"0\" x2=\"142\" y2=\"0\" />\n",
" <line x1=\"100\" y1=\"1\" x2=\"143\" y2=\"1\" />\n",
" <line x1=\"100\" y1=\"1\" x2=\"143\" y2=\"1\" />\n",
" <line x1=\"101\" y1=\"2\" x2=\"144\" y2=\"2\" />\n",
" <line x1=\"101\" y1=\"2\" x2=\"145\" y2=\"2\" />\n",
" <line x1=\"102\" y1=\"3\" x2=\"145\" y2=\"3\" />\n",
" <line x1=\"102\" y1=\"3\" x2=\"146\" y2=\"3\" />\n",
" <line x1=\"103\" y1=\"4\" x2=\"146\" y2=\"4\" />\n",
" <line x1=\"103\" y1=\"4\" x2=\"147\" y2=\"4\" />\n",
" <line x1=\"104\" y1=\"5\" x2=\"147\" y2=\"5\" />\n",
" <line x1=\"105\" y1=\"6\" x2=\"148\" y2=\"6\" />\n",
" <line x1=\"105\" y1=\"6\" x2=\"148\" y2=\"6\" />\n",
" <line x1=\"106\" y1=\"7\" x2=\"149\" y2=\"7\" />\n",
" <line x1=\"106\" y1=\"7\" x2=\"150\" y2=\"7\" />\n",
" <line x1=\"107\" y1=\"8\" x2=\"150\" y2=\"8\" />\n",
" <line x1=\"107\" y1=\"8\" x2=\"151\" y2=\"8\" />\n",
" <line x1=\"108\" y1=\"9\" x2=\"151\" y2=\"9\" />\n",
" <line x1=\"108\" y1=\"9\" x2=\"152\" y2=\"9\" />\n",
" <line x1=\"109\" y1=\"10\" x2=\"152\" y2=\"10\" />\n",
" <line x1=\"110\" y1=\"11\" x2=\"153\" y2=\"11\" />\n",
" <line x1=\"110\" y1=\"11\" x2=\"153\" y2=\"11\" />\n",
" <line x1=\"111\" y1=\"12\" x2=\"154\" y2=\"12\" />\n",
" <line x1=\"111\" y1=\"12\" x2=\"155\" y2=\"12\" />\n",
" <line x1=\"112\" y1=\"13\" x2=\"155\" y2=\"13\" />\n",
" <line x1=\"112\" y1=\"13\" x2=\"156\" y2=\"13\" />\n",
" <line x1=\"113\" y1=\"14\" x2=\"156\" y2=\"14\" />\n",
" <line x1=\"113\" y1=\"14\" x2=\"157\" y2=\"14\" />\n",
" <line x1=\"114\" y1=\"15\" x2=\"157\" y2=\"15\" />\n",
" <line x1=\"114\" y1=\"15\" x2=\"158\" y2=\"15\" />\n",
" <line x1=\"115\" y1=\"16\" x2=\"158\" y2=\"16\" />\n",
" <line x1=\"116\" y1=\"17\" x2=\"159\" y2=\"17\" />\n",
" <line x1=\"116\" y1=\"17\" x2=\"159\" y2=\"17\" />\n",
" <line x1=\"117\" y1=\"18\" x2=\"160\" y2=\"18\" />\n",
" <line x1=\"117\" y1=\"18\" x2=\"161\" y2=\"18\" />\n",
" <line x1=\"118\" y1=\"19\" x2=\"161\" y2=\"19\" />\n",
" <line x1=\"118\" y1=\"19\" x2=\"162\" y2=\"19\" />\n",
" <line x1=\"119\" y1=\"20\" x2=\"162\" y2=\"20\" />\n",
" <line x1=\"119\" y1=\"20\" x2=\"163\" y2=\"20\" />\n",
" <line x1=\"120\" y1=\"21\" x2=\"163\" y2=\"21\" />\n",
" <line x1=\"121\" y1=\"22\" x2=\"164\" y2=\"22\" />\n",
" <line x1=\"121\" y1=\"22\" x2=\"164\" y2=\"22\" />\n",
" <line x1=\"122\" y1=\"23\" x2=\"165\" y2=\"23\" />\n",
" <line x1=\"122\" y1=\"23\" x2=\"166\" y2=\"23\" />\n",
" <line x1=\"123\" y1=\"24\" x2=\"166\" y2=\"24\" />\n",
" <line x1=\"123\" y1=\"24\" x2=\"167\" y2=\"24\" />\n",
" <line x1=\"124\" y1=\"25\" x2=\"167\" y2=\"25\" />\n",
" <line x1=\"124\" y1=\"25\" x2=\"168\" y2=\"25\" />\n",
" <line x1=\"125\" y1=\"26\" x2=\"168\" y2=\"26\" />\n",
" <line x1=\"126\" y1=\"27\" x2=\"169\" y2=\"27\" />\n",
" <line x1=\"126\" y1=\"27\" x2=\"169\" y2=\"27\" />\n",
" <line x1=\"127\" y1=\"28\" x2=\"170\" y2=\"28\" />\n",
" <line x1=\"127\" y1=\"28\" x2=\"171\" y2=\"28\" />\n",
" <line x1=\"128\" y1=\"29\" x2=\"171\" y2=\"29\" />\n",
" <line x1=\"128\" y1=\"29\" x2=\"172\" y2=\"29\" />\n",
" <line x1=\"129\" y1=\"30\" x2=\"172\" y2=\"30\" />\n",
" <line x1=\"129\" y1=\"30\" x2=\"173\" y2=\"30\" />\n",
" <line x1=\"130\" y1=\"31\" x2=\"173\" y2=\"31\" />\n",
" <line x1=\"130\" y1=\"31\" x2=\"174\" y2=\"31\" />\n",
" <line x1=\"131\" y1=\"32\" x2=\"174\" y2=\"32\" />\n",
" <line x1=\"132\" y1=\"33\" x2=\"175\" y2=\"33\" />\n",
" <line x1=\"132\" y1=\"33\" x2=\"175\" y2=\"33\" />\n",
" <line x1=\"133\" y1=\"34\" x2=\"176\" y2=\"34\" />\n",
" <line x1=\"133\" y1=\"34\" x2=\"177\" y2=\"34\" />\n",
" <line x1=\"134\" y1=\"35\" x2=\"177\" y2=\"35\" />\n",
" <line x1=\"134\" y1=\"35\" x2=\"178\" y2=\"35\" />\n",
" <line x1=\"135\" y1=\"36\" x2=\"178\" y2=\"36\" />\n",
" <line x1=\"135\" y1=\"36\" x2=\"179\" y2=\"36\" />\n",
" <line x1=\"136\" y1=\"37\" x2=\"179\" y2=\"37\" />\n",
" <line x1=\"137\" y1=\"38\" x2=\"180\" y2=\"38\" />\n",
" <line x1=\"137\" y1=\"38\" x2=\"180\" y2=\"38\" />\n",
" <line x1=\"138\" y1=\"39\" x2=\"181\" y2=\"39\" />\n",
" <line x1=\"138\" y1=\"39\" x2=\"182\" y2=\"39\" />\n",
" <line x1=\"139\" y1=\"40\" x2=\"182\" y2=\"40\" />\n",
" <line x1=\"139\" y1=\"40\" x2=\"183\" y2=\"40\" />\n",
" <line x1=\"140\" y1=\"41\" x2=\"183\" y2=\"41\" />\n",
" <line x1=\"140\" y1=\"41\" x2=\"184\" y2=\"41\" />\n",
" <line x1=\"141\" y1=\"42\" x2=\"184\" y2=\"42\" />\n",
" <line x1=\"142\" y1=\"43\" x2=\"185\" y2=\"43\" />\n",
" <line x1=\"142\" y1=\"43\" x2=\"185\" y2=\"43\" />\n",
" <line x1=\"143\" y1=\"44\" x2=\"186\" y2=\"44\" />\n",
" <line x1=\"143\" y1=\"44\" x2=\"186\" y2=\"44\" />\n",
" <line x1=\"144\" y1=\"45\" x2=\"187\" y2=\"45\" />\n",
" <line x1=\"144\" y1=\"45\" x2=\"188\" y2=\"45\" />\n",
" <line x1=\"145\" y1=\"46\" x2=\"188\" y2=\"46\" />\n",
" <line x1=\"145\" y1=\"46\" x2=\"189\" y2=\"46\" />\n",
" <line x1=\"146\" y1=\"47\" x2=\"189\" y2=\"47\" />\n",
" <line x1=\"146\" y1=\"47\" x2=\"190\" y2=\"47\" />\n",
" <line x1=\"147\" y1=\"48\" x2=\"190\" y2=\"48\" />\n",
" <line x1=\"148\" y1=\"49\" x2=\"191\" y2=\"49\" />\n",
" <line x1=\"148\" y1=\"49\" x2=\"191\" y2=\"49\" />\n",
" <line x1=\"149\" y1=\"50\" x2=\"192\" y2=\"50\" />\n",
" <line x1=\"149\" y1=\"50\" x2=\"193\" y2=\"50\" />\n",
" <line x1=\"150\" y1=\"51\" x2=\"193\" y2=\"51\" />\n",
" <line x1=\"150\" y1=\"51\" x2=\"194\" y2=\"51\" />\n",
" <line x1=\"151\" y1=\"52\" x2=\"194\" y2=\"52\" />\n",
" <line x1=\"151\" y1=\"52\" x2=\"195\" y2=\"52\" />\n",
" <line x1=\"152\" y1=\"53\" x2=\"195\" y2=\"53\" />\n",
" <line x1=\"153\" y1=\"54\" x2=\"196\" y2=\"54\" />\n",
" <line x1=\"153\" y1=\"54\" x2=\"196\" y2=\"54\" />\n",
" <line x1=\"154\" y1=\"55\" x2=\"197\" y2=\"55\" />\n",
" <line x1=\"154\" y1=\"55\" x2=\"198\" y2=\"55\" />\n",
" <line x1=\"155\" y1=\"56\" x2=\"198\" y2=\"56\" />\n",
" <line x1=\"155\" y1=\"56\" x2=\"199\" y2=\"56\" />\n",
" <line x1=\"156\" y1=\"57\" x2=\"199\" y2=\"57\" />\n",
" <line x1=\"156\" y1=\"57\" x2=\"200\" y2=\"57\" />\n",
" <line x1=\"157\" y1=\"58\" x2=\"200\" y2=\"58\" />\n",
" <line x1=\"158\" y1=\"59\" x2=\"201\" y2=\"59\" />\n",
" <line x1=\"158\" y1=\"59\" x2=\"201\" y2=\"59\" />\n",
" <line x1=\"159\" y1=\"60\" x2=\"202\" y2=\"60\" />\n",
" <line x1=\"159\" y1=\"60\" x2=\"202\" y2=\"60\" />\n",
" <line x1=\"160\" y1=\"61\" x2=\"203\" y2=\"61\" />\n",
" <line x1=\"160\" y1=\"61\" x2=\"204\" y2=\"61\" />\n",
" <line x1=\"161\" y1=\"62\" x2=\"204\" y2=\"62\" />\n",
" <line x1=\"161\" y1=\"62\" x2=\"205\" y2=\"62\" />\n",
" <line x1=\"162\" y1=\"63\" x2=\"205\" y2=\"63\" />\n",
" <line x1=\"162\" y1=\"63\" x2=\"206\" y2=\"63\" />\n",
" <line x1=\"163\" y1=\"64\" x2=\"206\" y2=\"64\" />\n",
" <line x1=\"164\" y1=\"65\" x2=\"207\" y2=\"65\" />\n",
" <line x1=\"164\" y1=\"65\" x2=\"207\" y2=\"65\" />\n",
" <line x1=\"165\" y1=\"66\" x2=\"208\" y2=\"66\" />\n",
" <line x1=\"165\" y1=\"66\" x2=\"209\" y2=\"66\" />\n",
" <line x1=\"166\" y1=\"67\" x2=\"209\" y2=\"67\" />\n",
" <line x1=\"166\" y1=\"67\" x2=\"210\" y2=\"67\" />\n",
" <line x1=\"167\" y1=\"68\" x2=\"210\" y2=\"68\" />\n",
" <line x1=\"167\" y1=\"68\" x2=\"211\" y2=\"68\" />\n",
" <line x1=\"168\" y1=\"69\" x2=\"211\" y2=\"69\" />\n",
" <line x1=\"169\" y1=\"70\" x2=\"212\" y2=\"70\" />\n",
" <line x1=\"169\" y1=\"70\" x2=\"212\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"99\" y1=\"0\" x2=\"169\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"142\" y1=\"0\" x2=\"212\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"99.000000,0.000000 142.324317,0.000000 212.912552,70.588235 169.588235,70.588235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"169\" y1=\"70\" x2=\"212\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"169\" y1=\"138\" x2=\"212\" y2=\"138\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"169\" y1=\"70\" x2=\"169\" y2=\"138\" style=\"stroke-width:2\" />\n",
" <line x1=\"212\" y1=\"70\" x2=\"212\" y2=\"138\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"169.588235,70.588235 212.912552,70.588235 212.912552,138.088235 169.588235,138.088235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"191.250394\" y=\"158.088235\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >36</text>\n",
" <text x=\"232.912552\" y=\"104.338235\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,232.912552,104.338235)\">72</text>\n",
" <text x=\"124.294118\" y=\"122.794118\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,124.294118,122.794118)\">128</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"dask.array<concatenate, shape=(3, 128, 72, 36), dtype=float64, chunksize=(1, 1, 72, 36), chunktype=numpy.ndarray>"
]
},
"execution_count": 75,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"huge_uskill.data"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 8.8 s, sys: 688 ms, total: 9.49 s\n",
"Wall time: 14.2 s\n"
]
}
],
"source": [
"%time huge_uskillc = huge_skill.compute()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### persistence"
]
},
{
"cell_type": "code",
"execution_count": 78,
"metadata": {},
"outputs": [],
"source": [
"from climpred.prediction import compute_persistence"
]
},
{
"cell_type": "code",
"execution_count": 79,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 60.42 GB </td> <td> 188.80 MB </td></tr>\n",
" <tr><th> Shape </th><td> (64, 10, 59, 200, 200, 5) </td> <td> (1, 10, 59, 200, 200, 1) </td></tr>\n",
" <tr><th> Count </th><td> 965 Tasks </td><td> 320 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"448\" height=\"240\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"34\" x2=\"35\" y2=\"60\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"34\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"34\" />\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"35\" />\n",
" <line x1=\"11\" y1=\"1\" x2=\"11\" y2=\"35\" />\n",
" <line x1=\"11\" y1=\"1\" x2=\"11\" y2=\"36\" />\n",
" <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"36\" />\n",
" <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"36\" />\n",
" <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"37\" />\n",
" <line x1=\"13\" y1=\"3\" x2=\"13\" y2=\"37\" />\n",
" <line x1=\"13\" y1=\"3\" x2=\"13\" y2=\"38\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"38\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"38\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"39\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"15\" y2=\"39\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"15\" y2=\"40\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"16\" y2=\"40\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"16\" y2=\"40\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"16\" y2=\"41\" />\n",
" <line x1=\"17\" y1=\"7\" x2=\"17\" y2=\"41\" />\n",
" <line x1=\"17\" y1=\"7\" x2=\"17\" y2=\"42\" />\n",
" <line x1=\"18\" y1=\"8\" x2=\"18\" y2=\"42\" />\n",
" <line x1=\"18\" y1=\"8\" x2=\"18\" y2=\"42\" />\n",
" <line x1=\"18\" y1=\"8\" x2=\"18\" y2=\"43\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"43\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"44\" />\n",
" <line x1=\"20\" y1=\"10\" x2=\"20\" y2=\"44\" />\n",
" <line x1=\"20\" y1=\"10\" x2=\"20\" y2=\"44\" />\n",
" <line x1=\"20\" y1=\"10\" x2=\"20\" y2=\"45\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"45\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"46\" />\n",
" <line x1=\"22\" y1=\"12\" x2=\"22\" y2=\"46\" />\n",
" <line x1=\"22\" y1=\"12\" x2=\"22\" y2=\"46\" />\n",
" <line x1=\"22\" y1=\"12\" x2=\"22\" y2=\"47\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"23\" y2=\"47\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"23\" y2=\"48\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"48\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"48\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"49\" />\n",
" <line x1=\"25\" y1=\"15\" x2=\"25\" y2=\"49\" />\n",
" <line x1=\"25\" y1=\"15\" x2=\"25\" y2=\"50\" />\n",
" <line x1=\"26\" y1=\"16\" x2=\"26\" y2=\"50\" />\n",
" <line x1=\"26\" y1=\"16\" x2=\"26\" y2=\"50\" />\n",
" <line x1=\"26\" y1=\"16\" x2=\"26\" y2=\"51\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"51\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"52\" />\n",
" <line x1=\"28\" y1=\"18\" x2=\"28\" y2=\"52\" />\n",
" <line x1=\"28\" y1=\"18\" x2=\"28\" y2=\"53\" />\n",
" <line x1=\"28\" y1=\"18\" x2=\"28\" y2=\"53\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"29\" y2=\"53\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"29\" y2=\"54\" />\n",
" <line x1=\"30\" y1=\"20\" x2=\"30\" y2=\"54\" />\n",
" <line x1=\"30\" y1=\"20\" x2=\"30\" y2=\"55\" />\n",
" <line x1=\"30\" y1=\"20\" x2=\"30\" y2=\"55\" />\n",
" <line x1=\"31\" y1=\"21\" x2=\"31\" y2=\"55\" />\n",
" <line x1=\"31\" y1=\"21\" x2=\"31\" y2=\"56\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"56\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"57\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"57\" />\n",
" <line x1=\"33\" y1=\"23\" x2=\"33\" y2=\"57\" />\n",
" <line x1=\"33\" y1=\"23\" x2=\"33\" y2=\"58\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"34\" y2=\"58\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"34\" y2=\"59\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"34\" y2=\"59\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"59\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"60\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.000000,0.000000 35.739099,25.739099 35.739099,60.240116 10.000000,34.501016\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"53\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"0\" x2=\"53\" y2=\"0\" />\n",
" <line x1=\"10\" y1=\"0\" x2=\"54\" y2=\"0\" />\n",
" <line x1=\"11\" y1=\"1\" x2=\"54\" y2=\"1\" />\n",
" <line x1=\"11\" y1=\"1\" x2=\"55\" y2=\"1\" />\n",
" <line x1=\"12\" y1=\"2\" x2=\"55\" y2=\"2\" />\n",
" <line x1=\"12\" y1=\"2\" x2=\"55\" y2=\"2\" />\n",
" <line x1=\"12\" y1=\"2\" x2=\"56\" y2=\"2\" />\n",
" <line x1=\"13\" y1=\"3\" x2=\"56\" y2=\"3\" />\n",
" <line x1=\"13\" y1=\"3\" x2=\"57\" y2=\"3\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"57\" y2=\"4\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"57\" y2=\"4\" />\n",
" <line x1=\"14\" y1=\"4\" x2=\"58\" y2=\"4\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"58\" y2=\"5\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"59\" y2=\"5\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"59\" y2=\"6\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"59\" y2=\"6\" />\n",
" <line x1=\"16\" y1=\"6\" x2=\"60\" y2=\"6\" />\n",
" <line x1=\"17\" y1=\"7\" x2=\"60\" y2=\"7\" />\n",
" <line x1=\"17\" y1=\"7\" x2=\"61\" y2=\"7\" />\n",
" <line x1=\"18\" y1=\"8\" x2=\"61\" y2=\"8\" />\n",
" <line x1=\"18\" y1=\"8\" x2=\"61\" y2=\"8\" />\n",
" <line x1=\"18\" y1=\"8\" x2=\"62\" y2=\"8\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"62\" y2=\"9\" />\n",
" <line x1=\"19\" y1=\"9\" x2=\"63\" y2=\"9\" />\n",
" <line x1=\"20\" y1=\"10\" x2=\"63\" y2=\"10\" />\n",
" <line x1=\"20\" y1=\"10\" x2=\"63\" y2=\"10\" />\n",
" <line x1=\"20\" y1=\"10\" x2=\"64\" y2=\"10\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"64\" y2=\"11\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"65\" y2=\"11\" />\n",
" <line x1=\"22\" y1=\"12\" x2=\"65\" y2=\"12\" />\n",
" <line x1=\"22\" y1=\"12\" x2=\"65\" y2=\"12\" />\n",
" <line x1=\"22\" y1=\"12\" x2=\"66\" y2=\"12\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"66\" y2=\"13\" />\n",
" <line x1=\"23\" y1=\"13\" x2=\"67\" y2=\"13\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"67\" y2=\"14\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"67\" y2=\"14\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"68\" y2=\"14\" />\n",
" <line x1=\"25\" y1=\"15\" x2=\"68\" y2=\"15\" />\n",
" <line x1=\"25\" y1=\"15\" x2=\"69\" y2=\"15\" />\n",
" <line x1=\"26\" y1=\"16\" x2=\"69\" y2=\"16\" />\n",
" <line x1=\"26\" y1=\"16\" x2=\"69\" y2=\"16\" />\n",
" <line x1=\"26\" y1=\"16\" x2=\"70\" y2=\"16\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"70\" y2=\"17\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"71\" y2=\"17\" />\n",
" <line x1=\"28\" y1=\"18\" x2=\"71\" y2=\"18\" />\n",
" <line x1=\"28\" y1=\"18\" x2=\"71\" y2=\"18\" />\n",
" <line x1=\"28\" y1=\"18\" x2=\"72\" y2=\"18\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"72\" y2=\"19\" />\n",
" <line x1=\"29\" y1=\"19\" x2=\"73\" y2=\"19\" />\n",
" <line x1=\"30\" y1=\"20\" x2=\"73\" y2=\"20\" />\n",
" <line x1=\"30\" y1=\"20\" x2=\"73\" y2=\"20\" />\n",
" <line x1=\"30\" y1=\"20\" x2=\"74\" y2=\"20\" />\n",
" <line x1=\"31\" y1=\"21\" x2=\"74\" y2=\"21\" />\n",
" <line x1=\"31\" y1=\"21\" x2=\"75\" y2=\"21\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"75\" y2=\"22\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"76\" y2=\"22\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"76\" y2=\"22\" />\n",
" <line x1=\"33\" y1=\"23\" x2=\"76\" y2=\"23\" />\n",
" <line x1=\"33\" y1=\"23\" x2=\"77\" y2=\"23\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"77\" y2=\"24\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"78\" y2=\"24\" />\n",
" <line x1=\"34\" y1=\"24\" x2=\"78\" y2=\"24\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"78\" y2=\"25\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"79\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"53\" y1=\"0\" x2=\"79\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.000000,0.000000 53.488249,0.000000 79.227349,25.739099 35.739099,25.739099\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"35\" y1=\"25\" x2=\"79\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"35\" y1=\"60\" x2=\"79\" y2=\"60\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"60\" style=\"stroke-width:2\" />\n",
" <line x1=\"79\" y1=\"25\" x2=\"79\" y2=\"60\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"35.739099,25.739099 79.227349,25.739099 79.227349,60.240116 35.739099,60.240116\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"57.483224\" y=\"80.240116\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >59</text>\n",
" <text x=\"99.227349\" y=\"42.989608\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,99.227349,42.989608)\">10</text>\n",
" <text x=\"12.869550\" y=\"67.370566\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,12.869550,67.370566)\">64</text>\n",
"\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"149\" y1=\"0\" x2=\"219\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"149\" y1=\"120\" x2=\"219\" y2=\"190\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"149\" y1=\"0\" x2=\"149\" y2=\"120\" style=\"stroke-width:2\" />\n",
" <line x1=\"219\" y1=\"70\" x2=\"219\" y2=\"190\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"149.000000,0.000000 219.588235,70.588235 219.588235,190.588235 149.000000,120.000000\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"149\" y1=\"0\" x2=\"179\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"219\" y1=\"70\" x2=\"249\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"149\" y1=\"0\" x2=\"219\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"155\" y1=\"0\" x2=\"225\" y2=\"70\" />\n",
" <line x1=\"161\" y1=\"0\" x2=\"231\" y2=\"70\" />\n",
" <line x1=\"167\" y1=\"0\" x2=\"237\" y2=\"70\" />\n",
" <line x1=\"173\" y1=\"0\" x2=\"243\" y2=\"70\" />\n",
" <line x1=\"179\" y1=\"0\" x2=\"249\" y2=\"70\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"149.000000,0.000000 179.311400,0.000000 249.899635,70.588235 219.588235,70.588235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"219\" y1=\"70\" x2=\"249\" y2=\"70\" style=\"stroke-width:2\" />\n",
" <line x1=\"219\" y1=\"190\" x2=\"249\" y2=\"190\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"219\" y1=\"70\" x2=\"219\" y2=\"190\" style=\"stroke-width:2\" />\n",
" <line x1=\"225\" y1=\"70\" x2=\"225\" y2=\"190\" />\n",
" <line x1=\"231\" y1=\"70\" x2=\"231\" y2=\"190\" />\n",
" <line x1=\"237\" y1=\"70\" x2=\"237\" y2=\"190\" />\n",
" <line x1=\"243\" y1=\"70\" x2=\"243\" y2=\"190\" />\n",
" <line x1=\"249\" y1=\"70\" x2=\"249\" y2=\"190\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"219.588235,70.588235 249.899635,70.588235 249.899635,190.588235 219.588235,190.588235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"234.743935\" y=\"210.588235\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >5</text>\n",
" <text x=\"269.899635\" y=\"130.588235\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,269.899635,130.588235)\">200</text>\n",
" <text x=\"174.294118\" y=\"175.294118\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,174.294118,175.294118)\">200</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"dask.array<concatenate, shape=(64, 10, 59, 200, 200, 5), dtype=float64, chunksize=(1, 10, 59, 200, 200, 1), chunktype=numpy.ndarray>"
]
},
"execution_count": 79,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"huge_hind.data"
]
},
{
"cell_type": "code",
"execution_count": 80,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'metric': 'mse'}"
]
},
"execution_count": 80,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"kwp = kw.copy()\n",
"kwp.pop(\"comparison\")\n",
"kwp"
]
},
{
"cell_type": "code",
"execution_count": 52,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 208 ms, sys: 45 ms, total: 253 ms\n",
"Wall time: 213 ms\n"
]
}
],
"source": [
"%time huge_pers = compute_persistence(huge_hind, obs, **kwp)"
]
},
{
"cell_type": "code",
"execution_count": 82,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 1.60 MB </td> <td> 320.00 kB </td></tr>\n",
" <tr><th> Shape </th><td> (5, 200, 200) </td> <td> (1, 200, 200) </td></tr>\n",
" <tr><th> Count </th><td> 30 Tasks </td><td> 5 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"197\" height=\"187\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"27\" y2=\"17\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"120\" x2=\"27\" y2=\"137\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"120\" style=\"stroke-width:2\" />\n",
" <line x1=\"13\" y1=\"3\" x2=\"13\" y2=\"123\" />\n",
" <line x1=\"17\" y1=\"7\" x2=\"17\" y2=\"127\" />\n",
" <line x1=\"20\" y1=\"10\" x2=\"20\" y2=\"130\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"134\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"137\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.000000,0.000000 27.830235,17.830235 27.830235,137.830235 10.000000,120.000000\" 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=\"13\" y1=\"3\" x2=\"133\" y2=\"3\" />\n",
" <line x1=\"17\" y1=\"7\" x2=\"137\" y2=\"7\" />\n",
" <line x1=\"20\" y1=\"10\" x2=\"140\" y2=\"10\" />\n",
" <line x1=\"24\" y1=\"14\" x2=\"144\" y2=\"14\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"147\" y2=\"17\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"27\" y2=\"17\" style=\"stroke-width:2\" />\n",
" <line x1=\"130\" y1=\"0\" x2=\"147\" y2=\"17\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.000000,0.000000 130.000000,0.000000 147.830235,17.830235 27.830235,17.830235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"27\" y1=\"17\" x2=\"147\" y2=\"17\" style=\"stroke-width:2\" />\n",
" <line x1=\"27\" y1=\"137\" x2=\"147\" y2=\"137\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"137\" style=\"stroke-width:2\" />\n",
" <line x1=\"147\" y1=\"17\" x2=\"147\" y2=\"137\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"27.830235,17.830235 147.830235,17.830235 147.830235,137.830235 27.830235,137.830235\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"87.830235\" y=\"157.830235\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >200</text>\n",
" <text x=\"167.830235\" y=\"77.830235\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,167.830235,77.830235)\">200</text>\n",
" <text x=\"8.915118\" y=\"148.915118\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,8.915118,148.915118)\">5</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"dask.array<concatenate, shape=(5, 200, 200), dtype=float64, chunksize=(1, 200, 200), chunktype=numpy.ndarray>"
]
},
"execution_count": 82,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"huge_pers.data"
]
},
{
"cell_type": "code",
"execution_count": 54,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 265 ms, sys: 180 ms, total: 445 ms\n",
"Wall time: 187 ms\n"
]
}
],
"source": [
"%time huge_persc = huge_pers.compute()"
]
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<pre>&lt;xarray.DataArray (lead: 5, lon: 200, lat: 200)&gt;\n",
"dask.array&lt;concatenate, shape=(5, 200, 200), dtype=float64, chunksize=(1, 200, 200), chunktype=numpy.ndarray&gt;\n",
"Coordinates:\n",
" * lat (lat) int64 0 1 2 3 4 5 6 7 8 ... 192 193 194 195 196 197 198 199\n",
" * lon (lon) int64 0 1 2 3 4 5 6 7 8 ... 192 193 194 195 196 197 198 199\n",
" * lead (lead) int64 1 2 3 4 5</pre>"
],
"text/plain": [
"<xarray.DataArray (lead: 5, lon: 200, lat: 200)>\n",
"dask.array<concatenate, shape=(5, 200, 200), dtype=float64, chunksize=(1, 200, 200), chunktype=numpy.ndarray>\n",
"Coordinates:\n",
" * lat (lat) int64 0 1 2 3 4 5 6 7 8 ... 192 193 194 195 196 197 198 199\n",
" * lon (lon) int64 0 1 2 3 4 5 6 7 8 ... 192 193 194 195 196 197 198 199\n",
" * lead (lead) int64 1 2 3 4 5"
]
},
"execution_count": 56,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"huge_pers"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## rebuild bootstrap_hindcast"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
"# bootstrap_hindcast??"
]
},
{
"cell_type": "code",
"execution_count": 76,
"metadata": {},
"outputs": [],
"source": [
"from climpred.utils import (\n",
" _transpose_and_rechunk_to,\n",
" assign_attrs,\n",
" convert_time_index,\n",
" get_comparison_class,\n",
" get_lead_cftime_shift_args,\n",
" get_metric_class,\n",
" shift_cftime_singular,\n",
")\n",
"\n",
"from climpred.checks import (\n",
" has_dims,\n",
" has_valid_lead_units,\n",
" warn_if_chunking_would_increase_performance,\n",
")\n",
"\n",
"from climpred.comparisons import ALL_COMPARISONS, COMPARISON_ALIASES\n",
"from climpred.metrics import ALL_METRICS, METRIC_ALIASES\n",
"from climpred.prediction import (\n",
" compute_hindcast,\n",
" compute_perfect_model,\n",
" compute_persistence,\n",
")\n",
"\n",
"from climpred.bootstrap import (\n",
" _resample,\n",
" my_quantile,\n",
" _distribution_to_ci,\n",
" _pvalue_from_distributions,\n",
")\n",
"import inspect\n",
"\n",
"\n",
"def bootstrap_hindcast(\n",
" hind,\n",
" hist,\n",
" verif,\n",
" metric=\"pearson_r\",\n",
" comparison=\"e2o\",\n",
" dim=\"init\",\n",
" sig=95,\n",
" bootstrap=500,\n",
" pers_sig=None,\n",
" resample_dim=\"init\", # new\n",
" **metric_kwargs,\n",
"):\n",
" \"\"\"Bootstrap compute with replacement. Wrapper of\n",
" py:func:`bootstrap_compute` for hindcasts.\n",
"\n",
" Args:\n",
" hind (xr.Dataset): prediction ensemble.\n",
" verif (xr.Dataset): Verification data.\n",
" hist (xr.Dataset): historical/uninitialized simulation.\n",
" metric (str): `metric`. Defaults to 'pearson_r'.\n",
" comparison (str): `comparison`. Defaults to 'e2o'.\n",
" dim (str): dimension to apply metric over. default: 'init'\n",
" sig (int): Significance level for uninitialized and\n",
" initialized skill. Defaults to 95.\n",
" pers_sig (int): Significance level for persistence skill confidence levels.\n",
" Defaults to sig.\n",
" bootstrap (int): number of resampling iterations (bootstrap\n",
" with replacement). Defaults to 500.\n",
" ** metric_kwargs (dict): additional keywords to be passed to metric\n",
" (see the arguments required for a given metric in :ref:`Metrics`).\n",
"\n",
" Returns:\n",
" results: (xr.Dataset): bootstrapped results\n",
" * init_ci (xr.Dataset): confidence levels of init_skill\n",
" * uninit_ci (xr.Dataset): confidence levels of uninit_skill\n",
" * p_uninit_over_init (xr.Dataset): p value of the hypothesis\n",
" that the difference of\n",
" skill between the\n",
" initialized and uninitialized\n",
" simulations is smaller or\n",
" equal to zero based on\n",
" bootstrapping with\n",
" replacement.\n",
" Defaults to None.\n",
" * pers_ci (xr.Dataset): confidence levels of pers_skill\n",
" * p_pers_over_init (xr.Dataset): p value of the hypothesis\n",
" that the difference of\n",
" skill between the\n",
" initialized and persistence\n",
" simulations is smaller or\n",
" equal to zero based on\n",
" bootstrapping with\n",
" replacement.\n",
" Defaults to None.\n",
"\n",
" Reference:\n",
" * Goddard, L., A. Kumar, A. Solomon, D. Smith, G. Boer, P.\n",
" Gonzalez, V. Kharin, et al. “A Verification Framework for\n",
" Interannual-to-Decadal Predictions Experiments.” Climate\n",
" Dynamics 40, no. 1–2 (January 1, 2013): 245–72.\n",
" https://doi.org/10/f4jjvf.\n",
"\n",
" See also:\n",
" * climpred.bootstrap.bootstrap_compute\n",
" * climpred.prediction.compute_hindcast\n",
" \"\"\"\n",
" # Check that init is int, cftime, or datetime; convert ints or cftime to datetime.\n",
" hind = convert_time_index(hind, \"init\", \"hind[init]\")\n",
" hist = convert_time_index(hist, \"time\", \"uninitialized[time]\")\n",
" verif = convert_time_index(verif, \"time\", \"verif[time]\")\n",
" # Put this after `convert_time_index` since it assigns 'years' attribute if the\n",
" # `init` dimension is a `float` or `int`.\n",
" has_valid_lead_units(hind)\n",
"\n",
" return bootstrap_compute(\n",
" hind,\n",
" verif,\n",
" hist=hist,\n",
" metric=metric,\n",
" comparison=comparison,\n",
" dim=dim,\n",
" sig=sig,\n",
" bootstrap=bootstrap,\n",
" pers_sig=pers_sig,\n",
" compute=compute_hindcast,\n",
" resample_uninit=bootstrap_uninitialized_ensemble,\n",
" resample_dim=resample_dim, # new\n",
" **metric_kwargs,\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": 77,
"metadata": {},
"outputs": [],
"source": [
"# bootstrap_compute??"
]
},
{
"cell_type": "code",
"execution_count": 80,
"metadata": {},
"outputs": [],
"source": [
"def bootstrap_compute(\n",
" hind,\n",
" verif,\n",
" hist=None,\n",
" metric=\"pearson_r\",\n",
" comparison=\"m2e\",\n",
" dim=\"init\",\n",
" sig=95,\n",
" bootstrap=500,\n",
" pers_sig=None,\n",
" compute=compute_hindcast,\n",
" resample_uninit=bootstrap_uninitialized_ensemble,\n",
" resample_dim=\"init\", # new\n",
" **metric_kwargs,\n",
"):\n",
" \"\"\"Bootstrap compute with replacement.\n",
"\n",
" Args:\n",
" hind (xr.Dataset): prediction ensemble.\n",
" verif (xr.Dataset): Verification data.\n",
" hist (xr.Dataset): historical/uninitialized simulation.\n",
" metric (str): `metric`. Defaults to 'pearson_r'.\n",
" comparison (str): `comparison`. Defaults to 'm2e'.\n",
" dim (str or list): dimension to apply metric over. default: 'init'\n",
" sig (int): Significance level for uninitialized and\n",
" initialized skill. Defaults to 95.\n",
" pers_sig (int): Significance level for persistence skill confidence levels.\n",
" Defaults to sig.\n",
" bootstrap (int): number of resampling iterations (bootstrap\n",
" with replacement). Defaults to 500.\n",
" compute (func): function to compute skill.\n",
" Choose from\n",
" [:py:func:`climpred.prediction.compute_perfect_model`,\n",
" :py:func:`climpred.prediction.compute_hindcast`].\n",
" resample_uninit (func): function to create an uninitialized ensemble\n",
" from a control simulation or uninitialized large\n",
" ensemble. Choose from:\n",
" [:py:func:`bootstrap_uninitialized_ensemble`,\n",
" :py:func:`bootstrap_uninit_pm_ensemble_from_control`].\n",
" ** metric_kwargs (dict): additional keywords to be passed to metric\n",
" (see the arguments required for a given metric in :ref:`Metrics`).\n",
"\n",
" Returns:\n",
" results: (xr.Dataset): bootstrapped results\n",
" * init_ci (xr.Dataset): confidence levels of init_skill\n",
" * uninit_ci (xr.Dataset): confidence levels of uninit_skill\n",
" * p_uninit_over_init (xr.Dataset): p value of the hypothesis\n",
" that the difference of\n",
" skill between the\n",
" initialized and uninitialized\n",
" simulations is smaller or\n",
" equal to zero based on\n",
" bootstrapping with\n",
" replacement.\n",
" Defaults to None.\n",
" * pers_ci (xr.Dataset): confidence levels of pers_skill\n",
" * p_pers_over_init (xr.Dataset): p value of the hypothesis\n",
" that the difference of\n",
" skill between the\n",
" initialized and persistence\n",
" simulations is smaller or\n",
" equal to zero based on\n",
" bootstrapping with\n",
" replacement.\n",
" Defaults to None.\n",
"\n",
" Reference:\n",
" * Goddard, L., A. Kumar, A. Solomon, D. Smith, G. Boer, P.\n",
" Gonzalez, V. Kharin, et al. “A Verification Framework for\n",
" Interannual-to-Decadal Predictions Experiments.” Climate\n",
" Dynamics 40, no. 1–2 (January 1, 2013): 245–72.\n",
" https://doi.org/10/f4jjvf.\n",
"\n",
" See also:\n",
" * climpred.bootstrap.bootstrap_hindcast\n",
" * climpred.bootstrap.bootstrap_perfect_model\n",
" \"\"\"\n",
" warn_if_chunking_would_increase_performance(hind)\n",
" if pers_sig is None:\n",
" pers_sig = sig\n",
"\n",
" p = (100 - sig) / 100\n",
" ci_low = p / 2\n",
" ci_high = 1 - p / 2\n",
" p_pers = (100 - pers_sig) / 100\n",
" ci_low_pers = p_pers / 2\n",
" ci_high_pers = 1 - p_pers / 2\n",
"\n",
" init = []\n",
" uninit = []\n",
" pers = []\n",
"\n",
" # get metric/comparison function name, not the alias\n",
" metric = METRIC_ALIASES.get(metric, metric)\n",
" comparison = COMPARISON_ALIASES.get(comparison, comparison)\n",
"\n",
" # get class Metric(metric)\n",
" metric = get_metric_class(metric, ALL_METRICS)\n",
" # get comparison function\n",
" comparison = get_comparison_class(comparison, ALL_COMPARISONS)\n",
"\n",
" # which dim should be resampled: member or init\n",
" # if dim == \"member\" and \"member\" in hind.dims:\n",
" # members = hind.member.values\n",
" # to_be_shuffled = members\n",
" # shuffle_dim = \"member\"\n",
" # elif \"init\" in dim and \"init\" in hind.dims:\n",
" # # also allows ['init','member']\n",
" # inits = hind.init.values\n",
" # to_be_shuffled = inits\n",
" # shuffle_dim = \"init\"\n",
" # else:\n",
" # raise ValueError(\"Shuffle either `member` or `init`; not\", dim)\n",
"\n",
" shuffle_dim = resample_dim\n",
" to_be_shuffled = hind[shuffle_dim]\n",
"\n",
" for i in range(bootstrap):\n",
" # resample with replacement\n",
" smp_hind = _resample(hind, shuffle_dim, to_be_shuffled)\n",
" # compute init skill\n",
" init_skill = compute(\n",
" smp_hind,\n",
" verif,\n",
" metric=metric,\n",
" comparison=comparison,\n",
" add_attrs=False,\n",
" dim=dim,\n",
" **metric_kwargs,\n",
" )\n",
" # reset inits when probabilistic, otherwise tests fail\n",
" if (\n",
" shuffle_dim == \"init\"\n",
" and metric.probabilistic\n",
" and \"init\" in init_skill.coords\n",
" ):\n",
" init_skill[\"init\"] = inits\n",
" init.append(init_skill)\n",
" # generate uninitialized ensemble from hist\n",
" if hist is None: # PM path, use verif = control\n",
" hist = verif\n",
" uninit_hind = resample_uninit(hind, hist)\n",
" # compute uninit skill\n",
" uninit.append(\n",
" compute(\n",
" uninit_hind,\n",
" verif,\n",
" metric=metric,\n",
" comparison=comparison,\n",
" dim=dim,\n",
" add_attrs=False,\n",
" **metric_kwargs,\n",
" )\n",
" )\n",
" # compute persistence skill\n",
" # impossible for probabilistic\n",
" if not metric.probabilistic:\n",
" if resample_dim is not \"member\":\n",
" pers.append(\n",
" compute_persistence(smp_hind, verif, metric=metric, **metric_kwargs)\n",
" )\n",
" init = xr.concat(init, dim=\"bootstrap\")\n",
" # remove useless member = 0 coords after m2c\n",
" if \"member\" in init.coords and init.member.size == 1:\n",
" if init.member.size == 1:\n",
" del init[\"member\"]\n",
" uninit = xr.concat(uninit, dim=\"bootstrap\")\n",
" # when persistence is not computed set flag\n",
" if pers != []:\n",
" pers = xr.concat(pers, dim=\"bootstrap\")\n",
" pers_output = True\n",
" else:\n",
" pers_output = False\n",
"\n",
" # get confidence intervals CI\n",
" init_ci = _distribution_to_ci(init, ci_low, ci_high)\n",
" uninit_ci = _distribution_to_ci(uninit, ci_low, ci_high)\n",
" # probabilistic metrics wont have persistence forecast\n",
" # therefore only get CI if persistence was computed\n",
" if pers_output:\n",
" if set(pers.coords) != set(init.coords):\n",
" init, pers = xr.broadcast(init, pers)\n",
" pers_ci = _distribution_to_ci(pers, ci_low_pers, ci_high_pers)\n",
" else:\n",
" # otherwise set all persistence outputs to false\n",
" pers = init.isnull()\n",
" pers_ci = init_ci == -999\n",
"\n",
" # pvalue whether uninit or pers better than init forecast\n",
" p_uninit_over_init = _pvalue_from_distributions(uninit, init, metric=metric)\n",
" p_pers_over_init = _pvalue_from_distributions(pers, init, metric=metric)\n",
"\n",
" # calc mean skill without any resampling\n",
" init_skill = compute(\n",
" hind, verif, metric=metric, comparison=comparison, dim=dim, **metric_kwargs,\n",
" )\n",
" if \"init\" in init_skill:\n",
" init_skill = init_skill.mean(\"init\")\n",
" # remove useless member = 0 coords after m2c\n",
" if \"member\" in init_skill.coords and init_skill.member.size == 1:\n",
" del init_skill[\"member\"]\n",
" # uninit skill as mean resampled uninit skill\n",
" uninit_skill = uninit.mean(\"bootstrap\")\n",
" if not metric.probabilistic:\n",
" pers_skill = compute_persistence(hind, verif, metric=metric, **metric_kwargs)\n",
" else:\n",
" pers_skill = init_skill.isnull()\n",
" # align to prepare for concat\n",
" if set(pers_skill.coords) != set(init_skill.coords):\n",
" init_skill, pers_skill = xr.broadcast(init_skill, pers_skill)\n",
"\n",
" # wrap results together in one dataarray\n",
" skill = xr.concat([init_skill, uninit_skill, pers_skill], \"kind\")\n",
" skill[\"kind\"] = [\"init\", \"uninit\", \"pers\"]\n",
"\n",
" # probability that i beats init\n",
" p = xr.concat([p_uninit_over_init, p_pers_over_init], \"kind\")\n",
" p[\"kind\"] = [\"uninit\", \"pers\"]\n",
"\n",
" # ci for each skill\n",
" ci = xr.concat([init_ci, uninit_ci, pers_ci], \"kind\").rename(\n",
" {\"quantile\": \"results\"}\n",
" )\n",
" ci[\"kind\"] = [\"init\", \"uninit\", \"pers\"]\n",
"\n",
" results = xr.concat([skill, p], \"results\")\n",
" results[\"results\"] = [\"skill\", \"p\"]\n",
" if set(results.coords) != set(ci.coords):\n",
" res_drop = [c for c in results.coords if c not in ci.coords]\n",
" ci_drop = [c for c in ci.coords if c not in results.coords]\n",
" results = results.drop_vars(res_drop)\n",
" ci = ci.drop_vars(ci_drop)\n",
" results = xr.concat([results, ci], \"results\")\n",
" results[\"results\"] = [\"skill\", \"p\", \"low_ci\", \"high_ci\"]\n",
" # Attach climpred compute information to skill\n",
" metadata_dict = {\n",
" \"confidence_interval_levels\": f\"{ci_high}-{ci_low}\",\n",
" \"bootstrap_iterations\": bootstrap,\n",
" \"p\": \"probability that initialized forecast performs \\\n",
" better than verification data\",\n",
" }\n",
" metadata_dict.update(metric_kwargs)\n",
" results = assign_attrs(\n",
" results,\n",
" hind,\n",
" metric=metric,\n",
" comparison=comparison,\n",
" dim=dim,\n",
" function_name=inspect.stack()[0][3], # take function.__name__\n",
" metadata_dict=metadata_dict,\n",
" )\n",
" # Ensure that the lead units get carried along for the calculation. The attribute\n",
" # tends to get dropped along the way due to ``xarray`` functionality.\n",
" if \"units\" in hind[\"lead\"].attrs and \"units\" not in results[\"lead\"].attrs:\n",
" results[\"lead\"].attrs[\"units\"] = hind[\"lead\"].attrs[\"units\"]\n",
" return results"
]
},
{
"cell_type": "code",
"execution_count": 81,
"metadata": {},
"outputs": [],
"source": [
"kw = {\"metric\": \"acc\", \"comparison\": \"e2r\"}"
]
},
{
"cell_type": "code",
"execution_count": 91,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 1min 32s, sys: 11.2 s, total: 1min 43s\n",
"Wall time: 1min 31s\n"
]
}
],
"source": [
"%time bs = bootstrap_hindcast(hind, hist, obs, bootstrap=bootstrap, resample_dim='init', **kw)"
]
},
{
"cell_type": "code",
"execution_count": 92,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
"<tr>\n",
"<td>\n",
"<table>\n",
" <thead>\n",
" <tr><td> </td><th> Array </th><th> Chunk </th></tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr><th> Bytes </th><td> 746.50 kB </td> <td> 20.74 kB </td></tr>\n",
" <tr><th> Shape </th><td> (4, 3, 3, 72, 36) </td> <td> (1, 1, 1, 72, 36) </td></tr>\n",
" <tr><th> Count </th><td> 56234 Tasks </td><td> 36 Chunks </td></tr>\n",
" <tr><th> Type </th><td> float64 </td><td> numpy.ndarray </td></tr>\n",
" </tbody>\n",
"</table>\n",
"</td>\n",
"<td>\n",
"<svg width=\"335\" height=\"189\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"33\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"0\" y1=\"8\" x2=\"33\" y2=\"8\" />\n",
" <line x1=\"0\" y1=\"17\" x2=\"33\" y2=\"17\" />\n",
" <line x1=\"0\" y1=\"26\" x2=\"33\" y2=\"26\" />\n",
" <line x1=\"0\" y1=\"35\" x2=\"33\" y2=\"35\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"35\" style=\"stroke-width:2\" />\n",
" <line x1=\"11\" y1=\"0\" x2=\"11\" y2=\"35\" />\n",
" <line x1=\"22\" y1=\"0\" x2=\"22\" y2=\"35\" />\n",
" <line x1=\"33\" y1=\"0\" x2=\"33\" y2=\"35\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"0.000000,0.000000 33.383698,0.000000 33.383698,35.144829 0.000000,35.144829\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"16.691849\" y=\"55.144829\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >3</text>\n",
" <text x=\"53.383698\" y=\"17.572414\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,53.383698,17.572414)\">4</text>\n",
"\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"103\" y1=\"0\" x2=\"122\" y2=\"19\" style=\"stroke-width:2\" />\n",
" <line x1=\"103\" y1=\"120\" x2=\"122\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"103\" y1=\"0\" x2=\"103\" y2=\"120\" style=\"stroke-width:2\" />\n",
" <line x1=\"109\" y1=\"6\" x2=\"109\" y2=\"126\" />\n",
" <line x1=\"116\" y1=\"13\" x2=\"116\" y2=\"133\" />\n",
" <line x1=\"122\" y1=\"19\" x2=\"122\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"103.000000,0.000000 122.637470,19.637470 122.637470,139.637470 103.000000,120.000000\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"103\" y1=\"0\" x2=\"163\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"109\" y1=\"6\" x2=\"169\" y2=\"6\" />\n",
" <line x1=\"116\" y1=\"13\" x2=\"176\" y2=\"13\" />\n",
" <line x1=\"122\" y1=\"19\" x2=\"182\" y2=\"19\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"103\" y1=\"0\" x2=\"122\" y2=\"19\" style=\"stroke-width:2\" />\n",
" <line x1=\"163\" y1=\"0\" x2=\"182\" y2=\"19\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"103.000000,0.000000 163.000000,0.000000 182.637470,19.637470 122.637470,19.637470\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"122\" y1=\"19\" x2=\"182\" y2=\"19\" style=\"stroke-width:2\" />\n",
" <line x1=\"122\" y1=\"139\" x2=\"182\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"122\" y1=\"19\" x2=\"122\" y2=\"139\" style=\"stroke-width:2\" />\n",
" <line x1=\"182\" y1=\"19\" x2=\"182\" y2=\"139\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"122.637470,19.637470 182.637470,19.637470 182.637470,139.637470 122.637470,139.637470\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"152.637470\" y=\"159.637470\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >36</text>\n",
" <text x=\"202.637470\" y=\"79.637470\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,202.637470,79.637470)\">72</text>\n",
" <text x=\"102.818735\" y=\"149.818735\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,102.818735,149.818735)\">3</text>\n",
"</svg>\n",
"</td>\n",
"</tr>\n",
"</table>"
],
"text/plain": [
"dask.array<concatenate, shape=(4, 3, 3, 72, 36), dtype=float64, chunksize=(1, 1, 1, 72, 36), chunktype=numpy.ndarray>"
]
},
"execution_count": 92,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bs.data"
]
},
{
"cell_type": "code",
"execution_count": 93,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 2min 27s, sys: 45.5 s, total: 3min 13s\n",
"Wall time: 1min 4s\n"
]
}
],
"source": [
"%time bsc = bs.compute()"
]
},
{
"cell_type": "code",
"execution_count": 94,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(4, 3, 3, 72, 36)"
]
},
"execution_count": 94,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bsc.shape"
]
},
{
"cell_type": "code",
"execution_count": 95,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Coordinates:\n",
" * lat (lat) int64 0 1 2 3 4 5 6 7 8 9 ... 26 27 28 29 30 31 32 33 34 35\n",
" * lon (lon) int64 0 1 2 3 4 5 6 7 8 9 ... 62 63 64 65 66 67 68 69 70 71\n",
" * lead (lead) int64 1 2 3\n",
" * kind (kind) object 'init' 'pers' 'uninit'\n",
" * results (results) <U7 'skill' 'p' 'low_ci' 'high_ci'"
]
},
"execution_count": 95,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bsc.coords"
]
},
{
"cell_type": "code",
"execution_count": 96,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'prediction_skill': 'calculated by climpred https://climpred.readthedocs.io/',\n",
" 'skill_calculated_by_function': 'bootstrap_compute',\n",
" 'number_of_initializations': 59,\n",
" 'number_of_members': 34,\n",
" 'metric': 'pearson_r',\n",
" 'comparison': 'e2o',\n",
" 'dim': 'init',\n",
" 'units': 'None',\n",
" 'confidence_interval_levels': '0.975-0.025',\n",
" 'bootstrap_iterations': 128,\n",
" 'p': 'probability that initialized forecast performs better than verification data',\n",
" 'created': '2020-02-14 11:04:57'}"
]
},
"execution_count": 96,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bsc.attrs"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:climpred-dev]",
"language": "python",
"name": "conda-env-climpred-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.6.7"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment