Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions notebooks/basics/wradlib_workflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,10 @@
"metadata": {},
"outputs": [],
"source": [
"raw_error.report()\n",
"adj_error.report()"
"print(\"Error metrics for unadjusted radar rainfall estimates:\")\n",
"raw_error.pprint()\n",
"print(\"\\nError metrics for adjusted radar rainfall estimates:\")\n",
"adj_error.pprint()"
]
},
{
Expand Down
115 changes: 74 additions & 41 deletions notebooks/multisensor/wradlib_adjust_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"slideshow": {
"slide_type": "fragment"
}
Expand Down Expand Up @@ -126,7 +125,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"slideshow": {
"slide_type": "fragment"
}
Expand Down Expand Up @@ -185,7 +183,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"slideshow": {
"slide_type": "fragment"
}
Expand Down Expand Up @@ -232,7 +229,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"slideshow": {
"slide_type": "fragment"
}
Expand Down Expand Up @@ -284,7 +280,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"slideshow": {
"slide_type": "fragment"
}
Expand All @@ -296,30 +291,60 @@
"mfberror = verify.ErrorMetrics(truth, mfb_adjusted)\n",
"adderror = verify.ErrorMetrics(truth, add_adjusted)\n",
"multerror = verify.ErrorMetrics(truth, mult_adjusted)\n",
"mixerror = verify.ErrorMetrics(truth, mixed_adjusted)\n",
"\n",
"mixerror = verify.ErrorMetrics(truth, mixed_adjusted)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Helper function for scatter plot\n",
"def scatterplot(x, y, title=\"\"):\n",
" \"\"\"Quick and dirty helper function to produce scatter plots\n",
" \"\"\"\n",
" pl.scatter(x, y)\n",
" pl.plot([0, 1.2 * maxval], [0, 1.2 * maxval], '-', color='grey')\n",
" pl.xlabel(\"True rainfall (mm)\")\n",
" pl.ylabel(\"Estimated rainfall (mm)\")\n",
" pl.xlim(0, maxval + 0.1 * maxval)\n",
" pl.ylim(0, maxval + 0.1 * maxval)\n",
" pl.title(title)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [],
"source": [
"# Verification reports\n",
"maxval = 4.\n",
"# Enlarge all label fonts\n",
"font = {'size' : 10}\n",
"pl.rc('font', **font)\n",
"fig = pl.figure(figsize=(14, 8))\n",
"ax = fig.add_subplot(231, aspect=1.)\n",
"rawerror.report(ax=ax, unit=\"mm\", maxval=maxval)\n",
"ax.text(0.2, 0.9 * maxval, \"Unadjusted radar\")\n",
"scatterplot(rawerror.obs, rawerror.est, title=\"Unadjusted radar\")\n",
"ax.text(0.2, maxval, \"Nash=%.1f\" % rawerror.nash(), fontsize=12)\n",
"ax = fig.add_subplot(232, aspect=1.)\n",
"adderror.report(ax=ax, unit=\"mm\", maxval=maxval)\n",
"ax.text(0.2, 0.9 * maxval, \"Additive adjustment\")\n",
"scatterplot(adderror.obs, adderror.est, title=\"Additive adjustment\")\n",
"ax.text(0.2, maxval, \"Nash=%.1f\" % adderror.nash(), fontsize=12)\n",
"ax = fig.add_subplot(233, aspect=1.)\n",
"multerror.report(ax=ax, unit=\"mm\", maxval=maxval)\n",
"ax.text(0.2, 0.9 * maxval, \"Multiplicative adjustment\")\n",
"scatterplot(multerror.obs, multerror.est, title=\"Multiplicative adjustment\")\n",
"ax.text(0.2, maxval, \"Nash=%.1f\" % multerror.nash(), fontsize=12)\n",
"ax = fig.add_subplot(234, aspect=1.)\n",
"mixerror.report(ax=ax, unit=\"mm\", maxval=maxval)\n",
"ax.text(0.2, 0.9 * maxval, \"Mixed (mult./add.) adjustment\")\n",
"mixerror.report(ax=ax, unit=\"mm\", maxval=maxval)\n",
"scatterplot(mixerror.obs, mixerror.est, title=\"Mixed (mult./add.) adjustment\")\n",
"ax.text(0.2, maxval, \"Nash=%.1f\" % mixerror.nash(), fontsize=12)\n",
"ax = fig.add_subplot(235, aspect=1.)\n",
"mfberror.report(ax=ax, unit=\"mm\", maxval=maxval)\n",
"txt = ax.text(0.2, 0.9 * maxval, \"Mean Field Bias adjustment\")"
"scatterplot(mfberror.obs, mfberror.est, title=\"Mean Field Bias adjustment\")\n",
"ax.text(0.2, maxval, \"Nash=%.1f\" % mfberror.nash(), fontsize=12)\n",
"pl.tight_layout()"
]
},
{
Expand Down Expand Up @@ -365,7 +390,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"slideshow": {
"slide_type": "fragment"
}
Expand Down Expand Up @@ -419,7 +443,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"slideshow": {
"slide_type": "fragment"
}
Expand Down Expand Up @@ -454,25 +477,13 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [],
"source": [
"# Two helper functions for repeated plotting tasks\n",
"def scatterplot(x, y, title):\n",
" \"\"\"Quick and dirty helper function to produce scatter plots\n",
" \"\"\"\n",
" pl.scatter(x, y)\n",
" pl.plot([0, 1.2 * maxval], [0, 1.2 * maxval], '-', color='grey')\n",
" pl.xlabel(\"True rainfall (mm)\")\n",
" pl.ylabel(\"Estimated rainfall (mm)\")\n",
" pl.xlim(0, maxval + 0.1 * maxval)\n",
" pl.ylim(0, maxval + 0.1 * maxval)\n",
" pl.title(title)\n",
"\n",
"# Helper functions for grid plots\n",
"def gridplot(data, title):\n",
" \"\"\"Quick and dirty helper function to produce a grid plot\n",
" \"\"\"\n",
Expand All @@ -490,7 +501,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"scrolled": true,
"slideshow": {
"slide_type": "fragment"
Expand Down Expand Up @@ -531,7 +541,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"slideshow": {
"slide_type": "fragment"
}
Expand Down Expand Up @@ -565,26 +574,50 @@
"metadata": {
"celltoolbar": "Slideshow",
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python 3",
"language": "python",
"name": "python2"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.12"
"pygments_lexer": "ipython3",
"version": "3.6.4"
},
"livereveal": {
"scroll": true
},
"toc": {
"colors": {
"hover_highlight": "#DAA520",
"navigate_num": "#000000",
"navigate_text": "#333333",
"running_highlight": "#FF0000",
"selected_highlight": "#FFD700",
"sidebar_border": "#EEEEEE",
"wrapper_background": "#FFFFFF"
},
"moveMenuLeft": true,
"nav_menu": {
"height": "232px",
"width": "252px"
},
"navigate_menu": true,
"number_sections": false,
"sideBar": true,
"threshold": 4,
"toc_cell": false,
"toc_section_display": "block",
"toc_window_display": false,
"widenNotebook": false
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}
34 changes: 31 additions & 3 deletions notebooks/verification/wradlib_verify_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,12 @@
"outputs": [],
"source": [
"metrics = wradlib.verify.ErrorMetrics(kdp_true, kdp_re)\n",
"metrics.pprint() \n",
"ax = metrics.plot()\n",
"metrics.pprint()\n",
"ax = pl.subplot(111, aspect=1.)\n",
"ax.plot(metrics.obs, metrics.est, \"bo\")\n",
"ax.plot([-1, 2], [-1, 2], \"k--\")\n",
"pl.xlim(-0.3, 1.1)\n",
"pl.ylim(-0.3, 1.1)\n",
"xlabel = ax.set_xlabel(\"True KDP (deg/km)\")\n",
"ylabel = ax.set_ylabel(\"Reconstructed KDP (deg/km)\")"
]
Expand All @@ -269,7 +273,31 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
"version": "3.6.4"
},
"toc": {
"colors": {
"hover_highlight": "#DAA520",
"navigate_num": "#000000",
"navigate_text": "#333333",
"running_highlight": "#FF0000",
"selected_highlight": "#FFD700",
"sidebar_border": "#EEEEEE",
"wrapper_background": "#FFFFFF"
},
"moveMenuLeft": true,
"nav_menu": {
"height": "232px",
"width": "252px"
},
"navigate_menu": true,
"number_sections": false,
"sideBar": true,
"threshold": 4,
"toc_cell": false,
"toc_section_display": "block",
"toc_window_display": false,
"widenNotebook": false
}
},
"nbformat": 4,
Expand Down