Expand description
Rendering functions for NEXRAD weather radar data.
This crate provides functions to render radar data into visual images. It converts radar moment data (reflectivity, velocity, etc.) into color-mapped images that can be saved to common formats like PNG.
§Example
ⓘ
use nexrad_render::{render_radials, Product, RenderOptions, get_nws_reflectivity_scale};
let options = RenderOptions::new(800, 800);
let image = render_radials(
sweep.radials(),
Product::Reflectivity,
&get_nws_reflectivity_scale(),
&options,
).unwrap();
// Save directly to PNG
image.save("radar.png").unwrap();§Crate Boundaries
This crate provides visualization and rendering with the following responsibilities and constraints:
§Responsibilities
- Render radar data to images (
image::RgbaImage) - Apply color scales to moment data
- Handle geometric transformations (polar to Cartesian coordinates)
- Consume
nexrad-modeltypes (Radial, MomentData)
§Constraints
- No data access or network operations
- No binary parsing or decoding
This crate can be used standalone or through the nexrad facade crate (re-exported
via the render feature, which is enabled by default).
Modules§
- result
- Result and error types for NEXRAD rendering operations.
Structs§
- Color
- An RGBA color with components in the range 0.0 to 1.0.
- Color
Lookup Table - A pre-computed lookup table for O(1) color lookups.
- Color
Scale Level - A single level in a discrete color scale.
- Discrete
Color Scale - A discrete color scale that maps value ranges to colors.
- Render
Options - Options for rendering radar radials.
Enums§
- Product
- Radar data products that can be rendered.
Functions§
- get_
correlation_ coefficient_ scale - Returns a color scale for correlation coefficient (CC/RhoHV) data.
- get_
default_ scale - Returns the default color scale for a given product.
- get_
differential_ phase_ scale - Returns a color scale for differential phase (PhiDP) data.
- get_
differential_ reflectivity_ scale - Returns a color scale for differential reflectivity (ZDR) data.
- get_
nws_ reflectivity_ scale - Returns the standard NWS (National Weather Service) reflectivity color scale.
- get_
product_ value_ range - Returns the value range (min, max) for a given product.
- get_
specific_ diff_ phase_ scale - Returns a color scale for specific differential phase (KDP) data.
- get_
spectrum_ width_ scale - Returns a color scale for spectrum width data.
- get_
velocity_ scale - Returns a color scale for radial velocity data.
- render_
radials - Renders radar radials to an RGBA image.
- render_
radials_ default - Renders radar radials using the default color scale for the product.
Type Aliases§
- Rgba
Image - Sendable Rgb + alpha channel image buffer