Skip to main content

replace_dummy_samples

Function replace_dummy_samples 

Source
pub(crate) fn replace_dummy_samples(batch: &mut [f64]) -> usize
Expand description

Replaces LJM auto-recovery placeholders with NaN and returns how many.

LJM keeps the scan count intact when it recovers, so timestamps stay correct, but the placeholder would otherwise be archived as a real -9999 V reading.

§Arguments

  • batch - Interleaved samples from one LJM read, changed in place.

§Returns

The number of values replaced, across all channels.

§Examples

[3.72, -9999.0, 3.71]  ->  [3.72, NaN, 3.71], returns 1