24.12.2013 Views

wradlib Documentation - Bitbucket

wradlib Documentation - Bitbucket

wradlib Documentation - Bitbucket

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>wradlib</strong> <strong>Documentation</strong>, Release 0.1.1<br />

to descriptor values. E.g. if the descriptor identifier was (0, 30, 21), the descriptor name would be ‘Number of pixels<br />

per row’ and the descriptor value could be an integer which actually specifies the number of rows of a grid. Just try:<br />

# Gives the descriptor name for each descriptor ID tuple<br />

print metadata[0]<br />

# Gives the descriptor value for each descriptor name<br />

print metadata[1]<br />

# Gives the descriptor value for a particular descriptor ID tuple, in this case (0, 30, 21)<br />

print metadata[1][ metadata[0][(0, 30, 21)] ]<br />

Gotchas: At the moment, the BUFR implementation in <strong>wradlib</strong> has the potential to give you some trouble. It has<br />

only been tested on Windows 7 under Python 2.6, yet. The key is that the BUFR software has to be successfully<br />

compiled in the course of <strong>wradlib</strong> installation (via python setup.py install). Compilation requires gcc and make. Both<br />

is pre-installed on most Linux machines, and can be installed on Windows using the MinGW compiler suite. If you<br />

are using Python(x,y), gcc and make should already be available on your machine! You can check this by opening<br />

a console window and typing gcc --version and mingw32-make --version. For Linux, the makefile is<br />

available and we hope that the installation process works. But we never tested it! Please give us your feedback how it<br />

works under Linux by sending an e-mail to <strong>wradlib</strong>-users@googlegroups.com or by raising an issue.<br />

2.2.4 OPERA HDF5 (ODIM_H5)<br />

HDF5 is a data model, library, and file format for storing and managing data. The OPERA 3 program developed a<br />

convention (or information model) on how to store and exchange radar data in hdf5 format. It is based on the work<br />

of COST Action 717 and is used e.g. in real-time operations in the Nordic European countries. The OPERA Data<br />

and Information Model (ODIM) is documented e.g. in this report and in a UML representation. Make use of these<br />

documents in order to understand the organization of OPERA hdf5 files!<br />

The hierarchical nature of HDF5 can be described as being similar to directories, files, and links on a hard-drive.<br />

Actual metadata are stored as so-called attributes, and these attributes are organized together in so-called groups.<br />

Binary data are stored as so-called datasets. As for ODIM_H5, the root (or top level) group contains three groups of<br />

metadata: these are called what (object, information model version, and date/time information), where (geographical<br />

information), and how (quality and optional/recommended metadata). For a very simple product, e.g. a CAPPI, the<br />

data is organized in a group called dataset1 which contains another group called data1 where the actual binary<br />

data are found in data. In analogy with a file system on a hard-disk, the HDF5 file containing this simple product is<br />

organized like this:<br />

/<br />

/what<br />

/where<br />

/how<br />

/dataset1<br />

/dataset1/data1<br />

/dataset1/data1/data<br />

The philosophy behind the <strong>wradlib</strong> interface to OPERA’s data model is very straightforward: <strong>wradlib</strong> simply translates<br />

the complete file structure to one dictionary and returns this dictionary to the user. Thus, the potential complexity of<br />

the stored data is kept and it is left to the user how to proceeed with this data. The keys of the output dictionary are<br />

strings that correspond to the “directory trees” shown above. Each key ending with /data points to a Dataset (i.e. a<br />

numpy array of data). Each key ending with /what, /where or /how points to another dictionary of metadata. The<br />

entire output can be obtained by:<br />

fcontent = io.read_OPERA_hdf5("mydrive:/path/to/my/file/filename")<br />

The user should inspect the output obtained from his or her hdf5 file in order to see how access those items which<br />

should be further processed. In order to get a readable overview of the output dictionary, one can use the pretty printing<br />

module:<br />

2.2. Supported radar data formats 15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!