|
1 | 1 | { |
2 | 2 | "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "metadata": { |
| 6 | + "toc": true |
| 7 | + }, |
| 8 | + "source": [ |
| 9 | + "<h1>Table of Contents<span class=\"tocSkip\"></span></h1>\n", |
| 10 | + "<div class=\"toc\"><ul class=\"toc-item\"><li><span><a href=\"#Introduction-to-cf_xarray\" data-toc-modified-id=\"Introduction-to-cf_xarray-1\"><span class=\"toc-item-num\">1 </span>Introduction to <code>cf_xarray</code></a></span><ul class=\"toc-item\"><li><span><a href=\"#What-attributes-have-been-discovered?\" data-toc-modified-id=\"What-attributes-have-been-discovered?-1.1\"><span class=\"toc-item-num\">1.1 </span>What attributes have been discovered?</a></span></li><li><span><a href=\"#Feature:-Accessing-coordinate-variables\" data-toc-modified-id=\"Feature:-Accessing-coordinate-variables-1.2\"><span class=\"toc-item-num\">1.2 </span>Feature: Accessing coordinate variables</a></span></li><li><span><a href=\"#Feature:-Rewriting-arguments\" data-toc-modified-id=\"Feature:-Rewriting-arguments-1.3\"><span class=\"toc-item-num\">1.3 </span>Feature: Rewriting arguments</a></span><ul class=\"toc-item\"><li><span><a href=\"#Slicing\" data-toc-modified-id=\"Slicing-1.3.1\"><span class=\"toc-item-num\">1.3.1 </span>Slicing</a></span></li><li><span><a href=\"#Reductions\" data-toc-modified-id=\"Reductions-1.3.2\"><span class=\"toc-item-num\">1.3.2 </span>Reductions</a></span></li><li><span><a href=\"#Plotting\" data-toc-modified-id=\"Plotting-1.3.3\"><span class=\"toc-item-num\">1.3.3 </span>Plotting</a></span></li><li><span><a href=\"#Resample-&-groupby\" data-toc-modified-id=\"Resample-&-groupby-1.3.4\"><span class=\"toc-item-num\">1.3.4 </span>Resample & groupby</a></span></li><li><span><a href=\"#Rolling-&-coarsen\" data-toc-modified-id=\"Rolling-&-coarsen-1.3.5\"><span class=\"toc-item-num\">1.3.5 </span>Rolling & coarsen</a></span><ul class=\"toc-item\"><li><span><a href=\"#miscellaneous-features\" data-toc-modified-id=\"miscellaneous-features-1.3.5.1\"><span class=\"toc-item-num\">1.3.5.1 </span>miscellaneous features</a></span></li></ul></li></ul></li><li><span><a href=\"#Feature:-Weight-by-Cell-Measures\" data-toc-modified-id=\"Feature:-Weight-by-Cell-Measures-1.4\"><span class=\"toc-item-num\">1.4 </span>Feature: Weight by Cell Measures</a></span></li></ul></li></ul></div>" |
| 11 | + ] |
| 12 | + }, |
3 | 13 | { |
4 | 14 | "cell_type": "markdown", |
5 | 15 | "metadata": {}, |
|
14 | 24 | "execution_count": null, |
15 | 25 | "metadata": { |
16 | 26 | "ExecuteTime": { |
17 | | - "end_time": "2020-06-12T20:35:44.967831Z", |
18 | | - "start_time": "2020-06-12T20:35:44.943306Z" |
| 27 | + "end_time": "2020-06-19T16:44:52.277430Z", |
| 28 | + "start_time": "2020-06-19T16:44:51.354881Z" |
19 | 29 | } |
20 | 30 | }, |
21 | 31 | "outputs": [], |
|
37 | 47 | "execution_count": null, |
38 | 48 | "metadata": { |
39 | 49 | "ExecuteTime": { |
40 | | - "end_time": "2020-06-12T20:33:37.322927Z", |
41 | | - "start_time": "2020-06-12T20:33:37.262000Z" |
| 50 | + "end_time": "2020-06-19T16:44:52.331138Z", |
| 51 | + "start_time": "2020-06-19T16:44:52.279190Z" |
42 | 52 | } |
43 | 53 | }, |
44 | 54 | "outputs": [], |
|
59 | 69 | "execution_count": null, |
60 | 70 | "metadata": { |
61 | 71 | "ExecuteTime": { |
62 | | - "end_time": "2020-06-12T20:40:55.378756Z", |
63 | | - "start_time": "2020-06-12T20:40:55.338717Z" |
| 72 | + "end_time": "2020-06-19T16:44:52.399087Z", |
| 73 | + "start_time": "2020-06-19T16:44:52.333063Z" |
64 | 74 | } |
65 | 75 | }, |
66 | 76 | "outputs": [], |
|
94 | 104 | { |
95 | 105 | "cell_type": "code", |
96 | 106 | "execution_count": null, |
97 | | - "metadata": {}, |
| 107 | + "metadata": { |
| 108 | + "ExecuteTime": { |
| 109 | + "end_time": "2020-06-19T16:44:52.449912Z", |
| 110 | + "start_time": "2020-06-19T16:44:52.400460Z" |
| 111 | + } |
| 112 | + }, |
98 | 113 | "outputs": [], |
99 | 114 | "source": [ |
100 | 115 | "multiple = xr.Dataset()\n", |
|
120 | 135 | "execution_count": null, |
121 | 136 | "metadata": { |
122 | 137 | "ExecuteTime": { |
123 | | - "end_time": "2020-06-12T20:25:12.597651Z", |
124 | | - "start_time": "2020-06-12T20:25:12.554432Z" |
| 138 | + "end_time": "2020-06-19T16:44:52.480112Z", |
| 139 | + "start_time": "2020-06-19T16:44:52.451337Z" |
125 | 140 | } |
126 | 141 | }, |
127 | 142 | "outputs": [], |
|
143 | 158 | "execution_count": null, |
144 | 159 | "metadata": { |
145 | 160 | "ExecuteTime": { |
146 | | - "end_time": "2020-06-12T20:27:09.803560Z", |
147 | | - "start_time": "2020-06-12T20:27:09.770516Z" |
| 161 | + "end_time": "2020-06-19T16:44:52.498434Z", |
| 162 | + "start_time": "2020-06-19T16:44:52.481531Z" |
148 | 163 | } |
149 | 164 | }, |
150 | 165 | "outputs": [], |
|
164 | 179 | "execution_count": null, |
165 | 180 | "metadata": { |
166 | 181 | "ExecuteTime": { |
167 | | - "end_time": "2020-06-12T20:41:54.117735Z", |
168 | | - "start_time": "2020-06-12T20:41:54.087549Z" |
| 182 | + "end_time": "2020-06-19T16:44:52.522360Z", |
| 183 | + "start_time": "2020-06-19T16:44:52.500354Z" |
169 | 184 | } |
170 | 185 | }, |
171 | 186 | "outputs": [], |
|
183 | 198 | { |
184 | 199 | "cell_type": "code", |
185 | 200 | "execution_count": null, |
186 | | - "metadata": {}, |
| 201 | + "metadata": { |
| 202 | + "ExecuteTime": { |
| 203 | + "end_time": "2020-06-19T16:44:52.553921Z", |
| 204 | + "start_time": "2020-06-19T16:44:52.526299Z" |
| 205 | + } |
| 206 | + }, |
187 | 207 | "outputs": [], |
188 | 208 | "source": [ |
189 | 209 | "multiple.cf.describe()" |
|
203 | 223 | "execution_count": null, |
204 | 224 | "metadata": { |
205 | 225 | "ExecuteTime": { |
206 | | - "end_time": "2020-06-12T20:41:57.554031Z", |
207 | | - "start_time": "2020-06-12T20:41:57.504506Z" |
| 226 | + "end_time": "2020-06-19T16:44:52.575193Z", |
| 227 | + "start_time": "2020-06-19T16:44:52.555069Z" |
208 | 228 | } |
209 | 229 | }, |
210 | 230 | "outputs": [], |
|
224 | 244 | "execution_count": null, |
225 | 245 | "metadata": { |
226 | 246 | "ExecuteTime": { |
227 | | - "end_time": "2020-06-12T20:42:02.439458Z", |
228 | | - "start_time": "2020-06-12T20:42:02.364630Z" |
| 247 | + "end_time": "2020-06-19T16:44:52.608225Z", |
| 248 | + "start_time": "2020-06-19T16:44:52.576642Z" |
229 | 249 | } |
230 | 250 | }, |
231 | 251 | "outputs": [], |
|
245 | 265 | "execution_count": null, |
246 | 266 | "metadata": { |
247 | 267 | "ExecuteTime": { |
248 | | - "end_time": "2020-06-12T20:43:09.230608Z", |
249 | | - "start_time": "2020-06-12T20:43:09.189175Z" |
| 268 | + "end_time": "2020-06-19T16:44:52.640868Z", |
| 269 | + "start_time": "2020-06-19T16:44:52.609404Z" |
250 | 270 | } |
251 | 271 | }, |
252 | 272 | "outputs": [], |
|
277 | 297 | "execution_count": null, |
278 | 298 | "metadata": { |
279 | 299 | "ExecuteTime": { |
280 | | - "end_time": "2020-06-12T20:28:53.616306Z", |
281 | | - "start_time": "2020-06-12T20:28:53.562495Z" |
| 300 | + "end_time": "2020-06-19T16:44:52.677400Z", |
| 301 | + "start_time": "2020-06-19T16:44:52.641979Z" |
282 | 302 | } |
283 | 303 | }, |
284 | 304 | "outputs": [], |
|
296 | 316 | { |
297 | 317 | "cell_type": "code", |
298 | 318 | "execution_count": null, |
299 | | - "metadata": {}, |
| 319 | + "metadata": { |
| 320 | + "ExecuteTime": { |
| 321 | + "end_time": "2020-06-19T16:44:52.700101Z", |
| 322 | + "start_time": "2020-06-19T16:44:52.679004Z" |
| 323 | + } |
| 324 | + }, |
300 | 325 | "outputs": [], |
301 | 326 | "source": [ |
302 | 327 | "multiple.cf.isel(X=1, Y=1)" |
303 | 328 | ] |
304 | 329 | }, |
| 330 | + { |
| 331 | + "cell_type": "markdown", |
| 332 | + "metadata": {}, |
| 333 | + "source": [ |
| 334 | + "### Reductions" |
| 335 | + ] |
| 336 | + }, |
| 337 | + { |
| 338 | + "cell_type": "code", |
| 339 | + "execution_count": null, |
| 340 | + "metadata": { |
| 341 | + "ExecuteTime": { |
| 342 | + "end_time": "2020-06-19T16:44:52.749269Z", |
| 343 | + "start_time": "2020-06-19T16:44:52.701198Z" |
| 344 | + } |
| 345 | + }, |
| 346 | + "outputs": [], |
| 347 | + "source": [ |
| 348 | + "ds.air.cf.mean(\"X\")" |
| 349 | + ] |
| 350 | + }, |
| 351 | + { |
| 352 | + "cell_type": "markdown", |
| 353 | + "metadata": {}, |
| 354 | + "source": [ |
| 355 | + "Expanding to multiple dimensions is also supported" |
| 356 | + ] |
| 357 | + }, |
| 358 | + { |
| 359 | + "cell_type": "code", |
| 360 | + "execution_count": null, |
| 361 | + "metadata": { |
| 362 | + "ExecuteTime": { |
| 363 | + "end_time": "2020-06-19T16:44:52.777454Z", |
| 364 | + "start_time": "2020-06-19T16:44:52.750613Z" |
| 365 | + } |
| 366 | + }, |
| 367 | + "outputs": [], |
| 368 | + "source": [ |
| 369 | + "# takes the mean along [\"x1\", \"x2\"]\n", |
| 370 | + "multiple.cf.mean(\"X\")" |
| 371 | + ] |
| 372 | + }, |
305 | 373 | { |
306 | 374 | "cell_type": "markdown", |
307 | 375 | "metadata": {}, |
|
314 | 382 | "execution_count": null, |
315 | 383 | "metadata": { |
316 | 384 | "ExecuteTime": { |
317 | | - "end_time": "2020-06-12T20:28:59.835481Z", |
318 | | - "start_time": "2020-06-12T20:28:59.603378Z" |
| 385 | + "end_time": "2020-06-19T16:44:53.214185Z", |
| 386 | + "start_time": "2020-06-19T16:44:52.779161Z" |
319 | 387 | } |
320 | 388 | }, |
321 | 389 | "outputs": [], |
|
328 | 396 | "execution_count": null, |
329 | 397 | "metadata": { |
330 | 398 | "ExecuteTime": { |
331 | | - "end_time": "2020-06-12T20:30:26.160180Z", |
332 | | - "start_time": "2020-06-12T20:30:25.980074Z" |
| 399 | + "end_time": "2020-06-19T16:44:53.396332Z", |
| 400 | + "start_time": "2020-06-19T16:44:53.216108Z" |
333 | 401 | } |
334 | 402 | }, |
335 | 403 | "outputs": [], |
|
349 | 417 | "execution_count": null, |
350 | 418 | "metadata": { |
351 | 419 | "ExecuteTime": { |
352 | | - "end_time": "2020-06-12T20:49:14.502662Z", |
353 | | - "start_time": "2020-06-12T20:49:14.002534Z" |
| 420 | + "end_time": "2020-06-19T16:44:53.937352Z", |
| 421 | + "start_time": "2020-06-19T16:44:53.397781Z" |
354 | 422 | } |
355 | 423 | }, |
356 | 424 | "outputs": [], |
|
370 | 438 | "execution_count": null, |
371 | 439 | "metadata": { |
372 | 440 | "ExecuteTime": { |
373 | | - "end_time": "2020-06-12T20:29:50.966391Z", |
374 | | - "start_time": "2020-06-12T20:29:50.317513Z" |
| 441 | + "end_time": "2020-06-19T16:44:54.577478Z", |
| 442 | + "start_time": "2020-06-19T16:44:53.938825Z" |
375 | 443 | } |
376 | 444 | }, |
377 | 445 | "outputs": [], |
|
384 | 452 | "execution_count": null, |
385 | 453 | "metadata": { |
386 | 454 | "ExecuteTime": { |
387 | | - "end_time": "2020-06-12T20:30:55.508515Z", |
388 | | - "start_time": "2020-06-12T20:30:55.433502Z" |
| 455 | + "end_time": "2020-06-19T16:44:54.644922Z", |
| 456 | + "start_time": "2020-06-19T16:44:54.578741Z" |
389 | 457 | } |
390 | 458 | }, |
391 | 459 | "outputs": [], |
|
405 | 473 | "execution_count": null, |
406 | 474 | "metadata": { |
407 | 475 | "ExecuteTime": { |
408 | | - "end_time": "2020-06-12T20:31:11.369963Z", |
409 | | - "start_time": "2020-06-12T20:31:11.240738Z" |
| 476 | + "end_time": "2020-06-19T16:44:54.690873Z", |
| 477 | + "start_time": "2020-06-19T16:44:54.646190Z" |
410 | 478 | } |
411 | 479 | }, |
412 | 480 | "outputs": [], |
|
442 | 510 | "execution_count": null, |
443 | 511 | "metadata": { |
444 | 512 | "ExecuteTime": { |
445 | | - "end_time": "2020-06-12T20:34:38.685926Z", |
446 | | - "start_time": "2020-06-12T20:34:38.627758Z" |
| 513 | + "end_time": "2020-06-19T16:44:54.750667Z", |
| 514 | + "start_time": "2020-06-19T16:44:54.693023Z" |
447 | 515 | } |
448 | 516 | }, |
449 | 517 | "outputs": [], |
|
465 | 533 | "execution_count": null, |
466 | 534 | "metadata": { |
467 | 535 | "ExecuteTime": { |
468 | | - "end_time": "2020-06-12T20:47:31.384370Z", |
469 | | - "start_time": "2020-06-12T20:47:31.347731Z" |
| 536 | + "end_time": "2020-06-19T16:44:54.771517Z", |
| 537 | + "start_time": "2020-06-19T16:44:54.752078Z" |
470 | 538 | } |
471 | 539 | }, |
472 | 540 | "outputs": [], |
|
487 | 555 | "execution_count": null, |
488 | 556 | "metadata": { |
489 | 557 | "ExecuteTime": { |
490 | | - "end_time": "2020-06-12T20:47:08.559480Z", |
491 | | - "start_time": "2020-06-12T20:47:08.371283Z" |
| 558 | + "end_time": "2020-06-19T16:44:54.961814Z", |
| 559 | + "start_time": "2020-06-19T16:44:54.772773Z" |
492 | 560 | } |
493 | 561 | }, |
494 | 562 | "outputs": [], |
|
0 commit comments