Documentation ¶
Overview ¶
Package radolan parses the DWD RADOLAN / RADVOR radar composite format. This data is available at the Open Data Portal (https://www.dwd.de/DE/leistungen/opendata/opendata.html). The obtained results can be processed and visualized with additional functions.
Tested input products and grids:
| Product | Grid | Description | | ------- | ----------------- | ----------------------- | | EX | middle-european | reflectivity | | FX | national | nowcast reflectivity | | FZ | national | nowcast reflectivity | | PE | local | echo top | | PF | local | reflectivity | | PG | national picture | reflectivity | | PR | local | doppler radial velocity | | PX | local | reflectivity | | PZ | local | 3D reflectivity CAPPI | | RW | national | hourly accumulated | | RX | national | reflectivity | | SF | national | daily accumulated | | WX | extended national | reflectivity |
Those can be considered working with sufficient accuracy.
In cases, where the publicly available format specification is unprecise or contradictory, reverse engineering was used to obtain reasonable approaches.
Used references: [1] https://www.dwd.de/DE/leistungen/radolan/radolan_info/radolan_radvor_op_komposit_format_pdf.pdf [2] https://www.dwd.de/DE/leistungen/gds/weiterfuehrende_informationen.zip [3] https://www.dwd.de/DE/leistungen/radarprodukte/formatbeschreibung_fxdaten.pdf [4] https://www.dwd.de/DE/leistungen/opendata/help/radar/radar_pg_coordinates_pdf.pdf [5] https://www.dwd.de/DE/leistungen/radarniederschlag/rn_info/download_niederschlagsbestimmung.pdf [6] https://www.dwd.de/DE/leistungen/radarprodukte/formatbeschreibung_wndaten.pdf [7] hex editor and much reverse engineering
Index ¶
Constants ¶
const ( Unit_unknown = iota Unit_mm // mm/interval Unit_dBZ // dBZ Unit_km // km Unit_mps // m/s )
const (
DE1200Grid grid // resolution: 1100km * 1200km
)
Variables ¶
var ( Aniol80 = NewZR(256, 1.42) // operational use in germany, described in [5] Doelling98 = NewZR(316, 1.50) // operational use in switzerland JossWaldvogel70 = NewZR(300, 1.50) MarshallPalmer55 = NewZR(200, 1.60) // operational use in austria )
Common Z-R relationships
var ErrUnknownUnit = newError("NewComposite", "data unit not defined in catalog. data values can be incorrect")
ErrUnknownUnit indicates that the unit of the radar data is not defined in the catalog. The data values can be incorrect due to unit dependent conversions during parsing. Be careful when further processing the composite.
var NaN = float32(math.NaN())
Functions ¶
func PrecipitationRate ¶
PrecipitationRate returns the estimated precipitation rate in mm/h for the given reflectivity factor and Z-R relationship.
func Reflectivity ¶
Reflectivity returns the estimated reflectivity factor for the given precipitation rate (mm/h) and Z-R relationship.
Types ¶
type Composite ¶
type Composite struct { Product string // composite product label CaptureTime time.Time // time of source data capture used for forcasting ForecastTime time.Time // data represents conditions predicted for this time Interval time.Duration // time duration until next forecast DataUnit Unit PlainData [][]float32 // data for parsed plain data element [y][x] Px int // plain data width Py int // plain data height DataZ [][][]float32 // data for each voxel [z][y][x] (composites use only one z-layer) Data [][]float32 // data for each pixel [y][x] at layer 0 (alias for DataZ[0][x][y]) Dx int // data width Dy int // data height Dz int // data layer Rx float64 // horizontal resolution in km/px Ry float64 // vertical resolution in km/px HasProjection bool // coordinate projection available Format int // Version Format // contains filtered or unexported fields }
Radolan radar data is provided as single local sweeps or so called composite formats. Each composite is a combined image consisting of mulitiple radar sweeps spread over the composite area. The 2D composite c has a an internal resolution of c.Dx (horizontal) * c.Dy (vertical) records covering a real surface of c.Dx * c.Rx * c.Dy * c.Dy square kilometers. The pixel value at the position (x, y) is represented by c.Data[ y ][ x ] and is stored as raw float value (NaN if the no-data flag is set). Some 3D radar products feature multiple layers in which the voxel at position (x, y, z) is accessible by c.DataZ[ z ][ y ][ x ].
The data value is used differently depending on the product type: (also consult the DataUnit field of the Composite)
Product label | values represent | unit -------------------------+--------------------------+------------------------ PG, PC, PX*, ... | cloud reflectivity | dBZ RX, WX, EX, FZ, FX, ... | cloud reflectivity | dBZ RW, SF, ... | aggregated precipitation | mm/interval PR*, ... | doppler radial velocity | m/s
The cloud reflectivity (in dBZ) can be converted to rainfall rate (in mm/h) via PrecipitationRate().
The cloud reflectivity factor Z is stored in its logarithmic representation dBZ:
dBZ = 10 * log(Z)
Real world geographical coordinates (latitude, longitude) can be projected into the coordinate system of the composite by using the projection method:
// if c.HasProjection x, y := c.Project(52.51861, 13.40833) // Berlin (lat, lon) dbz := c.At(int(x), int(y)) // Raw value is Cloud reflectivity (dBZ) rat := radolan.PrecipitationRate(radolan.Doelling98, dbz) // Rainfall rate (mm/h) using Doelling98 as Z-R relationship fmt.Println("Rainfall in Berlin [mm/h]:", rat)
func NewComposite ¶
NewComposite reads binary data from rd and parses the composite. An error is returned on failure. When ErrUnknownUnit is returned, the data values can be incorrect due to unit dependent conversions during parsing. In this case be careful when further processing the composite.
func NewComposites ¶
NewComposites reads .tar.bz2 data from rd and returns the parsed composites sorted by ForecastTime in ascending order.
func NewDummy ¶
NewDummy creates a blank dummy composite with the given product label, format version, and dimensions. It can be used for generic coordinate projection.
func (*Composite) At ¶
At is shorthand for c.Data[y][x] and returns the radar video processor value at the given point. NaN is returned, if no data is available or the requested point is located outside the scanned area.
func (*Composite) AtZ ¶
AtZ is shorthand for c.DataZ[z][y][x] and returns the radar video processor value at the given point. NaN is returned, if no data is available or the requested point is located outside the scanned volume.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
radolan2png is an example program for the radolan package, that converts radolan composite files to .png images.
|
radolan2png is an example program for the radolan package, that converts radolan composite files to .png images. |