Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
ctroupin committed Nov 22, 2024
1 parent 812d0d3 commit 062e71e
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 90 deletions.
63 changes: 35 additions & 28 deletions notebooks/3-Analysis/14-cpme-demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,18 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"source": [
"### Analysis\n",
"Analysis parameters have been calibrated in the other notebook [13-processing-parameter-optimization example.ipynb](13-processing-parameter-optimization). \n",
"\n",
"⚠ if the statistical parameters are incorrectly estimated, the error fields are meaningless and only provide an idea of data coverage.\n",
"<div class=\"alert alert-block alert-warning\"> \n",
" ⚠ If the statistical parameters are incorrectly estimated, the error fields are meaningless and only provide an idea of data coverage.\n",
"</div>\n",
"\n",
"The analysis parameters are:"
]
Expand All @@ -173,7 +178,7 @@
"outputs": [],
"source": [
"len = 0.3\n",
"epsilon2 = 1.0;"
"epsilon2 = 1.4;"
]
},
{
Expand Down Expand Up @@ -224,21 +229,11 @@
"source": [
"## Exact error and approximations\n",
"\n",
"Details can be found in the publication:\n",
"<div class=\"alert alert-block alert-info\"> \n",
"<b>NOTE</b> Details can be found in the publication mentioned at the beginning of the notebook.\n",
"</div>\n",
"\n",
"> Approximate and Efficient Methods to Assess Error Fields in Spatial Gridding with Data Interpolating Variational Analysis (DIVA) \n",
"Beckers, Jean-Marie; Barth, Alexander; Troupin, Charles, Alvera-Azcarate, A. *Journal of Atmospheric & Oceanic Technology* (2014), **31(2)**, 515-530 \n",
"https://orbi.uliege.be/handle/2268/161069 \n",
"https://journals.ametsoc.org/doi/abs/10.1175/JTECH-D-13-00130.1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In the 2D case you can try to calculate the exact error expression. This demands the computationally expensive evaluation of `diag(s.P)` accessible via the analysis returned structure `s`. This is only available with `DIVAndrun`.\n",
"\n",
"We define a function that will be run to plot the error field."
"First we define a utility function for plotting."
]
},
{
Expand All @@ -261,14 +256,23 @@
"end"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Exact error by hand\n",
"\n",
"In the 2D case you can try to calculate the exact error expression. This demands the computationally expensive evaluation of `diag(s.P)` accessible via the analysis returned structure `s`. The latter is only available with `DIVAndrun`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"exerr, = statevector_unpack(s.sv,diag(s.P),NaN)\n",
"ploterr(exerr, figtitle= \"Unscaled error\")"
"ploterr(exerr, figtitle= \"Error using P, scaled by global background variance\")"
]
},
{
Expand Down Expand Up @@ -306,7 +310,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Do you see any difference between the exact and clever poor man's error ? \n",
"Do you see any difference between the exact and clever poor man's error ? "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Difference between error fields"
]
},
Expand Down Expand Up @@ -376,15 +386,12 @@
"source": [
"# Conclusion\n",
"In view of the uncertainties on statistical parameters (L, $\\epsilon^2$), the *clever poor man's error* is generally a sufficient approximation for the error fields. \n",
"This is the one implemented in the `DIVAndgo` high-level analysis function. "
"This is the one implemented in the `DIVAndgo` high-level analysis function. \n",
"\n",
"<div class=\"alert alert-block alert-info\"> \n",
"<b>NOTE</b> The next notebook will focus on another function, `DIVAnd_errormap` to evaluate the error field.\n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down Expand Up @@ -419,5 +426,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
Loading

0 comments on commit 062e71e

Please sign in to comment.