diff --git a/README.rst b/README.rst index 91154dc5..fa659df0 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ .. raw:: html
-
+
With thanks to Peter Gleckler, Paul Durack, Karl Taylor, and Chris Golaz
\n", + "\n", + "\n", + "_This work is performed under the auspices of the U. S. DOE by Lawrence Livermore National Laboratory under contract No. DE-AC52-07NA27344._" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## Presentation Overview\n", + "\n", + "Intended audience: Some or no familiarity with `xarray` and `xcdat`\n", + "\n", + "* What is xCDAT?\n", + "* An overview of Xarray\n", + "* How does xCDAT fit in the Xarray ecosystem?\n", + "* The API design of xCDAT\n", + "* Demo of xCDAT capabilities and Dask parallelism\n", + "* Wrap up and resources\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "slide" + } + }, + "source": [ + "## What is xCDAT?\n", + "\n", + "* xCDAT is an **extension of xarray** for **climate data analysis on structured grids**\n", + "* The goal is to provide **generalizable features and utilities for simple and robust analysis of climate data**\n", + "* Jointly developed by scientists and developers from **E3SM** and **PCMDI** at **Lawrence Livermore National Lab**\n", + " * In collaboration with external users and organizations through GitHub\n", + "* Performed for the E3SM and **SEATS** (Simplifying ESM Analysis Through Standards) projects\n", + "\n", + "<xarray.Dataset>\n", + "Dimensions: (time: 1980, bnds: 2, lat: 145, lon: 192)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 1850-01-16T12:00:00 ... 2014-12-16T12:00:00\n", + " * lat (lat) float64 -90.0 -88.75 -87.5 -86.25 ... 86.25 87.5 88.75 90.0\n", + " * lon (lon) float64 0.0 1.875 3.75 5.625 ... 352.5 354.4 356.2 358.1\n", + " height float64 2.0\n", + "Dimensions without coordinates: bnds\n", + "Data variables:\n", + " time_bnds (time, bnds) datetime64[ns] 1850-01-01 1850-02-01 ... 2015-01-01\n", + " lat_bnds (lat, bnds) float64 -90.0 -89.38 -89.38 ... 89.38 89.38 90.0\n", + " lon_bnds (lon, bnds) float64 -0.9375 0.9375 0.9375 ... 357.2 357.2 359.1\n", + " tas (time, lat, lon) float32 ...\n", + "Attributes: (12/48)\n", + " Conventions: CF-1.7 CMIP-6.2\n", + " activity_id: CMIP\n", + " branch_method: standard\n", + " branch_time_in_child: 0.0\n", + " branch_time_in_parent: 87658.0\n", + " creation_date: 2020-06-05T04:06:11Z\n", + " ... ...\n", + " variant_label: r10i1p1f1\n", + " version: v20200605\n", + " license: CMIP6 model data produced by CSIRO is li...\n", + " cmor_version: 3.4.0\n", + " tracking_id: hdl:21.14100/af78ae5e-f3a6-4e99-8cfe-5f2...\n", + " DODS_EXTRA.Unlimited_Dimension: time
<xarray.DataArray 'tas' (time: 1980, lat: 145, lon: 192)>\n", + "[55123200 values with dtype=float32]\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 1850-01-16T12:00:00 ... 2014-12-16T12:00:00\n", + " * lat (lat) float64 -90.0 -88.75 -87.5 -86.25 ... 86.25 87.5 88.75 90.0\n", + " * lon (lon) float64 0.0 1.875 3.75 5.625 7.5 ... 352.5 354.4 356.2 358.1\n", + " height float64 2.0\n", + "Attributes:\n", + " standard_name: air_temperature\n", + " long_name: Near-Surface Air Temperature\n", + " comment: near-surface (usually, 2 meter) air temperature\n", + " units: K\n", + " cell_methods: area: time: mean\n", + " cell_measures: area: areacella\n", + " history: 2020-06-05T04:06:10Z altered by CMOR: Treated scalar dime...\n", + " _ChunkSizes: [ 1 145 192]
<xarray.Dataset>\n", + "Dimensions: (time: 1980, bnds: 2, lat: 145, lon: 192)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 1850-01-16T12:00:00 ... 2014-12-16T12:00:00\n", + " * lat (lat) float64 -90.0 -88.75 -87.5 -86.25 ... 86.25 87.5 88.75 90.0\n", + " * lon (lon) float64 0.0 1.875 3.75 5.625 ... 352.5 354.4 356.2 358.1\n", + " height float64 2.0\n", + "Dimensions without coordinates: bnds\n", + "Data variables:\n", + " time_bnds (time, bnds) datetime64[ns] 1850-01-01 1850-02-01 ... 2015-01-01\n", + " lat_bnds (lat, bnds) float64 -90.0 -89.38 -89.38 ... 89.38 89.38 90.0\n", + " lon_bnds (lon, bnds) float64 -0.9375 0.9375 0.9375 ... 357.2 357.2 359.1\n", + " tas (time, lat, lon) float32 -27.19 -27.19 -27.19 ... -25.29 -25.29\n", + "Attributes: (12/48)\n", + " Conventions: CF-1.7 CMIP-6.2\n", + " activity_id: CMIP\n", + " branch_method: standard\n", + " branch_time_in_child: 0.0\n", + " branch_time_in_parent: 87658.0\n", + " creation_date: 2020-06-05T04:06:11Z\n", + " ... ...\n", + " variant_label: r10i1p1f1\n", + " version: v20200605\n", + " license: CMIP6 model data produced by CSIRO is li...\n", + " cmor_version: 3.4.0\n", + " tracking_id: hdl:21.14100/af78ae5e-f3a6-4e99-8cfe-5f2...\n", + " DODS_EXTRA.Unlimited_Dimension: time
<xarray.DataArray 'tas' (time: 1980)>\n", + "array([25.24722608, 25.61795924, 25.96516235, ..., 26.79536823,\n", + " 26.67771602, 26.27182383])\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 1850-01-16T12:00:00 ... 2014-12-16T12:00:00\n", + " height float64 2.0
<xarray.DataArray 'tas' (lat: 145, lon: 192)>\n", + "array([[-48.01481628, -48.01481628, -48.01481628, ..., -48.01481628,\n", + " -48.01481628, -48.01481628],\n", + " [-44.94085363, -44.97948214, -45.01815398, ..., -44.82408252,\n", + " -44.86273067, -44.9009281 ],\n", + " [-44.11875274, -44.23060624, -44.33960158, ..., -43.76766492,\n", + " -43.88593717, -44.00303006],\n", + " ...,\n", + " [-18.21076615, -18.17513373, -18.13957458, ..., -18.32720478,\n", + " -18.28428828, -18.2486193 ],\n", + " [-18.50778243, -18.49301854, -18.47902819, ..., -18.55410851,\n", + " -18.5406963 , -18.52413098],\n", + " [-19.07366375, -19.07366375, -19.07366375, ..., -19.07366375,\n", + " -19.07366375, -19.07366375]])\n", + "Coordinates:\n", + " * lat (lat) float64 -90.0 -88.75 -87.5 -86.25 ... 86.25 87.5 88.75 90.0\n", + " * lon (lon) float64 0.0 1.875 3.75 5.625 7.5 ... 352.5 354.4 356.2 358.1\n", + " height float64 2.0\n", + "Attributes:\n", + " operation: temporal_avg\n", + " mode: average\n", + " freq: month\n", + " weighted: True
<xarray.Dataset>\n", + "Dimensions: (time: 1980, bnds: 2, lat: 145, lon: 192)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 1850-01-16T12:00:00 ... 2014-12-16T12:00:00\n", + " * lat (lat) float64 -90.0 -88.75 -87.5 -86.25 ... 86.25 87.5 88.75 90.0\n", + " * lon (lon) float64 0.0 1.875 3.75 5.625 ... 352.5 354.4 356.2 358.1\n", + " height float64 ...\n", + "Dimensions without coordinates: bnds\n", + "Data variables:\n", + " time_bnds (time, bnds) datetime64[ns] dask.array<chunksize=(1980, 2), meta=np.ndarray>\n", + " lat_bnds (lat, bnds) float64 dask.array<chunksize=(145, 2), meta=np.ndarray>\n", + " lon_bnds (lon, bnds) float64 dask.array<chunksize=(192, 2), meta=np.ndarray>\n", + " tas (time, lat, lon) float32 dask.array<chunksize=(990, 145, 192), meta=np.ndarray>\n", + "Attributes: (12/49)\n", + " Conventions: CF-1.7 CMIP-6.2\n", + " activity_id: CMIP\n", + " branch_method: standard\n", + " branch_time_in_child: 0.0\n", + " branch_time_in_parent: 87658.0\n", + " creation_date: 2020-06-05T04:06:11Z\n", + " ... ...\n", + " version: v20200605\n", + " license: CMIP6 model data produced by CSIRO is li...\n", + " cmor_version: 3.4.0\n", + " _NCProperties: version=2,netcdf=4.6.2,hdf5=1.10.5\n", + " tracking_id: hdl:21.14100/af78ae5e-f3a6-4e99-8cfe-5f2...\n", + " DODS_EXTRA.Unlimited_Dimension: time
<xarray.DataArray 'tas' (time: 1980)>\n", + "dask.array<truediv, shape=(1980,), dtype=float64, chunksize=(990,), chunktype=numpy.ndarray>\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 1850-01-16T12:00:00 ... 2014-12-16T12:00:00\n", + " height float64 ...\n", + "Attributes:\n", + " standard_name: air_temperature\n", + " long_name: Near-Surface Air Temperature\n", + " comment: near-surface (usually, 2 meter) air temperature\n", + " units: K\n", + " cell_methods: area: time: mean\n", + " cell_measures: area: areacella\n", + " history: 2020-06-05T04:06:10Z altered by CMOR: Treated scalar dime...\n", + " _ChunkSizes: [ 1 145 192]
<xarray.DataArray 'tas' (time: 165, lat: 145, lon: 192)>\n", - "array([[[-48.755733, -48.755733, -48.755733, ..., -48.755733,\n", - " -48.755733, -48.755733],\n", - " [-45.652065, -45.693024, -45.73506 , ..., -45.52128 ,\n", - " -45.563866, -45.60669 ],\n", - " [-44.775234, -44.905838, -45.03297 , ..., -44.37118 ,\n", - " -44.50631 , -44.640503],\n", + "array([[[-48.75573349, -48.75573349, -48.75573349, ..., -48.75573349,\n", + " -48.75573349, -48.75573349],\n", + " [-45.65206528, -45.69302368, -45.73506165, ..., -45.52127838,\n", + " -45.56386566, -45.60668945],\n", + " [-44.77523422, -44.90583801, -45.03297043, ..., -44.37118149,\n", + " -44.50630951, -44.64050293],\n", " ...,\n", - " [-20.505976, -20.481321, -20.454565, ..., -20.588959,\n", - " -20.557522, -20.530872],\n", - " [-20.797592, -20.784252, -20.775455, ..., -20.83268 ,\n", - " -20.823357, -20.807684],\n", - " [-21.201149, -21.201149, -21.201149, ..., -21.201149,\n", - " -21.201149, -21.201149]],\n", - "\n", - " [[-48.95255 , -48.95255 , -48.95255 , ..., -48.95255 ,\n", - " -48.95255 , -48.95255 ],\n", - " [-45.83191 , -45.864902, -45.89875 , ..., -45.73217 ,\n", - " -45.76544 , -45.798595],\n", - " [-44.935368, -45.037956, -45.13801 , ..., -44.61143 ,\n", - " -44.71986 , -44.829372],\n", + " [-20.50597572, -20.48132133, -20.45456505, ..., -20.58895874,\n", + " -20.55752182, -20.53087234],\n", + " [-20.79759216, -20.78425217, -20.77545547, ..., -20.83267975,\n", + " -20.82335663, -20.80768394],\n", + " [-21.20114899, -21.20114899, -21.20114899, ..., -21.20114899,\n", + " -21.20114899, -21.20114899]],\n", + "\n", + " [[-48.95254898, -48.95254898, -48.95254898, ..., -48.95254898,\n", + " -48.95254898, -48.95254898],\n", + " [-45.83190918, -45.8649025 , -45.89875031, ..., -45.7321701 ,\n", + " -45.76544189, -45.79859543],\n", + " [-44.93536758, -45.03795624, -45.13800812, ..., -44.61143112,\n", + " -44.71986008, -44.82937241],\n", "...\n", - " [-14.916271, -14.899261, -14.88381 , ..., -14.99543 ,\n", - " -14.965137, -14.938532],\n", - " [-15.405922, -15.396681, -15.385955, ..., -15.432463,\n", - " -15.426056, -15.413568],\n", - " [-15.945 , -15.945 , -15.945 , ..., -15.945 ,\n", - " -15.945 , -15.945 ]],\n", - "\n", - " [[-47.59732 , -47.59732 , -47.59732 , ..., -47.59732 ,\n", - " -47.59732 , -47.59732 ],\n", - " [-44.721367, -44.763428, -44.803505, ..., -44.592392,\n", - " -44.634445, -44.678226],\n", - " [-43.85032 , -43.969563, -44.08714 , ..., -43.4709 ,\n", - " -43.596764, -43.72408 ],\n", + " [-14.91627121, -14.89926147, -14.88381004, ..., -14.99542999,\n", + " -14.96513653, -14.93853188],\n", + " [-15.40592194, -15.39668083, -15.38595486, ..., -15.43246269,\n", + " -15.42605591, -15.41356754],\n", + " [-15.94499969, -15.94499969, -15.94499969, ..., -15.94499969,\n", + " -15.94499969, -15.94499969]],\n", + "\n", + " [[-47.59732056, -47.59732056, -47.59732056, ..., -47.59732056,\n", + " -47.59732056, -47.59732056],\n", + " [-44.72136688, -44.76342773, -44.80350494, ..., -44.59239197,\n", + " -44.63444519, -44.67822647],\n", + " [-43.85031891, -43.96956253, -44.08713913, ..., -43.47090149,\n", + " -43.59676361, -43.72407913],\n", " ...,\n", - " [-14.52023 , -14.474079, -14.432307, ..., -14.675514,\n", - " -14.620932, -14.567368],\n", - " [-14.911236, -14.892309, -14.869016, ..., -14.982012,\n", - " -14.962668, -14.938723],\n", - " [-15.618406, -15.618406, -15.618406, ..., -15.618406,\n", - " -15.618406, -15.618406]]], dtype=float32)\n", + " [-14.52023029, -14.47407913, -14.43230724, ..., -14.67551422,\n", + " -14.62093163, -14.56736755],\n", + " [-14.91123581, -14.89230919, -14.86901569, ..., -14.9820118 ,\n", + " -14.96266842, -14.93872261],\n", + " [-15.6184063 , -15.6184063 , -15.6184063 , ..., -15.6184063 ,\n", + " -15.6184063 , -15.6184063 ]]])\n", "Coordinates:\n", " * lat (lat) float64 -90.0 -88.75 -87.5 -86.25 ... 86.25 87.5 88.75 90.0\n", " * lon (lon) float64 0.0 1.875 3.75 5.625 7.5 ... 352.5 354.4 356.2 358.1\n", @@ -2154,47 +2156,47 @@ " operation: temporal_avg\n", " mode: group_average\n", " freq: year\n", - " weighted: True
<xarray.DataArray 'tas' (time: 661, lat: 145, lon: 192)>\n", - "array([[[-32.705883 , -32.705883 , -32.705883 , ..., -32.705883 ,\n", - " -32.705883 , -32.705883 ],\n", - " [-30.993767 , -31.037586 , -31.089327 , ..., -30.845623 ,\n", - " -30.894127 , -30.94401 ],\n", - " [-30.02515 , -30.145437 , -30.26419 , ..., -29.660372 ,\n", - " -29.78108 , -29.902878 ],\n", + "array([[[-32.70588303, -32.70588303, -32.70588303, ..., -32.70588303,\n", + " -32.70588303, -32.70588303],\n", + " [-30.99376678, -31.03758621, -31.08932686, ..., -30.84562302,\n", + " -30.89412689, -30.94400978],\n", + " [-30.0251503 , -30.14543724, -30.26419067, ..., -29.66037178,\n", + " -29.78108025, -29.90287781],\n", " ...,\n", - " [-37.72314 , -37.685493 , -37.654167 , ..., -37.8262 ,\n", - " -37.790344 , -37.75683 ],\n", - " [-38.274647 , -38.263725 , -38.250145 , ..., -38.292183 ,\n", - " -38.290638 , -38.28456 ],\n", - " [-38.743587 , -38.743587 , -38.743587 , ..., -38.743587 ,\n", - " -38.743587 , -38.743587 ]],\n", - "\n", - " [[-54.290863 , -54.290863 , -54.290863 , ..., -54.290863 ,\n", - " -54.290863 , -54.290863 ],\n", - " [-51.117714 , -51.175236 , -51.230553 , ..., -50.935165 ,\n", - " -50.99657 , -51.056145 ],\n", - " [-50.318047 , -50.486664 , -50.649567 , ..., -49.79003 ,\n", - " -49.970078 , -50.14521 ],\n", + " [-37.72314072, -37.68549347, -37.65416718, ..., -37.82619858,\n", + " -37.79034424, -37.75682831],\n", + " [-38.27464676, -38.26372528, -38.25014496, ..., -38.29218292,\n", + " -38.29063797, -38.28456116],\n", + " [-38.74358749, -38.74358749, -38.74358749, ..., -38.74358749,\n", + " -38.74358749, -38.74358749]],\n", + "\n", + " [[-54.29086304, -54.29086304, -54.29086304, ..., -54.29086304,\n", + " -54.29086304, -54.29086304],\n", + " [-51.11771393, -51.17523575, -51.23055267, ..., -50.93516541,\n", + " -50.99657059, -51.05614471],\n", + " [-50.31804657, -50.48666382, -50.64956665, ..., -49.79003143,\n", + " -49.97007751, -50.14521027],\n", "...\n", - " [-12.342774 , -12.2246685 , -12.106632 , ..., -12.744922 ,\n", - " -12.609088 , -12.478392 ],\n", - " [-13.126404 , -13.066109 , -13.003876 , ..., -13.306077 ,\n", - " -13.258715 , -13.19972 ],\n", - " [-14.288469 , -14.288469 , -14.288469 , ..., -14.288469 ,\n", - " -14.288469 , -14.288469 ]],\n", - "\n", - " [[-28.990494 , -28.990494 , -28.990494 , ..., -28.990494 ,\n", - " -28.990494 , -28.990494 ],\n", - " [-28.192917 , -28.224579 , -28.261307 , ..., -28.095932 ,\n", - " -28.125992 , -28.15802 ],\n", - " [-27.607407 , -27.705643 , -27.805115 , ..., -27.311615 ,\n", - " -27.410828 , -27.508362 ],\n", + " [-12.34277439, -12.2246685 , -12.10663223, ..., -12.74492168,\n", + " -12.60908794, -12.47839165],\n", + " [-13.12640381, -13.0661087 , -13.00387573, ..., -13.306077 ,\n", + " -13.25871468, -13.19972038],\n", + " [-14.28846931, -14.28846931, -14.28846931, ..., -14.28846931,\n", + " -14.28846931, -14.28846931]],\n", + "\n", + " [[-28.99049377, -28.99049377, -28.99049377, ..., -28.99049377,\n", + " -28.99049377, -28.99049377],\n", + " [-28.19291687, -28.22457886, -28.26130676, ..., -28.09593201,\n", + " -28.12599182, -28.15802002],\n", + " [-27.60740662, -27.7056427 , -27.80511475, ..., -27.31161499,\n", + " -27.41082764, -27.50836182],\n", " ...,\n", - " [-24.256271 , -24.140594 , -24.037537 , ..., -24.61853 ,\n", - " -24.488495 , -24.36644 ],\n", - " [-24.629013 , -24.613388 , -24.549866 , ..., -24.752045 ,\n", - " -24.721603 , -24.666412 ],\n", - " [-25.28923 , -25.28923 , -25.28923 , ..., -25.28923 ,\n", - " -25.28923 , -25.28923 ]]], dtype=float32)\n", + " [-24.25627136, -24.14059448, -24.03753662, ..., -24.61853027,\n", + " -24.48849487, -24.36643982],\n", + " [-24.62901306, -24.61338806, -24.54986572, ..., -24.75204468,\n", + " -24.72160339, -24.66641235],\n", + " [-25.28923035, -25.28923035, -25.28923035, ..., -25.28923035,\n", + " -25.28923035, -25.28923035]]])\n", "Coordinates:\n", " * lat (lat) float64 -90.0 -88.75 -87.5 -86.25 ... 86.25 87.5 88.75 90.0\n", " * lon (lon) float64 0.0 1.875 3.75 5.625 7.5 ... 352.5 354.4 356.2 358.1\n", @@ -2909,47 +2912,47 @@ " freq: season\n", " weighted: True\n", " dec_mode: DJF\n", - " drop_incomplete_djf: False
<xarray.Dataset>\n", - "Dimensions: (time: 18262, bnds: 2, lat: 145, lon: 192)\n", + "Dimensions: (time: 14608, lat: 145, bnds: 2, lon: 192)\n", "Coordinates:\n", - " * time (time) datetime64[ns] 1850-01-01T12:00:00 ... 1899-12-31T12:00:00\n", + " * time (time) datetime64[ns] 2010-01-01T03:00:00 ... 2015-01-01\n", " * lat (lat) float64 -90.0 -88.75 -87.5 -86.25 ... 86.25 87.5 88.75 90.0\n", " * lon (lon) float64 0.0 1.875 3.75 5.625 ... 352.5 354.4 356.2 358.1\n", " height float64 ...\n", "Dimensions without coordinates: bnds\n", "Data variables:\n", - " time_bnds (time, bnds) datetime64[ns] dask.array<chunksize=(18262, 2), meta=np.ndarray>\n", " lat_bnds (lat, bnds) float64 dask.array<chunksize=(145, 2), meta=np.ndarray>\n", " lon_bnds (lon, bnds) float64 dask.array<chunksize=(192, 2), meta=np.ndarray>\n", - " tas (time, lat, lon) float32 dask.array<chunksize=(794, 145, 192), meta=np.ndarray>\n", + " tas (time, lat, lon) float32 dask.array<chunksize=(913, 145, 192), meta=np.ndarray>\n", + " time_bnds (time, bnds) datetime64[ns] 2010-01-01T01:30:00 ... 2015-01-01...\n", "Attributes: (12/48)\n", " Conventions: CF-1.7 CMIP-6.2\n", " activity_id: CMIP\n", " branch_method: standard\n", " branch_time_in_child: 0.0\n", - " branch_time_in_parent: 21915.0\n", - " creation_date: 2019-11-15T17:30:04Z\n", + " branch_time_in_parent: 87658.0\n", + " creation_date: 2020-06-05T04:54:56Z\n", " ... ...\n", - " variant_label: r1i1p1f1\n", - " version: v20191115\n", - " cmor_version: 3.4.0\n", - " tracking_id: hdl:21.14100/a9d8ba3a-bcbf-4d54-9970-cfc...\n", + " variant_label: r10i1p1f1\n", + " version: v20200605\n", " license: CMIP6 model data produced by CSIRO is li...\n", - " DODS_EXTRA.Unlimited_Dimension: time