{ "metadata": { "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.8.10" }, "orig_nbformat": 4, "kernelspec": { "name": "python3", "display_name": "Python 3.8.10 64-bit ('base': conda)" }, "interpreter": { "hash": "fa576ebcd40e010bdc0ae86b06ce09151f3424f9e9aed6893ff04f39a9299d89" } }, "nbformat": 4, "nbformat_minor": 2, "cells": [ { "source": [ "# Diagnostic output overview\n", "\n", "The MIKE FM DA module can output 3 different types of diagnostic outputs:\n", "\n", "1. Measurement diagnostic - which relates to a specific measurement\n", "2. Non-measurement point diagnostic - results for a specific variable and point\n", "3. Global assimilation statistics\n", "\n", "All are read by the FMDAp method `read_diagnostic()`" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import fmdap" ] }, { "source": [ "## 1. Measurement diagnostic overview\n", "\n", "Measurement diagnostic (type 1) comes in two kinds depending on the type measurement they refer to:\n", "\n", "* point\n", "* spatially distributed (e.g. track measurement)\n", "\n", "They furthermore behave differently depending on presence of assimilation updates or not.\n", "\n", "Measurement diagnostic have the following main data properties:\n", "\n", "* forecast\n", "* result\n", "* innovation\n", "\n", "If the file contains updates (from assimilation) it will also have properties:\n", "\n", "* forecast_at_update\n", "* analysis\n", "* increment\n", "\n", "If the file does not have updates, the forecast and result properties will be identical. " ], "cell_type": "markdown", "metadata": {} }, { "source": [ "### Point measurement diagnostic without updates" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "source": [ "### Point measurement diagnostic with assimilation updates" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "fn = '../tests/testdata/Diagnostics_F16_EnKF.dfs0'\n", "diag = fmdap.read_diagnostic(fn, name=\"F16\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " F16 (Significant wave height [m])\n", " Time: 2017-10-27 00:00:00 - 2017-10-29 18:00:00 (397 steps; 347 with updates)\n", " Ensemble with 10 members\n", " Model: 7440 values from 1.7218 to 7.3975 with mean 3.9859\n", " Measurements: 125 values from 1.7495 to 7.2173 with mean 3.9901\n", " Mean skill: bias=0.1871, rmse=0.4057 ensemble_std=0.1365" ] }, "metadata": {}, "execution_count": 3 } ], "source": [ "diag" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "" ] }, "metadata": {}, "execution_count": 4 } ], "source": [ "diag.type" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "True" ] }, "metadata": {}, "execution_count": 5 } ], "source": [ "diag.has_updates" ] }, { "source": [ "### Track measurement diagnostic with assimilation updates" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "fn = '../tests/testdata/Diagnostics_Altimetry_C2.dfs0'\n", "diag = fmdap.read_diagnostic(fn, name=\"c2 alti\")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " c2 alti (Significant wave height [m])\n", " Time: 2017-10-27 12:50:00 (1 record with update)\n", " Spatially distributed points with avg 62.0 points per step\n", " Ensemble with 7 members\n", " Model: 434 values from 0.0297 to 2.6706 with mean 0.9674\n", " Measurements: 62 values from 0.3489 to 2.5001 with mean 1.0032\n", " Mean skill: bias=-1.0368, rmse=1.1841 ensemble_std=0.1531" ] }, "metadata": {}, "execution_count": 7 } ], "source": [ "diag" ] }, { "source": [ "## 2. Non-measurement point diagnostic overview\n", "\n", "Non-measurement diagnostic (type 2) are always point-type. The don't have any measurement information. They behave differently depending on presence of assimilation updates or not.\n", "\n", "Non-measurement diagnostic have the following main data properties:\n", "\n", "* forecast\n", "* result\n", "\n", "If the file contains updates (from assimilation) it will also have properties:\n", "\n", "* forecast_at_update\n", "* analysis\n", "* increment\n", "\n", "If the file does not have updates, the forecast and result properties will be identical. " ], "cell_type": "markdown", "metadata": {} }, { "source": [ "### Non-measurement point without updates" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "fn = '../tests/testdata/diagnostics_nonMeas_SSC1.dfs0'\n", "diag = fmdap.read_diagnostic(fn)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " diagnostics_nonMeas_SSC1 (Concentration 2 [kg per m pow 3])\n", " Time: 2016-01-01 02:00:00 - 2016-01-01 11:25:00 (114 steps; 0 with updates)\n", " Ensemble with 3 members\n", " Model: 342 values from 0.1810 to 0.6348 with mean 0.3458" ] }, "metadata": {}, "execution_count": 9 } ], "source": [ "diag" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "" ] }, "metadata": {}, "execution_count": 10 } ], "source": [ "diag.type" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "False" ] }, "metadata": {}, "execution_count": 11 } ], "source": [ "diag.has_updates" ] }, { "source": [ "## 3. Global assimilation statistics\n", "\n", "Currently, global assimilation statistics files have very limited support!" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "fn = '../tests/testdata/Global_stats.dfs0'\n", "diag = fmdap.read_diagnostic(fn)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "" ] }, "metadata": {}, "execution_count": 13 } ], "source": [ "diag.type" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ] }