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.

CfRadial1BackendEntrypoint

Xarray BackendEntrypoint for CfRadial1 data.

CfRadial2BackendEntrypoint

Xarray BackendEntrypoint for CfRadial2 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

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

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_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

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.

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.

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.

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

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

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 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

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.

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_cfradial2

Save RadarVolume/XRadVol/XRadVolume to CfRadial2.0 compliant file.

to_odim

Save RadarVolume/XRadVol/XRadVolume to ODIM_H5/V2_2 compliant file.

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.