Info |
---|
Full documentation on ODB functionality in Metview is here. |
Setup
Run the following command from the command line:
Code Block | ||
---|---|---|
| ||
cp -Rf ~cgx/tutorials/odb_intro_2019 ~/metview/ |
This will copy all the ODB examples into your Metview home folder. When you see a folder called 'odb_intro_2019' appear in your main Metview desktop double-click to enter itNavigate into the 4_odb/main folder within Metview.
Retrieving ODB data from MARS
...
If the MARS retrieval was successful the data is now cached locally. To save the ODB data from the cache to disk, right-click Save result on the Mars Retrieval icon and save as 'temp.odb'. A few seconds later an ODB Database icon with the given name will appear at the bottom of your folder.
Examine the ODB file
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.
To save the ODB data from the cache to disk, right-click Save result on the Mars Retrieval icon and save as 'temp.odb'. A few seconds later an ODB Database icon with the given name will appear at the bottom of your folder.
Interactive Visualisation
...
We will visualise the 500 hPa temperature values from our ODB using by editing the supplied 'vis_temp' ODB Visualiser icon. The ODB/SQL query we need to perform is as follows:
...
Now edit the 'vis_temp' icon .
First, drop your ODB Database icon into the ODB Data field.
Next, specify the WHERE statement of the query in the ODB Where parameter as:
...
and set the following parameters:
Odb Data | Drop the temp.odb icon into this box |
Odb Where | 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).Right-click visualise the 'vis_temp' icon to generate the plotvisualise it. Then drag the the provided Symbol Plotting, Coastlines, Legend and Text Plotting icons into the plot for further customisation (either one at a time, or all together). Keep the plot window open.
Inspecting the Data Values in the Plot
Data values at the cursor position can The data values can be inspected with the Cursor Data Tool , which can be activated by pressing on the icon in the toolbar of the Display Window. The Cursor Data Tool displays the co-ordinates of the current cursor position and the information for the nearest data point to this position.You may find it hard to use the Cursor Data Tool in data dense regions. To overcome this launch the Magnifier with the icon in the toolbar and move it to your area of interest in the plot. The magnifying glass can be moved and resized using the mouse, and the magnification scale on its left-hand side can also be adjusted. You can also zoom into areas of the map using the Zoom controls in the toolbar.(you can combine it with the Magnifier to see the fine details).
Enable the sidebar of the Display Window with the
button and select the Data tab (and select the 'vis_temp' layer at the top if it is not yet selected). Now select the Metadata panel inside the tab. Here you will find some statistics about the data plotted and a histogram as well....
Now switch to the Values panel. This features a list showing all the plotted data. In the bottom-left corner click on the
button to activate the Data probe (this will appear in the plot). The probe is synchronised with the list. Try to drag it around in the plot, or change its position through the list. The Magnifier might help you position the Data probe more accurately.Python Examples
...
There are a few Python examples in the folder for you to study: open each script, run them and try to change some of control the parameters at the top. Open and run these scripts.
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:
| |
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:
| |
to_pandas.py | This script shows how to convert an ODB into a Pandas dataframe with the to_dataframe() function. | |
plot_wind.py | This script shows how to plot wind data from ODB. |
If you have extra time...
There are some other examples provided in the '4_odb_intro_2019' folder (it is one level up from folder 'main').
...
Enter folder 'scatterometer'.
'SCATT.odb' contains scatterometer data. Macro The script 'scatt.mv,py' extracts and plots scatterometer wind (ambiguous wind components) for a limited area and time period. Visualise the macro Python script and drop the provided 'mslp.grib' icon into the plot. This GRIB contains a mean sea level forecast valid at the same time as the observations.
...
Visualise 'scatter_plot' and customise it with the provided provided Symbol Plotting icon. The plot you see is a scatterplot for the first guess departures (x axis) and analysis departures (y axis) for a given channel.
Visualise 'bin_plot' to get the binned version of the same data (as a heat map). Drop the provided provided Contouring, Cartesian View and and Text Plotting icons into the plot to fully customise it.
...