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.
Xarray BackendEntrypoint for CfRadial1 data. |
|
Xarray BackendEntrypoint for CfRadial2 data. |
|
Xarray BackendEntrypoint for Furuno data. |
|
Xarray BackendEntrypoint for GAMIC data. |
|
Xarray BackendEntrypoint for IRIS/Sigmet data. |
|
Xarray BackendEntrypoint for ODIM data. |
|
Xarray BackendEntrypoint for RADOLAN data. |
|
Xarray BackendEntrypoint for Rainbow5 data. |
Digital Elevation Model Data I/O¶
Provide surface/terrain elevation information from SRTM data
Download NASA SRTM elevation data Only available with login/password |
|
Get NASA SRTM elevation data |
|
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 and decode a Furuno radar sweep from a file or file-like object. |
|
Open and decode a Furuno radar sweep from a file or file-like object. |
GDAL Raster/Vector Data I/O¶
Open vector file, return gdal.Dataset and OGR.Layer |
|
Open raster file, return gdal.Dataset |
|
Read MSG SAFNWC hdf5 file into a gdal georeferenced object |
|
Creates GDAL.DataSet object. |
|
Write raster dataset to file format |
|
DataSource class for handling ogr/gdal vector data |
HDF Data I/O¶
Open and decode an GAMIC radar sweep or volume from a file or file-like object. |
|
Open and decode an GAMIC radar sweep or volume from a file or file-like object. |
|
Reads GPM files version V07A. |
|
Open and decode an ODIM radar sweep or volume from a file or file-like object. |
|
Open and decode an ODIM radar sweep or volume from a file or file-like object. |
|
Reads hdf5 files according to their structure |
|
Reads hdf5 files according to OPERA conventions |
|
Data reader for hdf5 files produced by the commercial GAMIC Enigma V3 MURAN software |
|
Quick storage of one <data> array and a <metadata> dict in an hdf5 file |
|
Loading data from hdf5 files that was stored by |
|
Reads GPM files for matching with GR |
|
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 and decode an IRIS radar sweep or volume from a file or file-like object. |
|
Open and decode an Iris radar sweep or volume from a file or file-like object. |
|
Read Iris file and return dictionary. |
|
Class for retrieving data from Sigmet IRIS Product files. |
|
Class for retrieving data from Sigmet IRIS Cartesian Product files. |
Miscellaneous Data I/O¶
Writes Polygons to a Text file which can be interpreted by ESRI ArcGIS's "Create Features from Text File (Samples)" tool. |
|
Pickle object <obj> to file <fpath> |
|
Return pickled object from file <fpath> |
|
Download radiosonde data from internet. |
|
Reads membership function parameters from wradlib-data file. |
NetCDF Data I/O¶
Open and decode an CfRadial1 radar sweep or volume from a file or file-like object. |
|
Open and decode an CfRadial1 radar sweep or volume from a file or file-like object. |
|
Open and decode an CfRadial2 radar sweep or volume from a file or file-like object. |
|
Open and decode an CfRadial2 radar sweep or volume from a file or file-like object. |
|
Data reader for netCDF files exported by the EDGE radar software |
|
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 and decode a RADOLAN dataset from a file or file-like object. |
|
Open multiple RADOLAN files as a single dataset. |
|
Data reader for German Weather Service DX product raw radar data files. |
|
Read quantitative radar composite format of the German Weather Service |
|
Opens radolan file and returns file handle |
|
Reads radolan ASCII header and returns it as string |
|
Parses the ASCII header of a DWD quantitative composite file |
|
Read binary data from file given by filehandle |
|
Decodes the binary runlength coded section from DWD composite file and return decoded numpy array with correct shape |
|
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.
Reads Rainbow files according to their structure |
|
Open and decode an RAINBOW5 radar sweep or volume from a file or file-like object. |
|
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.
Minimal variable wrapper. |
|
Class for holding a volume of radar sweeps |
|
Open and decode a radar sweep or volume from a single file or file-like object. |
|
Open multiple radar files as a single radar sweep dataset or radar volume. |
|
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
Warning
This implementation is considered experimental. Changes in the API should be expected.
BaseClass for xarray based RadarVolumes |
|
Class for xarray based retrieval of CfRadial data files |
|
Class for xarray based retrieval of ODIM_H5 data files |
|
Open multiple ODIM files as a XRadVolume structure. |
|
Class for holding one radar sweep |
|
Class for holding one radar moment |
|
Class for holding a timeseries of radar sweeps |
|
Class for holding a volume of radar sweeps |
|
Deprecated since version 1.5. |