Table of Contents

Class Calibration

Namespace
Pamoja.Kit
Assembly
Pamoja.Kit.dll

Turns a raw sensor count into the units the reading is actually in.

public sealed class Calibration : IDisposable
Inheritance
Calibration
Implements
Inherited Members

Remarks

A sensor reports counts, not litres or degrees; a calibration is the mapping between them, either stated outright or fitted through two known points.

Methods

Apply(float)

Converts a raw reading into calibrated units.

public float Apply(float raw)

Parameters

raw float

The raw sensor reading.

Returns

float

The reading in real units.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Linear(float, float)

Creates a calibration applying raw * scale + offset.

public static Calibration Linear(float scale, float offset)

Parameters

scale float

The multiplier applied to the raw reading.

offset float

The constant added after scaling.

Returns

Calibration

The calibration.

TwoPoint(float, float, float, float)

Creates a calibration fitted through two known reference points.

public static Calibration TwoPoint(float rawLow, float valueLow, float rawHigh, float valueHigh)

Parameters

rawLow float

The raw reading at the low reference point.

valueLow float

The real value at the low reference point.

rawHigh float

The raw reading at the high reference point.

valueHigh float

The real value at the high reference point.

Returns

Calibration

The calibration.