Spectral Gridding (Springsteel)
Daisho.grid_radar_volume_spectral — Function
grid_radar_volume_spectral(radar_volume, moment_dict, grid_type_dict,
output_file, index_time, sgrid, power_threshold;
missing_key="SQI", valid_key="DBZ", heading=-9999.0,
institution="", source="", include_derivatives=false)Grid a radar volume onto a Springsteel spectral grid and perform spectral analysis.
This is the high-level spectral gridding workflow:
- Extract quadrature coordinates from
sgridin Daisho format - Compute ROI from grid spacing
- Call
grid_volume(reuses entire existing gridding engine) - Populate the Springsteel physical array
- Mask fill values, perform spectral + grid transforms, restore fills
- Write CF-compliant NetCDF output
- Return the populated
sgridfor further analysis
Arguments
radar_volume: Radar volume data structure.moment_dict: Dictionary mapping moment names to integer indices.grid_type_dict: Dictionary mapping moment indices to interpolation type symbols.output_file: Path to the output NetCDF file.index_time: Reference time for the output dataset.sgrid: Pre-configuredSpringsteelGrid(fromcreate_radar_grid).power_threshold: Minimum beam power weight.missing_key,valid_key: Moment names for QC gating.heading: Platform heading in degrees.institution,source: Metadata strings for NetCDF output.include_derivatives: Whether to include derivative fields in output.
Returns
The populated SpringsteelGrid with spectral coefficients and physical values.
See also: create_radar_grid, write_radar_netcdf
grid_radar_volume_spectral(radar_volume, output_file, index_time, sgrid, p::DaishoParameters; heading=-9999.0, institution="", source="", include_derivatives=false)Parameter-struct overload reading gridding config from p.gridding and the moment map from p.moments.
grid_radar_volume_spectral(volumes::AbstractVector{<:Volume}, output_file,
index_time, sgrid, p::DaishoParameters; heading=-9999.0,
institution="", source="", include_derivatives=false)Multi-radar overload: accumulate every sweep of every volume onto ONE shared Springsteel grid centered on the centroid of the radar reference positions (via volume_reference_position), so overlapping radars line up on a common origin. Everything else matches the single-volume form.
Daisho.grid_radar_ppi_spectral — Function
grid_radar_ppi_spectral(radar_volume, moment_dict, grid_type_dict,
output_file, index_time, sgrid, power_threshold;
missing_key="SQI", valid_key="DBZ", heading=-9999.0,
institution="", source="", include_derivatives=false)Grid a radar PPI scan onto a 2D Springsteel spectral grid and perform spectral analysis.
See grid_radar_volume_spectral for the full workflow description.
grid_radar_ppi_spectral(radar_volume, output_file, index_time, sgrid, p::DaishoParameters; heading=-9999.0, institution="", source="", include_derivatives=false)Parameter-struct overload reading gridding config from p.gridding and the moment map from p.moments.
Daisho.grid_radar_column_spectral — Function
grid_radar_column_spectral(radar_volume, moment_dict, grid_type_dict,
output_file, index_time, sgrid, power_threshold;
missing_key="SQI", valid_key="DBZ",
institution="", source="", include_derivatives=false)Grid a radar column onto a 1D Springsteel spectral grid and perform spectral analysis.
See grid_radar_volume_spectral for the full workflow description.
grid_radar_column_spectral(radar_volume, output_file, index_time, sgrid, p::DaishoParameters; institution="", source="", include_derivatives=false)Parameter-struct overload reading gridding config from p.gridding and the moment map from p.moments.
Daisho.create_radar_grid — Function
create_radar_grid(geometry, moment_dict;
xmin=0.0, xmax=0.0, xdim=0,
ymin=0.0, ymax=0.0, ydim=0,
zmin=0.0, zmax=0.0, zdim=0,
mubar=3, quadrature=:gauss,
BCL=NaturalBC(), BCR=NaturalBC(),
BCU=NaturalBC(), BCD=NaturalBC(),
BCB=NaturalBC(), BCT=NaturalBC())Create a Springsteel spectral grid configured for radar data analysis.
Maps Daisho's radar moment dictionary and grid specification to a SpringsteelGrid. The xdim, ydim, zdim parameters specify the number of B-spline cells in each dimension; the actual number of physical grid points is cells × mubar.
Dimension mapping: i = X (easting), j = Y (northing), k = Z (altitude).
Arguments
geometry::String: Grid geometry type ("R","RR", or"RRR").moment_dict::Dict: Dictionary mapping moment names to indices (e.g.,Dict("DBZ" => 1, "VEL" => 2)).xmin,xmax: X-dimension domain bounds (meters).xdim: Number of B-spline cells in X.ymin,ymax: Y-dimension domain bounds (meters, for RR/RRR).ydim: Number of B-spline cells in Y.zmin,zmax: Z-dimension domain bounds (meters, for RRR).zdim: Number of B-spline cells in Z.mubar: Quadrature points per cell (default: 3).quadrature: Quadrature rule (default::gauss).BCL,BCR: Left/right boundary conditions for X. Accepts a SpringsteelBoundaryConditions(e.g.NaturalBC(),DirichletBC(),NeumannBC()) or a legacy module-qualified Dict (e.g.CubicBSpline.R0,CubicBSpline.R1T1). Default:NaturalBC().BCU,BCD: Upper/lower boundary conditions for Y. Same accepted forms asBCL.BCB,BCT: Bottom/top boundary conditions for Z. Same accepted forms asBCL.
Returns
A typed SpringsteelGrid (R_Grid, RR_Grid, or RRR_Grid).
Example
moment_dict = Dict("DBZ" => 1, "VEL" => 2)
sgrid = create_radar_grid("RRR", moment_dict;
xmin=-50000.0, xmax=50000.0, xdim=10,
ymin=-50000.0, ymax=50000.0, ydim=10,
zmin=0.0, zmax=15000.0, zdim=5)See also: get_springsteel_gridpoints_zyx, populate_physical!
create_radar_grid(p::DaishoParameters)
create_radar_grid(cfg::SpringsteelGridConfig, vars::Dict{String,Int})Build a Springsteel grid from the geometry-general [grid.springsteel] config (any supported spline-i geometry: R/RZ/RR/RRR, RL/RLZ/RLR, SL/SLZ/SLR). The Springsteel variable map is built via field_index_dict (1-based indices in field-name-sorted order, order-independent of the source TOML).
Axis mapping into SpringsteelGridParameters: per-axis min/max → iMin/iMax etc.; spline cells → num_cells (i) or jDim/kDim = cells × mubar; Chebyshev points → kDim. Boundary conditions map the axis' min side to Springsteel's BCL/BCD/BCB and max side to BCR/BCU/BCT. Output resampling counts (regular_out) are injected after construction (see _with_regular_out), defaulting to cells + 1 on spline axes.
Note the gridding engine itself currently traverses only the Cartesian R/RR/RRR grids; the other geometries can be built (and transformed/written) but not yet gridded onto — build_springsteel_grid_spec raises a clear error for them.
Spectral Helpers
Daisho.radar_vars — Function
radar_vars(p::DaishoParameters) -> Dict{String,Int}The Springsteel variable map for hand-built grids: field name → 1-based column index in field-name-sorted order, identical to field_index_dict. Pass it as vars when constructing a Springsteel.SpringsteelGridParameters yourself — the escape hatch for grids the [grid.springsteel] schema cannot express (per-variable spectral filters, Fourier/Chebyshev-primary geometries). The gridding entry points validate the grid's vars against the configured [fields] and refuse mismatches, since the gridded-array column order must line up with the spectral-grid variable order.
Daisho.volume_reference_position — Function
volume_reference_position(volume::Volume) -> (lat, lon)Reference (latitude, longitude) of a volume: the stationary position, or the first sweep's georeference when a mobile platform reports (0, 0).
Daisho.build_springsteel_grid_spec — Function
build_springsteel_grid_spec(sgrid; reference_latitude, reference_longitude) -> GridSpec
build_springsteel_grid_spec(sgrid, volume::Volume) -> GridSpecBuild a Daisho GridSpec whose per-axis coordinate sets reproduce the Springsteel grid's quadrature lattice, centered on the given reference position (the volume form uses volume_reference_position). The unified accumulator engine then grids onto exactly the Springsteel node layout.
Cartesian tensor-product assumption. Springsteel Cartesian grids factorize as node(i,j,k) = (X[i], Y[j], Z[k]), so the per-axis coordinate sets fully describe the lattice. Non-Cartesian (cylindrical/spherical) grids raise an ArgumentError — that is where future per-node gridpoints + metric-ROI work plugs in.
Daisho.compute_roi — Function
compute_roi(sgrid::SpringsteelGrid)Compute horizontal and vertical radius-of-influence from a Springsteel grid's quadrature point spacing.
Uses h_factor/v_factor × average quadrature-point spacing (default 0.75, the legacy Daisho convention). The accumulator-path Springsteel provider passes p.gridding.horizontal_roi_factor / vertical_roi_factor.
Arguments
sgrid: ASpringsteelGrid.h_factor: Horizontal ROI fraction of the mean horizontal node spacing.v_factor: Vertical ROI fraction of the mean vertical node spacing (3D only).
Returns
- For 3D grids:
(h_roi, v_roi)tuple. - For 2D grids:
(h_roi,)tuple (single horizontal ROI). - For 1D grids:
(roi,)tuple.
See also: create_radar_grid
Daisho.get_springsteel_gridpoints_zyx — Function
get_springsteel_gridpoints_zyx(sgrid::SpringsteelGrid)Extract Gaussian quadrature coordinates from a Springsteel grid and reshape them into Daisho's array format with [z, y, x] ordering.
Arguments
sgrid: ASpringsteelGrid(RGrid, RRGrid, or RRR_Grid).
Returns
- For RRR (3D):
Array{Float64, 4}of shape(kDim, jDim, iDim, 3)with[:, :, :, 1]= z,[:, :, :, 2]= y,[:, :, :, 3]= x. - For RR (2D):
Array{Float64, 3}of shape(jDim, iDim, 2)with[:, :, 1]= y,[:, :, 2]= x. - For R (1D):
Vector{Float64}of shape(iDim,)with x-coordinates.
See also: create_radar_grid, populate_physical!
Daisho.populate_physical! — Function
populate_physical!(sgrid, radar_grid, moment_dict)Copy Daisho's gridded radar data into a Springsteel grid's physical array (slot 1).
Handles fill value translation:
- true missing (gate not measured, the io
fill_value) →NaN - undetect (scanned, no echo, the io
undetect) → preserved as-is - valid values → copied as-is
Arguments
sgrid::SpringsteelGrid: Target spectral grid.radar_grid::Array: Daisho radar grid with shape(n_moments, zdim, ydim, xdim)for 3D,(n_moments, ydim, xdim)for 2D, or(n_moments, xdim)for 1D.moment_dict::Dict: Mapping of moment names to column indices.
See also: create_radar_grid, get_springsteel_gridpoints_zyx
Daisho.write_radar_netcdf — Function
write_radar_netcdf(filename, sgrid, radar_volume, moment_dict;
ref_lat=0.0, ref_lon=0.0, institution="", source="", heading=-9999.0,
include_derivatives=false)Write a Springsteel spectral grid with radar data to a CF-compliant NetCDF file.
Calls Springsteel.write_netcdf with radar-specific global attributes, then patches in radar variable attributes and grid mapping via NCDatasets.
Arguments
filename: Output NetCDF file path.sgrid: ASpringsteelGridwith populated physical and spectral arrays.radar_volume: Daisho radar volume for metadata extraction.moment_dict: Dictionary mapping moment names to indices.ref_lat,ref_lon: Reference latitude/longitude for projection.institution,source: Metadata strings.heading: Platform heading in degrees.include_derivatives: Whether to include derivative fields in output.
See also: radar_global_attributes, grid_radar_volume_spectral
Daisho.radar_global_attributes — Function
radar_global_attributes(radar_volume, ref_lat, ref_lon;
institution="", source="", heading=-9999.0)Build a CF-compliant global attribute dictionary for radar NetCDF output.
Arguments
radar_volume: Daisho radar volume data structure.ref_lat: Reference latitude for the Transverse Mercator projection (degrees).ref_lon: Reference longitude for the Transverse Mercator projection (degrees).institution: Institution name string.source: Source instrument description.heading: Platform heading in degrees (default: -9999.0 for missing).
Returns
Dict{String,Any} of CF-compliant global attributes.
See also: write_radar_netcdf