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_model::data::Product;
use nexrad_render::{render_radials, RenderOptions, nws_reflectivity_scale};
let options = RenderOptions::new(800, 800);
let image = render_radials(
sweep.radials(),
Product::Reflectivity,
&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.
- Color
Stop - A color stop for a continuous color scale.
- Continuous
Color Scale - A continuous color scale that linearly interpolates between color stops.
- Discrete
Color Scale - A discrete color scale that maps value ranges to colors.
- Point
Query - Result of querying a data value at a specific point.
- Render
Metadata - Metadata describing the pixel-to-coordinate mapping of a rendered image.
- Render
Options - Options for rendering radar radials.
- Render
Result - The result of a render operation.
Enums§
- Color
Scale - A color scale that can be either discrete or continuous.
- Interpolation
- Interpolation method for rendering radar data.
- Product
- Identifies a radar data product (moment type).
Functions§
- clutter_
filter_ power_ scale - Returns a color scale for clutter filter power (CFP) data.
- correlation_
coefficient_ scale - Returns a color scale for correlation coefficient (CC/RhoHV) data.
- default_
color_ scale - Returns the default color scale for a product, wrapped in a
ColorScaleenum. - default_
scale - Returns the default color scale for a given product.
- differential_
phase_ scale - Returns a color scale for differential phase (PhiDP) data.
- differential_
reflectivity_ scale - Returns a color scale for differential reflectivity (ZDR) data.
- nws_
reflectivity_ scale - Returns the standard NWS (National Weather Service) reflectivity color scale.
- render_
cartesian - Renders a
CartesianField(geographic grid) to an image with metadata. - render_
radials - Renders radar radials to an RGBA image.
- render_
radials_ default - Renders radar radials using the default color scale for the product.
- render_
sweep - Renders a
SweepField(polar grid) to an image with metadata. - render_
vertical - Renders a
VerticalField(RHI / cross-section display) to an image with metadata. - spectrum_
width_ scale - Returns a color scale for spectrum width data.
- velocity_
scale - Returns a color scale for radial velocity data.
Type Aliases§
- Rgba
Image - Sendable Rgb + alpha channel image buffer