Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Visualization of JEDI analysis in the observation space

JEDI

In this section, you’ll learn:

  • Generate data assimilation statistics and visualize them in the observation space

Prerequisites

ConceptsImportanceNotes
Atmospheric Data AssimilationHelpful

Time to learn: 10 minutes
Readers may check pyDAmonitor for more information


Work with obsSpace

JEDI or GSI generates observation space diagnostic files, which contains original observation information, hofx (H(x), i.e. model counter-parts at the observation locations), OMB (observation minus background), OMA as well as other information.

This notebook covers how to deal with JEDI diganostic files (which are also called output ioda files). We call them jdiag files here.

Import packages

CPU times: user 420 ms, sys: 69.4 ms, total: 490 ms
Wall time: 164 ms
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 get_ipython().run_cell_magic('time', '', '\n# autoload external python modules if they changed\n%load_ext autoreload\n%autoreload 2\n\n# import modules\nimport warnings\nimport math\nimport sys\nimport os\n\nimport cartopy.crs as ccrs\nimport geoviews as gv\nimport geoviews.feature as gf\nimport holoviews as hv\nimport hvplot.xarray\nfrom holoviews import opts\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as mticker\nimport matplotlib.colors as colors\nfrom netCDF4 import Dataset\n\n\nimport s3fs\nimport seaborn as sns  # seaborn handles NaN values automatically\n\nimport geopandas as gp\nimport numpy as np\nimport uxarray as ux\nimport xarray as xr\nimport pandas as pd\n\nfrom obsSpace import obsSpace, fit_rate, query_data, to_dataframe, query_dataset, query_obj\n')

File <timed exec>:12

ModuleNotFoundError: No module named 'geoviews'

Retrieve JEDI data

The example JEDI data are stored at jetstream2. We need to retreive those data first.

Use NetCDF4 to read jdiag files

Use the obsSpace class to read jdiag files

From the above output, we can see that jdiag (or output ioda file) wraps atmospheric state varaibles under attributes (or groups, such as hofx0, obsError, ObsValue, etc).
We provide a Python class obsSpace to access jdiag data in a traditional, intuitive way, such as aircar.t.hofx0, aircar.t.obsError, etc.

check the aircar object

From the above output, we can see the aircar object contains t, q, u, v, etc. Since jdiag_aircar_t133.nc only contains temperature observations, only aircar.t has observation diagnostics.

Query temperature data array

Convert data array to Pandas DataFrame

Converting jdiag data into Pandas DataFrame brings up lots of benefits and we can utilize lots of existing DataFrame capabilities.

Plot histograms

Example 1

Example 2

Example 3

plot fitting rate

The rate fitting to observations is an important metric to evaluate data assimilation performance. We don’t want a small fitting rate, which means very little observation impacts on the model forecast. We don’t want a large fitting rate either, which means we fit too close to the observations and the model forecast will crash. Usually, a fitting rate of 20%~30% is expected.

Plot satellite radiance observations

load satellite data using obsSpace

assemble target obs array

prepare color map

Make the plot