Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Run the following command from the command line:

Code Block
languagebash
cp -Rf ~cgx/tutorials/odb_intro_2019 ~/metview/

This will copy all the ODB examples into your Metview home folder. Soon When you will see a folder called 'odb_intro_2019' appear in your main Metview desktop. Double double-click to enter it. You should see the following contents:Image Removed

Retrieving

...

ODB data from MARS

The Use  the 'ret_temp' MARS Retrieval  icon is already prepared for you to fetch Land TEMP ODB data from MARS for a given date. Edit the icon (right-click & edit) to see what parameters are set. The most important ones are as follows:

ParameterValueDescription
TypeMFBMondb feedback
Obsgroup17Conventional
Reportype16022Land TEMP

Close the icon editor and perform the data retrieval by choosing execute from the icon's context menu. The icon name should turn orange whilst the retrieval takes place, then green to indicate success.

...

If the MARS retrieval was successful the data is now cached locally. To see what was retrieved, right-click examine the icon. This brings up Metview's ODB Examiner tool. Here you can see the metadata (Columns tab) and the actual data values themselves as well (Data tab). Close the ODB Examiner.

...

We will visualise the 500 hPa temperature values from our ODB using the 'vis_temp' ODB Visualiser icon. The query we need to perform is as follows:

Code Block
language

...

sql
select
  lat@hdr,
  lon@hd,
  obsvalue@body
where
  varno = 2 and vertco_reference_1=50000


Now edit the 'vis_temp' icon.

First, drop your ODB Database icon into the ODB Data field.

Next, specify the where WHERE statement of the query in the ODB Where parameter as:

Code Block
varno = 2 and vertco_reference_1=50000


Save these settings by clicking the Save button at the bottom-right of the icon editor (or click Ok to save and close the editor).

...

There are a few Python examples to study: open each script, run them and try to change some of control the parameters at the top.




plot_map.py

This is the Python code to generate the same plot as we did interactively above. The title and the symbol plotting value range are automatically computed from the actual data values. In the script we:

  • used odb_visualiser() to generate the plot
  • called odb_filter() to extract additional data for the title
  • used the values() function to access a given ODB column as a numpy array.
plot_diff.py

This script computes the the difference between the forecast fields stored in 'fc.grib' and our ODB observations. This is achieved by using the following steps:

  1. the ODB query is performed and the resulting data is converted into Geopoints
  2. the matching GRIB field is read and interpolated to the observation points
  3. the difference is computed between forecast and observation
to_pandas.py
This script shows how to convert an ODB into a Pandas dataframe with the to_dataframe() function.
plot_wind.py


If you have extra time...

...