Versions Compared

Key

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

...

There are a few Python examples in the folder for you to study: open . 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
This script shows how to plot wind data from ODB.


If you have extra time...

There are some other examples provided in the 'odb_intro_2019' folder (it is one level up from folder 'main').

...