Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Scroll pdf ignore
Panel
titleDownload
Expand
titleClick here for files to download...
Excerpt Include
A Quick Tour of Metview
A Quick Tour of Metview
nopaneltrue

Attachments
uploadfalse
oldfalse
patterns*.tar.gz,*.grib,*.grb
sortByname

Overview

One of Metview's most powerful features is its data processing ability. Data from various sources can be combined and manipulated using high- or low-level commands.

...

Ensure that the difference fieldset is visualised with the a contouring applied. One way to generate a Metview Macro script from this plot is to click the Generate Macro button (also available from the File menu). A new Macro script will be generated - have a look at it to confirm that it contains code to read the data, compute the difference and plot the result. Run the macro to obtain the plot, either by using the Run button from the Macro Editor, or by selecting visualise from the icon's context menu). By default, the macro is written so that it will produce an interactive plot window; it will generate a PostScript file if it is run with the execute command, or if it is run from the command line.

...

Create a new Observation Filter icon and rename it to filter_obs_t2m, setting these parameters:

DataDrop the obs.bufr icon here
OutputGeographical Points
Parameter012004

Note that 012004 is the code for 'Dry bulb temperature at 2m'. Confirm that the result of this icon's filtering is a set of geopoints with temperature values.

...

Computing Wind Speed from U/V

The GRIB file uv850.grib contains 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 V wind component into a variable called v
  3. apply the formula speed = sqrt(u*u + v*v)

  4. plot the result

...

  1. apply some shading to the data with a Contouring icon, only contouring wind speeds above 20m/s
    1. note that we use Wind Plotting icons to modify the plotting of vector fields, but this is now a scalar field, so we use the Contouring icon
  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 the Result of a Computation for Further Interactive Use

The result of the above macro does not have to live entirely inside the macro - it can be passed back to the user interface or used as input to other icons. Do this:

  1. in the above macro, comment out the plot() command (using the hash, #, symbol)
  2. add a new line of code at the end:
    return speed

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.

...

Now create a new GRIB Filter icon with these parameters:

DataDrop
the u GRIB Filter
the uv850.grib icon here
ParamU
Grid2.5/2.5

The result will be the same data interpolated onto a 2.5x2.5 degree grid. Visualise the result and apply the supplied gridpoints icon to confirm the new grid. Visualise the two fields side-by-side with coloured contour shading to also confirm that they look very similar in terms of their data values.

Sub-area Extraction from a Fieldset

Image Modified

The GRIB Filter icon also allows the extraction of a sub-area from a fieldset. Create a new one and, using the Area parameter, extract just the data over a selected region for any of the supplied GRIB files. The area is defined as a list of 4 numbers, forward slash-delimited, representing the its North/West/South/East coordinates of the areabounds.

Conversion Between Fields and Points

...

Metview provides two icons, Geopoints to GRIB and GRIB to  Geopoints To Grib and Grib To Geopoints for the purpose of converting between GRIB (gridded) and geopoints (scattered) formats.

...

Use a Geopoints to GRIB icon to convert the geopoints result of the fc_obs_diff icon to GRIB. We now have gridded data derived from scattered points. This icon contains some parameters to help define the output grid and the interpolation process used in the conversion; it is also possible to supply a template GRIB file which will be used to define the output grid.

Extra Tasks

Computing statistics fields

...

Plot the results and cross-reference with the original result of 6 fields to confirm that you understand what has been computed.

Extract field values at a set of locations

Extract the temperature values from the t2m_forecast.grib file at all the locations in the geopoints data returned by the filter_obs_t2m icon. Hint:

  • the Macro function interpolate(field, geopoints) returns a new geopoints variable whose locations are from its input geopoints and whose values are interpolated from the input field

Extracting point values

There are many ways to extract the value of a field at a given point or set of points. Try this one - call nearest_gridpoint_info ( fieldset,number,number ) with the latitude and longitude of a geographical location and print the result to see which data gridpoint is closest to it.

Automatic conversion between grids

...

  • read both files
  • use the grib_get_double(fieldset, string) function twice to extract the grid resolution from the first field in uv850 (uv850[1])
    • use the Grib Examiner to find which GRIB_API keys define these parameters
  • use the read() command to set the grid on the temperature field

...

  • field

...

Extract the temperature values from the t2m_forecast.grib file at all the locations in the geopoints data returned by the filter_obs_t2m icon. Hint:

  • the Macro function interpolate(field, geopoints) returns a new geopoints variable whose locations are from its input geopoints and whose values are interpolated from the input field

...