Skip to main content

to_regular_grid

Function to_regular_grid 

Source
pub fn to_regular_grid(
    offsets: &[usize],
    argvals: &[f64],
    values: &[f64],
    target_grid: &[f64],
) -> Vec<f64>
Expand description

Convert irregular data to regular grid via linear interpolation.

Missing values (outside observation range) are marked as NaN.

§Arguments

  • offsets - Start indices (length n+1)
  • argvals - All observation points concatenated
  • values - All values concatenated
  • target_grid - Regular grid to interpolate to

§Returns

Data matrix (n × len(target_grid)) in column-major format