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.

Xarray backends

Reading radar data into xarray Datasets using xarray.open_dataset and xarray.open_mfdataset.

Backends have been moved to xradar package. Here we keep stubs for backwards compatibility.

CfRadial1BackendEntrypoint

Xarray BackendEntrypoint for CfRadial1 data.

CfRadial2BackendEntrypoint

Xarray BackendEntrypoint for CfRadial2 data.

FurunoBackendEntrypoint

Xarray BackendEntrypoint for Furuno data.

GamicBackendEntrypoint

Xarray BackendEntrypoint for GAMIC data.

IrisBackendEntrypoint

Xarray BackendEntrypoint for IRIS/Sigmet data.

OdimBackendEntrypoint

Xarray BackendEntrypoint for ODIM data.

RadolanBackendEntrypoint

Xarray BackendEntrypoint for RADOLAN data.

RainbowBackendEntrypoint

Xarray BackendEntrypoint for Rainbow5 data.

Digital Elevation Model Data I/O

Provide surface/terrain elevation information from SRTM data

download_srtm

Download NASA SRTM elevation data Only available with login/password

get_srtm

Get NASA SRTM elevation data

get_srtm_tile_names

Get NASA SRTM elevation data tile names

Furuno binary Data I/O

Reads data from Furuno’s binary data formats. Former available code was ported to xradar-package and is imported from there.

open_furuno_dataset

Open and decode a Furuno radar sweep from a file or file-like object.

open_furuno_mfdataset

Open and decode a Furuno radar sweep from a file or file-like object.

GDAL Raster/Vector Data I/O

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

gdal_create_dataset

Creates GDAL.DataSet object.

write_raster_dataset

Write raster dataset to file format

VectorSource

DataSource class for handling ogr/gdal vector data

HDF Data I/O

open_gamic_dataset

Open and decode an GAMIC radar sweep or volume from a file or file-like object.

open_gamic_mfdataset

Open and decode an GAMIC radar sweep or volume from a file or file-like object.

open_gpm_dataset

Reads GPM files version V07A.

open_odim_dataset

Open and decode an ODIM radar sweep or volume from a file or file-like object.

open_odim_mfdataset

Open and decode an ODIM radar sweep or volume from a file or file-like object.

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

IRIS/Sigmet Data I/O

Reads data from Vaisala’s IRIS data formats. Former available code was ported to xradar-package and is imported from there.

IRIS (Vaisala Sigmet Interactive Radar Information System)

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

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.

open_iris_dataset

Open and decode an IRIS radar sweep or volume from a file or file-like object.

open_iris_mfdataset

Open and decode an Iris radar sweep or volume from a file or file-like object.

read_iris

Read Iris file and return dictionary.

IrisRecordFile

IrisRawFile

IrisProductFile

Class for retrieving data from Sigmet IRIS Product files.

IrisCartesianProductFile

Class for retrieving data from Sigmet IRIS Cartesian Product files.

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.

NetCDF Data I/O

open_cfradial1_dataset

Open and decode an CfRadial1 radar sweep or volume from a file or file-like object.

open_cfradial1_mfdataset

Open and decode an CfRadial1 radar sweep or volume from a file or file-like object.

open_cfradial2_dataset

Open and decode an CfRadial2 radar sweep or volume from a file or file-like object.

open_cfradial2_mfdataset

Open and decode an CfRadial2 radar sweep or volume from a file or file-like object.

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.

RADOLAN and DX Data I/O

Reading DX and RADOLAN data from German Weather Service

Warning

Additionally to the binary composite formats DWD also provides data in ASCII format, which have a very limited header and need to extract product and datetime from the filename. Use on your own risk.

open_radolan_dataset

Open and decode a RADOLAN dataset from a file or file-like object.

open_radolan_mfdataset

Open multiple RADOLAN files as a single dataset.

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

radolan_to_xarray

Converts RADOLAN data to xarray Dataset

Rainbow Data I/O

Reads data from Leonardo’s Rainbow5 data formats. Former available code was ported to xradar-package and is imported from there.

read_rainbow reads all data and metadata into a dictionary. Reading sweep data can be skipped by setting loaddata=False.

open_rainbow_dataset and open_rainbow_mfdataset read Rainbow5 data into xarray Datasets with a CfRadial2-like structure. For this mmap.mmap is utilized.

read_rainbow

Reads Rainbow files according to their structure

open_rainbow_dataset

Open and decode an RAINBOW5 radar sweep or volume from a file or file-like object.

open_rainbow_mfdataset

Open and decode an RAINBOW5 radar sweep or volume from a file or file-like object.

Xarray based Data I/O

Note

The Xarray backend code has moved to xradar-package. Here we keep a backwards-compatibility by providing knwon API.

Reads data from netcdf-based CfRadial1, CfRadial2,hdf5-based ODIM_H5 and other hdf5-flavours (GAMIC), Iris/Sigmet and Rainbow5. More radar backends will be implemented as needed.

Writes data to CfRadial2, ODIM_H5 or plain netCDF files.

This reader implementation uses

It utilizes the newly implemented xarray.backends.BackendEntrypoint. For every radar source (CfRadial1, CfRadial2, GAMIC, ODIM, IRIS, Rainbow5) a specific backend is implemented in wradlib which returns an specific sweep as xarray.Dataset. Convenience functions (eg. wradlib.io.xarray.open_radar_dataset) are available to read volume data into shallow wradlib.io.xarray.RadarVolume-wrapper.

Warning

This implementation is considered experimental. It will be based on CfRadial2, ODIM_H5 and the new standard enforced by WMO JET-OWR `FM301 <https://community.wmo.int/wmo-jet-owr-seminar-series-weather-radar-data-exchange>. Changes in the API should be expected. The development is continued at xradar-package.

WradlibVariable

Minimal variable wrapper.

RadarVolume

Class for holding a volume of radar sweeps

open_radar_dataset

Open and decode a radar sweep or volume from a single file or file-like object.

open_radar_mfdataset

Open multiple radar files as a single radar sweep dataset or radar volume.

to_netcdf

Save RadarVolume/XRadVolume to netcdf compliant file.

Xarray based Data I/O (deprecated)

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

This reader implementation uses

The following two approaches are not recommended and will be removed from the codebase in wradlib v 2.0.0.

In the first approach the data is claimed using netcdf4-Dataset in a diskless non-persistent mode as follows:

vol = io.xarray.OdimH5(ncfile)
# or
vol = io.xarray.CfRadial(ncfile)

The vol data structure holds one or many [‘sweep_X’] xarray datasets, containing the sweep data. The root group xarray dataset which corresponds to the CfRadial2 root-group is available via the .root-object.

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

The second approach reads ODIM files (metadata) into a simple accessible structure:

vol = wradlib.io.open_odim(paths, loader='netcdf4', **kwargs)

All datafiles are accessed via the given loader (‘netcdf4’, ‘h5py’, ‘h5netcdf’). Only absolutely necessary data is actually read in this process, eg. acquisition time and elevation, to fill the structure accordingly. All subsequent metadata retrievals are cached to further improve performance. Actual data access is realised via xarray using engine ‘netcdf4’ or ‘h5netcdf’, depending on the loader.

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.

Examples

See Multi File OdimH5 reader.

Warning

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_odim

Open multiple ODIM files as a XRadVolume structure.

XRadSweep

Class for holding one radar sweep

XRadMoment

Class for holding one radar moment

XRadTimeSeries

Class for holding a timeseries of radar sweeps

XRadVolume

Class for holding a volume of radar sweeps

create_xarray_dataarray

Deprecated since version 1.5.