Versions Compared

Key

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

...

As with the previous exercise, create a macro which will run all of these steps and plot the result.

 

Computing Wind Speed from U/V

Image Added

The GRIB file uv850 contains analysis forecast data for U and V wind components at 850hPa at various forecast steps (visualise it to confirm). The task is to compute the wind speed from this using a macro, so create a new Macro icon, rename it compute_wind_speed and edit it.

...

  1. filter the U wind component into a variable called u (you may find it useful to use the GRIB Filter icon to do this and then drop it into the Macro Editor)
  2. filter the U wind component into a variable called v
  3. apply the formula speed = sqrt(u*u + v*v)

  4. plot the result

You may wish to apply the following enhancements to the plot:

  1. apply some shading to the data with a Contouring icon, only contouring wind speeds above 20m/s
  2. overlay the original wind field and change the colour of the arrows to 'charcoal' with a Wind Plotting icon
  3. shade the land and the sea with a Coastlines icon

Returning a Computation for Further Interactive Use

...

This passes the fieldset speed back to the user interface. Try it by right-clicking on the macro's icon and selecting examine, save or visualise. This icon can also be dropped into an existing Display Window to plot the data there. It could also be used as an input to another icon, for example a Simple Formula icon for further processing.

Writing the result of a computation to disk

Again, modify the last line of the compute_wind_speed icon so that we now instead write the result to a file:

Code Block
languagepy
write('wind_speed.grib', speed)

A full path could also have been supplied if you do not wish the file to be written to the current directory.

Field Interpolation

Metview's GRIB Filter icon has parameters which enable the interpolation of data onto a new grid, or the extraction of a sub-area. This can be useful if you wish to compare two fields which are currently at different resolutions (e.g. from different model runs) - both fields need to be on the same grid before Metview can perform computations between them.

...