Package org.xtce.math
Class SplineCalibration
- java.lang.Object
-
- org.xtce.math.SplineCalibration
-
- All Implemented Interfaces:
Calibration
public class SplineCalibration extends Object implements Calibration
Class to apply a calibration specified in an XTCE document in the form of a Spline Calibrator.- Author:
- David Overeem
-
-
Constructor Summary
Constructors Constructor Description SplineCalibration(CalibratorType.SplineCalibrator splineElement)Constructs a Calibration object based on the SplineCalibrator element in the XTCE document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Numbercalibrate(Number xValue)Apply this Spline Calibrator, otherwise known as a "piecewise function", to an uncalibrated value.Numberuncalibrate(Number yValue)Apply this Spline Calibrator to an already calibrated value.
-
-
-
Constructor Detail
-
SplineCalibration
public SplineCalibration(CalibratorType.SplineCalibrator splineElement)
Constructs a Calibration object based on the SplineCalibrator element in the XTCE document.- Parameters:
splineElement- SplineCalibrator containing the data.
-
-
Method Detail
-
calibrate
public Number calibrate(Number xValue) throws XTCEDatabaseException
Apply this Spline Calibrator, otherwise known as a "piecewise function", to an uncalibrated value. The Spline Point pairs in XTCE are expected to be in sequential order from lowest to highest raw value. The first two points are mandatory and subsequent points are made by adding one new point and dropping the previous low point. This assures that the evaluation is continuous. It is also assumed that they are in order from lowest raw value to highest raw value.- Specified by:
calibratein interfaceCalibration- Parameters:
xValue- Number containing the uncalibrated value.- Returns:
- Number containing the calibrated value after the calibration.
- Throws:
XTCEDatabaseException- when the Spline Calibrator has unsupported features, the calibrated value is unbounded, or has infinite slope between points.
-
uncalibrate
public Number uncalibrate(Number yValue) throws XTCEDatabaseException
Apply this Spline Calibrator to an already calibrated value. The Spline Point pairs in XTCE are expected to be in sequential order from lowest to highest raw value. The first two points are mandatory and subsequent points are made by adding one new point and dropping the previous low point. This assures that the evaluation is continuous. It is also assumed that they are in order from lowest raw value to highest raw value.- Specified by:
uncalibratein interfaceCalibration- Parameters:
yValue- Number containing a calibrated value.- Returns:
- Number containing the uncalibrated value after the reverse calibration operation.
- Throws:
XTCEDatabaseException- when the Spline Calibrator has unsupported features, the calibrated value is unbounded, or has infinite slope between points.
-
-