Skip to content

Instantly share code, notes, and snippets.

@naomi-henderson
Created March 18, 2019 19:58
Show Gist options
  • Save naomi-henderson/86a85a9eca14ebe39cbe8abc6b0f3373 to your computer and use it in GitHub Desktop.
Save naomi-henderson/86a85a9eca14ebe39cbe8abc6b0f3373 to your computer and use it in GitHub Desktop.
notebook to test cmip6.yaml
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import intake"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"cat = intake.open_catalog('cmip6.yaml')"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['CNRM_CM6_1.historical.r1i1p1f2.pr',\n",
" 'CNRM_CM6_1.historical.r1i1p1f2.tas',\n",
" 'CNRM_CM6_1.historical.r1i1p1f2.huss',\n",
" 'CNRM_CM6_1.historical.r2i1p1f2.pr',\n",
" 'CNRM_CM6_1.historical.r2i1p1f2.tas',\n",
" 'CNRM_CM6_1.historical.r2i1p1f2.huss']"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"list(cat)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<xarray.DataArray 'time' (time: 482120)>\n",
"array(['1850-01-01T03:00:00.000000000', '1850-01-01T06:00:00.000000000',\n",
" '1850-01-01T09:00:00.000000000', ..., '2014-12-31T18:00:00.000000000',\n",
" '2014-12-31T21:00:00.000000000', '2015-01-01T00:00:00.000000000'],\n",
" dtype='datetime64[ns]')\n",
"Coordinates:\n",
" height float64 ...\n",
" * time (time) datetime64[ns] 1850-01-01T03:00:00 ... 2015-01-01\n",
"Attributes:\n",
" axis: T\n",
" bounds: time_bounds\n",
" long_name: Time axis\n",
" standard_name: time\n",
" time_origin: 1850-01-01 00:00:00"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cat['CNRM_CM6_1.historical.r2i1p1f2.huss'].to_dask().time"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"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": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment