Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Confirmed.

...

You will create some icons yourself, but some are supplied for you so please copy them - please download the following file:

Panel
titleDownload

odb_tutorial.tar.gz

Alternatively, you can copy it like this from the command line

...

:

Code Block
cp -R

    cp /home/graphics/cgx/tutorials/odb_tutorial

.tar.gz  $HOME/metview

and save it in your $HOME/metview directory. You should see it appear on your main Metview desktop, from where you can right-click on it, then choose execute to extract the files. You should now see a (after a few seconds) see an odb_tutorial folder appearing in your main Metview folder. This contains all the icons needed for the tutorial and the solutions as wellwhich contains the solutions and also some additional icons required by these exercises. You will work in this the odb_tutorial folder so open it up. You should see the following contents:

Image RemovedImage Added

The ODB Database Icon

...

Code Block
languagesql
SELECT 
 lat@hdr,
 lon@hdr,
 obsvalue@body
 WHERE
 vertco_reference_1@body = 5 

...

  • Open the subfolder called 'System' and then subfolder 'Defaults'.
  • Do one of the following: edit the Symbol Plottingicon in the 'Defaults' folder to specify your new settings or else delete it and copy your 'symbol' icon into this folder then rename it 'Symbol Plotting'

...

So far we have used the default legend settings, which resulted in a continuous legend. Now we will change our legend so that it could display a histogram showing the data distribution across the data intervals used in the symbol plotting.

Let's create a new Legend icon:

...

Now zoom in and out of different areas. What happens to the palette - does it stay constant? The default behaviour is to create 10 interval levels within the range of data actually plotted. As the area changes, so does the range of values being plotted.

Let's create a palette which will not be altered when we change the area. Copy your 'symbol' icon (either right-click + duplicate, or drag with the middle mouse button), and rename the copy 'symbol_fixed' by clicking on its title. Edit the icon and make the following changes:

...

Odb Latitude Variablespecifies the name of the column holding the latitude data in the SELECT statement (here lat@hdr)
Odb Longitude Variablespecifies the name of the column holding the longitude data in the SELECT statement (here lon@hdr)
Odb X Component Variablespecifies the name of the column holding the u wind component data in the SELECT statement (here obsvalue@body)
Odb Y Component Variablespecifies the name of the column holding the v wind component data in the SELECT statement (here obsvalue@body#1)
Odb Value Variablespecifies the name of the column whose values willl will be used to generate the colour palette for the wind plotting. We leave this item empty because it instructs Metview to use the wind speed for this purpose.
Odb Fromspecifies the FROM statement (it is only needed for ODB-1 databases).
Odb Where

specifies the WHERE statement. In our example it is as follows:

obstype@hdr = 2 and

varno@body = 3 and

varno@body#1 = 4 and

vertco_reference_1@body < 25000

...

We can change the symbol (its type, colour and size) used for the plot with a Symbol Plotting icon. This time you do not need to create a new icon since there is one called 'scatter_symbol' already prepared for you. Edit this icon to see its settings then simply drag it into the Display Window and see how your plot has been changed.

...

Type in the following ODB/SQL query in the Odb Query multi-line text input field.

Code Block
whereSELECT 
 lat@hdr as lat,
 lon@hdr as lon,
 fg_depar@body as fg_dep,
 an_depar@body as an_dep
whereWHERE
 vertco_reference_1@body = 5 

...

Now, if you execute this macro (right-click execute or click on the Play button in the Macro editor) you should see the following text appearing in the standard output:
 

Code Block
languagetext
min: 191.710006714 max: 301.720001221 mean: 238.441305601

...