Page History
Panel | ||
---|---|---|
| ||
There are several ways on visualisating ODB data in Magics.
This page presents examples of these different plottingsvisualisation, and offers skeletons of python programs. |
Table of Contents |
---|
To run the example at ECMWF:
- download python scripts and data
- module load Magics/new
- module load odb_api
toc
Using an ODB file and create a geographical map
...
Section | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Section |
---|
Download : |
Now, we are going to colour the symbol according to the value of the observation. The advanced mode for symbol plotting offers an easy way to specify range and colours, we add a legend for readability.
Section | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Section |
---|
Download :
|
Loading the data into a numpy array and passing them to Magics
...
Section | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Section |
---|
Download :
|
Creating a time series from an ODB data.
...
Section | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Download :
|
Note the use of axis_type = 'date', axis_date_type = "automatic" in the setting of the horizontal axis. This is a nice feature of Magics that will adjust the labels to show hours, days, months or years according to the length of the time series.
Section |
---|
Download :
|
Now we will add the data. The file count.odb contains the following information.
...
Section | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Download : python example
|
Note that we have now set subpage_x_axis_type to regular and subpage_x_automatic = on. This will not interpret the date as a date but as a integer, and will use the min and max of the data to setup the limits of the projection. It is not the plot we really want, but it shows quickly your data. gives a quick overview.
Section |
---|
Download : |
Let's nterpret Now we will interpret the date as date, and the time series should be fine.
Section | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Download :
|
Section |
---|
Download : |
In the example we are using numpy array to manipulate the ODB, this gives all the computations facilities. Once done, the result can just be passed to Magics using through a numpy array.