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_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-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.
DiscreteColorScale
A discrete color scale that maps value ranges to colors.
RenderOptions
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§

RgbaImage
Sendable Rgb + alpha channel image buffer