Versions Compared

Key

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

...

To demonstrate the use of the View concept in a Macro language, let's create a program to analyse the vertical structure of temperature changes in time. This exercise reads two forecast steps, computes the differences and visualise visualises the result in a cross section view Cross Section View.

Create a new Macro icon and rename it to xsdiff. Edit it and do the following:

  • drop the t_fc24.grib icon into the Macro Editor. A variable called t_fc24_2e_grib is assigned to the value of the read() command, which reads the GRIB data. Rename the variable to simply be t_fc24.

  • drop the t_fc96.grib icon into the Macro Editor. Rename the variable to t_fc96.

  • compute the differences, e.g. diff = t_fc96 .grib - t_fc24.grib
  • drop the two contouring icons, neg and pos, which will be used to show the differences.

  • drop the xs_europe icon into the Macro Editor
  • underneath the generated code, type the following line:

...

Now run the macro to generate the plot. You can also try plotting the difference fields in a default Geographic View by simply omitting xs_europe from the plot() command.

Also, Examine the two input GRIB iconsto analyse their contents,.

View / Data Modules

Metview uses a netCDF format internally for the results of some computations (this format will be covered at in the session : Data Part 2). In particular, most of the previous Views (i.e. Cross Section, Vertical Profile, Average, Hovmøller and Thermo) do this, but their result data is not available to the user. Therefore, each of these Views has a corresponding Data Module icon. If the intention is to simply plot the result, then the View icons are more useful. But to store the result data, the Data Module icon is required.

  • create both a Vertical Profile View and a Vertical Profile Data icons icon.
  • Edit both to see the differences.

...

  • create a new Macro icon and rename it to save_vp.; edit it
  • into the Macro Editor, drop the Vertical Profile Data icon that you already set up
  • write the result to a file

...