Raw Data I/O

Please have a look at the tutorial Supported radar data formats for an introduction on how to deal with different file formats.


Reading DX and RADOLAN data from German Weather Service

read_dx Data reader for German Weather Service DX product raw radar data files.
read_radolan_composite Read quantitative radar composite format of the German Weather Service
get_radolan_filehandle Opens radolan file and returns file handle
read_radolan_header Reads radolan ASCII header and returns it as string
parse_dwd_composite_header Parses the ASCII header of a DWD quantitative composite file
read_radolan_binary_array Read binary data from file given by filehandle
decode_radolan_runlength_array Decodes the binary runlength coded section from DWD composite file and return decoded numpy array with correct shape

HDF Data I/O

read_generic_hdf5 Reads hdf5 files according to their structure
read_opera_hdf5 Reads hdf5 files according to OPERA conventions
read_gamic_hdf5 Data reader for hdf5 files produced by the commercial GAMIC Enigma V3 MURAN software
to_hdf5 Quick storage of one <data> array and a <metadata> dict in an hdf5 file
from_hdf5 Loading data from hdf5 files that was stored by to_hdf5
read_gpm Reads GPM files for matching with GR
read_trmm Reads TRMM files for matching with GR

Read NetCDF

read_edge_netcdf Data reader for netCDF files exported by the EDGE radar software
read_generic_netcdf Reads netcdf files and returns a dictionary with corresponding structure.

Read Rainbow

read_rainbow Reads Rainbow files files according to their structure

Raster and Vector I/O using GDAL

open_vector Open vector file, return gdal.Dataset and OGR.Layer
open_raster Open raster file, return gdal.Dataset
read_safnwc Read MSG SAFNWC hdf5 file into a gdal georeferenced object
write_raster_dataset Write raster dataset to file format

Read IRIS Data Format

Reads data from Vaisala’s IRIS data formats

IRIS (Vaisala Sigmet Interactive Radar Information System)

See M211318EN-F Programming Guide ftp://ftp.sigmet.com/outgoing/manuals/

To read from IRIS files numpy.memmap is used to get access to the data. The IRIS header (PRODUCT_HDR, INGEST_HEADER) is read in any case into dedicated OrderedDict’s. Reading sweep data can be skipped by setting loaddata=False. By default the data is decoded on the fly. Using rawdata=True the data will be kept undecoded.

IrisRecord Class holding a single record from a Sigmet IRIS file.
IrisHeaderBase Base Class for Iris Headers.
IrisStructureHeader Iris Structure Header class.
IrisIngestHeader Iris Ingest Header class.
IrisProductHeader Iris Product Header class.
IrisIngestDataHeader Iris Ingest Data Header class.
IrisFileBase Base class for Iris Files.
IrisFile IrisFile class
IrisIngestHeaderFile Iris Ingest Header File class.
IrisIngestDataFile Iris Ingest Data File class.
IrisRecordFile Iris Record File class
IrisRawFile Iris Raw File class.
IrisProductFile Class for retrieving data from Sigmet IRIS Product files.
IrisCartesianProductFile Class for retrieving data from Sigmet IRIS Cartesian Product files.
read_iris Read Iris file and return dictionary.

Miscellaneous Data I/O

write_polygon_to_text Writes Polygons to a Text file which can be interpreted by ESRI ArcGIS’s “Create Features from Text File (Samples)” tool.
to_pickle Pickle object <obj> to file <fpath>
from_pickle Return pickled object from file <fpath>
get_radiosonde Download radiosonde data from internet.
get_membership_functions Reads membership function parameters from wradlib-data file.

Xarray powered Data I/O

Reads data from netcdf-based CfRadial1, CfRadial2 and hdf5-based ODIM_H5 and other hdf5-flavours (GAMIC).

Writes data to CfRadial2 and ODIM_H5 files.

This reader implementation uses

The data is claimed using netcdf4-Dataset in a diskless non-persistent mode:

ncf = nc.Dataset(filename, diskless=True, persist=False)

Further the different netcdf/hdf groups are accessed via xarray open_dataset and the NetCDF4DataStore:

xr.open_dataset(xr.backends.NetCDF4DataStore(ncf), mask_and_scale=True)

For hdf5 data scaling/masking properties will be added to the datasets before decoding. For GAMIC data compound data will be read via h5py.

The data structure holds one [‘root’] xarray dataset which corresponds to the CfRadial2 root-group and one or many [‘sweep_X’] xarray datasets, holding the sweep data. Since for data handling xarray is utilized all xarray features can be exploited, like lazy-loading, pandas-like indexing on N-dimensional data and vectorized mathematical operations across multiple dimensions.

The writer implementation uses xarray for CfRadial2 output and relies on h5py for the ODIM_H5 output.


This implementation is considered experimental. Changes in the API should be expected.

XRadVol BaseClass for xarray based RadarVolumes
CfRadial Class for xarray based retrieval of CfRadial data files
OdimH5 Class for xarray based retrieval of ODIM_H5 data files
open_dataset Open netcdf/hdf5 group as xarray dataset.
to_cfradial2 Save XRadVol to CfRadial2.0 compliant file.
to_odim Save XRadVol to ODIM_H5/V2_2 compliant file.
write_odim Writes Odim Attributes.
write_odim_dataspace Writes Odim Dataspaces
get_sweep_group_name Return sweep names.
get_variables_moments Retrieve radar moments from dataset variables.
get_group_moments Retrieve radar moments from hdf groups.
get_groups Get hdf groups.
get_moment_names Get moment names.