24.12.2013 Views

wradlib Documentation - Bitbucket

wradlib Documentation - Bitbucket

wradlib Documentation - Bitbucket

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

data provides an extensive introduction into working with DX data. For now, we would just like to know how to read<br />

the data:<br />

data, metadata = io.readDX("mydrive:/path/to/my/file/filename")<br />

Here, data is a two dimensional array of shape (number of azimuth angles, number of range gates). This means that<br />

the number of rows of the array corresponds to the number of azimuth angles of the radar sweep while the number of<br />

columns corresponds to the number of range gates per ray.<br />

2.2.2 German Weather Service: RADOLAN (quantitative) composit<br />

The quantitative composite format of the DWD (German Weather Service) was established in the course of the<br />

RADOLAN project. Most quantitative composite products from the DWD are distributed in this format, e.g. the<br />

R-series (RX, RY, RH, RW, ...), the S-series (SQ, SH, SF, ...), and the E-series (European quantitative composite, e.g.<br />

EZ, EH, EB). Please see the composite format description for a full reference and a full table of products (unfortunately<br />

only in German language).<br />

Currently, the RADOLAN composites have a spatial resolution of 1km x 1km, with the national composits (R- and<br />

S-series) being 900 x 900 grids, and the European composits 1500 x 1400 grids. The projection is polar-stereographic.<br />

The products can be read by the following function:<br />

data, metadata = io.read_RADOLAN_composite("mydrive:/path/to/my/file/filename")<br />

Here, data is a two dimensional integer array of shape (number of rows, number of columns). Different product<br />

types might need different levels of postprocessing, e.g. if the product contains rain rates or accumulations, you<br />

will normally have to divide data by factor 10. metadata is again a dictionary which provides metadata from the<br />

files header section, e.g. using the keys producttype, datetime, intervalseconds, nodataflag. Masking the NoData (or<br />

missing) values can be done by:<br />

import numpy as np<br />

maskeddata = np.ma.masked_equal(data, attrs["nodataflag"])<br />

2.2.3 OPERA BUFR<br />

The Binary Universal Form for the Representation of meteorological data (BUFR) is a binary data format maintained<br />

by the World Meteorological Organization (WMO). The BUFR format was adopted by the OPERA program for the<br />

representation of weather radar data. This module provides a wrapper around the OPERA BUFR software, currently<br />

only for decoding BUFR files. If you intend to work with BUFR data, we recommend reading OPERA’s BUFR software<br />

documentation. Please note that the way the BUFR software is wrapped has to be considered very preliminary.<br />

Due to yet unsolved problems with the BUFR software API, <strong>wradlib</strong> simply calls the executable for BUFR deoding<br />

(decbufr) and read and parses corresponding the file output. This is of course inefficient from a computational perpective.<br />

we hope to come up with a new solution in the near future. However, the <strong>wradlib</strong> BUFR interface is plain<br />

simple:<br />

data, metadata = io.read_BUFR("mydrive:/path/to/my/file/filename")<br />

Basically, a BUFR file consists of a set of descriptors which contain all the relevant metadata and a data section. The<br />

descriptors are identified as a tuple of three integers. The meaning of these tupels is described in the BUFR tables<br />

which come with the software. There are generic BUFR tables provided by the WMO, but it is also possible to define<br />

so called local tables - which was done by the OPERA consortium for the purpose of radar data representation.<br />

<strong>wradlib</strong>.io.read_BUFR returns a two element tuple. The first element (data) of the return tuple is the actual<br />

data array. It is a multi-dimensional numpy array of which the shape depends on the descriptor specifications (mostly<br />

it will be 2-dimensional). The second element (metadata) is a tuple of two dictionaries (descnames, descvals).<br />

descnames relates the descriptor identifiers to comprehensible descriptor names. descvals relates the descriptor names<br />

14 Chapter 2. Tutorials

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

Saved successfully!

Ooh no, something went wrong!