Skip to main content

Crate nexrad_render

Crate nexrad_render 

Source
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-model types (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.
ColorLookupTable
A pre-computed lookup table for O(1) color lookups.
ColorScaleLevel
A single level in a discrete color scale.
ColorStop
A color stop for a continuous color scale.
ContinuousColorScale
A continuous color scale that linearly interpolates between color stops.
DiscreteColorScale
A discrete color scale that maps value ranges to colors.
PointQuery
Result of querying a data value at a specific point.
RenderMetadata
Metadata describing the pixel-to-coordinate mapping of a rendered image.
RenderOptions
Options for rendering radar radials.
RenderResult
The result of a render operation.

Enums§

ColorScale
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 ColorScale enum.
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§

RgbaImage
Sendable Rgb + alpha channel image buffer