Skip to main content

read_record_variable

Function read_record_variable 

Source
pub fn read_record_variable<T: NcReadType>(
    file_data: &[u8],
    var: &NcVariable,
    numrecs: u64,
    record_stride: u64,
) -> Result<ArrayD<T>>
Expand description

Read the entire data for a record variable into an ndarray.

Record variables are interleaved: for each of numrecs records, every record variable contributes record_size bytes (padded to 4-byte alignment for CDF-1/2). The record_stride is the total size of one record across all record variables.

Parameters:

  • file_data: the raw file bytes
  • var: the record variable to read
  • numrecs: number of records (from the file header)
  • record_stride: total bytes per record (sum of all record variables’ padded vsizes)