diff --git a/docs/notebooks/verification.ipynb b/docs/notebooks/verification.ipynb deleted file mode 100644 index 9599abe8..00000000 --- a/docs/notebooks/verification.ipynb +++ /dev/null @@ -1,2412 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Verification of Model Forecast vs Observations (Measurements)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Documentation about DMI dat and Scores can be found here:\n", - "- https://opendatadocs.dmi.govcloud.dk/APIs/Meteorological_Observation_API\n", - "- https://scores.readthedocs.io/en/stable/index.html" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Plese define the folling variables to define the data you want to verify." - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "path_model = \"/users/sadamov/pyprojects/neural-lam/data/danra/single_levels.zarr\"\n", - "url_model = \"https://mllam-test-data.s3.eu-north-1.amazonaws.com/single_levels.zarr\"\n", - "vars_model = {\"u10m\": \"u10\", \"v10m\": \"v10\"}\n", - "\n", - "path_obs = \"/users/sadamov/pyprojects/neural-lam/data/danra/observations.zarr\"\n", - "url_obs = \"https://dmigw.govcloud.dk/v2/metObs/collections/observation/items\"\n", - "vars_obs = [\"wind_speed_past1h\", \"wind_dir_past1h\"]\n", - "api_key = \"8dff599e-9a48-46eb-a166-72f2f722645e\"\n", - "\n", - "var_plot = \"u10\"" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "import os\n", - "\n", - "import cartopy.crs as ccrs\n", - "import cartopy.feature as cfeature\n", - "import geopandas as gpd\n", - "import matplotlib.pyplot as plt\n", - "import numpy as np\n", - "import pandas as pd\n", - "import requests\n", - "import xarray as xr\n", - "from scipy.interpolate import RBFInterpolator\n", - "from scores.spatial import fss_2d" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "For this example the model data is coming from the AWS bucket from DMI for the DANRA reanalysis." - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
<xarray.Dataset> Size: 751MB\n", - "Dimensions: (time: 100, y: 589, x: 789)\n", - "Coordinates:\n", - " lat (y, x) float64 4MB dask.array<chunksize=(589, 789), meta=np.ndarray>\n", - " lon (y, x) float64 4MB dask.array<chunksize=(589, 789), meta=np.ndarray>\n", - " * time (time) datetime64[ns] 800B 2020-09-01 ... 2020-09-13T09:00:00\n", - " * x (x) float64 6kB -1.999e+06 -1.997e+06 ... -3.175e+04 -2.925e+04\n", - " * y (y) float64 5kB -6.095e+05 -6.07e+05 ... 8.58e+05 8.605e+05\n", - "Data variables:\n", - " u10 (time, y, x) float64 372MB dask.array<chunksize=(20, 589, 789), meta=np.ndarray>\n", - " v10 (time, y, x) float64 372MB dask.array<chunksize=(20, 589, 789), meta=np.ndarray>\n", - "Attributes:\n", - " description: All prognostic variables for 10-year period on reduced levels
<xarray.Dataset> Size: 90kB\n", - "Dimensions: (time: 100, stationId: 55)\n", - "Coordinates:\n", - " * time (time) datetime64[ns] 800B 2020-09-01 ... 2020-09-13T0...\n", - " * stationId (stationId) object 440B '06019' '06030' ... '06197'\n", - " lat (stationId) float64 440B 56.93 57.1 57.19 ... 55.3 55.06\n", - " lon (stationId) float64 440B 8.641 9.851 9.953 ... 14.77 15.1\n", - "Data variables:\n", - " wind_speed_past1h (time, stationId) float64 44kB 0.8 1.0 0.0 ... 10.4 7.8\n", - " wind_dir_past1h (time, stationId) float64 44kB 107.0 62.0 ... 247.0 242.0
<xarray.Dataset> Size: 46kB\n", - "Dimensions: (time: 100, stationId: 55)\n", - "Coordinates:\n", - " * time (time) datetime64[ns] 800B 2020-09-01 ... 2020-09-13T09:00:00\n", - " * stationId (stationId) object 440B '06019' '06030' ... '06193' '06197'\n", - " lat (stationId) float64 440B 56.93 57.1 57.19 ... 55.07 55.3 55.06\n", - " lon (stationId) float64 440B 8.641 9.851 9.953 ... 14.75 14.77 15.1\n", - "Data variables:\n", - " u10 (time, stationId) float64 44kB 1.002 0.577 ... 3.716 2.547
<xarray.Dataset> Size: 194kB\n", + "Dimensions: (time: 100, stationId: 48)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 800B 2020-09-01 ... 2020-09-13T0...\n", + " * stationId (stationId) object 384B '06030' '06032' ... '06190'\n", + " lat (stationId) float64 384B 57.1 57.38 57.74 ... 55.88 55.07\n", + " lon (stationId) float64 384B 9.851 10.33 ... 12.41 14.75\n", + "Data variables:\n", + " wind_speed_past1h (time, stationId) float64 38kB 1.0 0.3 2.5 ... 3.1 8.2\n", + " wind_dir_past1h (time, stationId) float64 38kB 62.0 352.0 ... 217.0 239.0\n", + " temp_dry (time, stationId) float64 38kB 9.1 8.5 12.4 ... 15.5 16.2\n", + " pressure_at_sea (time, stationId) float64 38kB 1.022e+03 ... 1.022e+03\n", + " pressure (time, stationId) float64 38kB 1.02e+03 ... 1.02e+03
<xarray.Dataset> Size: 3kB\n", + "Dimensions: (stationId: 48)\n", + "Coordinates:\n", + " time datetime64[ns] 8B 2020-09-01\n", + " * stationId (stationId) object 384B '06030' '06032' ... '06188' '06190'\n", + " lat (stationId) float64 384B 57.1 57.38 57.74 ... 55.88 55.07\n", + " lon (stationId) float64 384B 9.851 10.33 10.63 ... 12.41 14.75\n", + "Data variables:\n", + " u10m (stationId) float64 384B 0.8829 -0.04175 ... -0.3381 0.4724\n", + " v10m (stationId) float64 384B 0.4695 0.2971 ... 0.725 2.046\n", + " t2m (stationId) float64 384B 9.1 8.5 12.4 11.9 ... 15.2 8.2 nan\n", + " pres_seasurface (stationId) float64 384B 1.022e+03 1.022e+03 ... 1.019e+03\n", + " pres0m (stationId) float64 384B 1.02e+03 1.015e+03 ... 1.017e+03
<xarray.Dataset> Size: 194kB\n", + "Dimensions: (time: 100, stationId: 48)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 800B 2020-09-01 ... 2020-09-13T09:...\n", + " * stationId (stationId) object 384B '06030' '06032' ... '06188' '06190'\n", + " lat (stationId) float64 384B 57.1 57.38 57.74 ... 55.88 55.07\n", + " lon (stationId) float64 384B 9.851 10.33 10.63 ... 12.41 14.75\n", + "Data variables:\n", + " u10m (time, stationId) float64 38kB 0.577 0.7992 ... 3.32 3.491\n", + " v10m (time, stationId) float64 38kB 2.187 0.7312 ... -2.329\n", + " t2m (time, stationId) float64 38kB 287.6 286.4 ... 288.7 287.8\n", + " pres_seasurface (time, stationId) float64 38kB 1.014e+05 ... 1.02e+05\n", + " pres0m (time, stationId) float64 38kB 1.013e+05 ... 1.019e+05
\n", + " | MAE | \n", + "Relative L1 (%) | \n", + "RMSE | \n", + "Relative L2 (%) | \n", + "MSE | \n", + "Pearson R | \n", + "Wasserstein Distance | \n", + "
---|---|---|---|---|---|---|---|
u10m | \n", + "0.1002 | \n", + "0.000500% | \n", + "0.9487 | \n", + "0.267661% | \n", + "0.9000 | \n", + "-0.2525 | \n", + "0.0892 | \n", + "
v10m | \n", + "0.0742 | \n", + "0.000636% | \n", + "0.6939 | \n", + "0.314634% | \n", + "0.4815 | \n", + "0.0355 | \n", + "0.0156 | \n", + "
t2m | \n", + "5.2346 | \n", + "0.007614% | \n", + "37.7804 | \n", + "3.700350% | \n", + "1427.3561 | \n", + "0.9720 | \n", + "5.2346 | \n", + "
pres_seasurface | \n", + "1927.3615 | \n", + "0.039927% | \n", + "13909.7915 | \n", + "19.861560% | \n", + "193482300.1716 | \n", + "0.9948 | \n", + "1927.3615 | \n", + "
pres0m | \n", + "1922.7900 | \n", + "0.039959% | \n", + "13876.8443 | \n", + "19.877556% | \n", + "192566807.3208 | \n", + "0.9948 | \n", + "1922.7900 | \n", + "