Skip to content

Commit

Permalink
Add point example with leaf age opt to nb
Browse files Browse the repository at this point in the history
  • Loading branch information
zmoon committed Sep 28, 2023
1 parent 9cfd2d0 commit f6330d5
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions python/examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,63 @@
"source": [
"ds.emi_apin.mean(\"z\", keep_attrs=True).plot(size=4, marker=\"o\")"
]
},
{
"cell_type": "markdown",
"id": "0a445f3c-52a2-4a3f-89be-c06011b91a76",
"metadata": {},
"source": [
"### Leaf age parameterization"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a0eee654-2333-408e-a4f6-0bb9ed574600",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"config = {\n",
" \"filenames\": {\n",
" \"file_vars\": [\n",
" \"../input/point_file_20220630.sfcf023.txt\",\n",
" \"../input/point_file_20220701.sfcf000.txt\",\n",
" \"../input/point_file_20220701.sfcf001.txt\",\n",
" ],\n",
" },\n",
" \"userdefs\": {\n",
" \"infmt_opt\": 1,\n",
" \"ntime\": 3,\n",
" \"nlat\": 1,\n",
" \"nlon\": 1,\n",
" \"leafage_opt\": 0, # on\n",
" },\n",
"}\n",
"ds0 = run(config=config)\n",
"\n",
"config[\"userdefs\"][\"leafage_opt\"] = 1 # off\n",
"ds1 = run(config=config)\n",
"\n",
"ds = xr.concat([ds0, ds1], dim=\"leafage_opt\")\n",
"ds"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2439516f-bd60-495f-bbc5-5dfe70555c03",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"fig, [ax1, ax2] = plt.subplots(2, 1, figsize=(5, 6), sharex=True)\n",
"\n",
"ds.emi_apin.mean(\"z\", keep_attrs=True).plot(hue=\"leafage_opt\", marker=\"o\", ax=ax1)\n",
"ds.emi_isop.mean(\"z\", keep_attrs=True).plot(hue=\"leafage_opt\", marker=\"o\", ax=ax2)"
]
}
],
"metadata": {
Expand Down

0 comments on commit f6330d5

Please sign in to comment.