STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
feedtwin.model.curve.Curve Class Reference

Public Member Functions

None __post_init__ (self)
tuple[float,...] x_si (self)
tuple[float,...] y_si (self)
tuple[float, float] x_range_si (self)
float __call__ (self, float x_si)
None check_dimensions (self, str x_dimension, str y_dimension, str where)
dict[str, Any] to_dict (self)
Curve from_dict (cls, dict[str, Any] data, str where="curve")

Public Attributes

 source
 x_unit
 y_unit
 x_si
 y_si

Static Public Attributes

tuple x [float, ...]
tuple y [float, ...]
str reference = ""
bool extrapolate = False

Detailed Description

One tabulated relationship, stored as authored and evaluated in SI.

Args:
    x: Independent values, strictly increasing, in ``x_unit``.
    y: Dependent values, same length, in ``y_unit``.
    x_unit, y_unit: Registered unit names.
    source: Where the curve came from. Required, like any parameter.
    reference: The test or document behind it.
    extrapolate: Whether to hold the end values outside the range instead of
        raising. Off by default and rarely right; a valve curve that stops at
        90% travel genuinely does not say what happens at 100%.

Definition at line 35 of file curve.py.

Member Function Documentation

◆ __call__()

float feedtwin.model.curve.Curve.__call__ ( self,
float x_si )
Interpolate at a point given in canonical units.

Linear between points. Higher-order interpolation of sparse measured
data invents structure that was never measured, which matters more here
than smoothness does.

Definition at line 84 of file curve.py.

References extrapolate, max, min, and x_range_si().

◆ __post_init__()

None feedtwin.model.curve.Curve.__post_init__ ( self)

Definition at line 57 of file curve.py.

References Adafruit_LIS3DH.x, x, Adafruit_LIS3DH.y, and y.

◆ check_dimensions()

None feedtwin.model.curve.Curve.check_dimensions ( self,
str x_dimension,
str y_dimension,
str where )
Raise unless the axes measure what a component expects.

Definition at line 102 of file curve.py.

References x_unit, and y_unit.

◆ from_dict()

Curve feedtwin.model.curve.Curve.from_dict ( cls,
dict[str, Any] data,
str where = "curve" )

◆ to_dict()

◆ x_range_si()

tuple[float, float] feedtwin.model.curve.Curve.x_range_si ( self)

Definition at line 80 of file curve.py.

References x_si.

Referenced by __call__().

◆ x_si()

tuple[float, ...] feedtwin.model.curve.Curve.x_si ( self)

Definition at line 72 of file curve.py.

References Adafruit_LIS3DH.x, x, and x_unit.

◆ y_si()

tuple[float, ...] feedtwin.model.curve.Curve.y_si ( self)

Definition at line 76 of file curve.py.

References Adafruit_LIS3DH.y, y, and y_unit.

Member Data Documentation

◆ extrapolate

bool feedtwin.model.curve.Curve.extrapolate = False
static

Definition at line 55 of file curve.py.

Referenced by __call__(), and to_dict().

◆ reference

str feedtwin.model.curve.Curve.reference = ""
static

◆ source

feedtwin.model.curve.Curve.source

Definition at line 66 of file curve.py.

Referenced by to_dict(), and feedtwin.model.param.Param.to_dict().

◆ x

feedtwin.model.curve.Curve.x [float, ...]
static

◆ x_si

feedtwin.model.curve.Curve.x_si

Definition at line 100 of file curve.py.

Referenced by x_range_si().

◆ x_unit

feedtwin.model.curve.Curve.x_unit

Definition at line 68 of file curve.py.

Referenced by check_dimensions(), to_dict(), and x_si().

◆ y

◆ y_si

feedtwin.model.curve.Curve.y_si

Definition at line 100 of file curve.py.

◆ y_unit

feedtwin.model.curve.Curve.y_unit

Definition at line 69 of file curve.py.

Referenced by check_dimensions(), to_dict(), and y_si().


The documentation for this class was generated from the following file: