Пример #1
0
            private Point Interpolate(Point pt, InterpolationMethod method)
            {
                if (pt.IsMissing)
                {
                    return(new Point(pt.DateTime, Point.MissingValueFlag));
                }

                if (pt.Value > MaxXValue())
                {
                    return(new Point(pt.DateTime, Point.MissingValueFlag));
                }

                if (pt.Value < MinXValue())
                { // if first value in table computes zero, then extrapolate a zero.
                    if (System.Math.Abs(MinYValue()) < 0.01)
                    {
                        return(new Point(pt.DateTime, 0, PointFlag.Edited));
                    }

                    return(new Point(pt.DateTime, Point.MissingValueFlag));
                }

                var d = Math.Interpolate(this, pt.Value, this.columnx.ColumnName, this.columny.ColumnName, method);

                return(new Point(pt.DateTime, d));
            }
Пример #2
0
            /// <summary>
            /// interpolation for OWRD shifts.
            /// extrapolate values lower than minimum using the minimum
            /// </summary>
            /// <param name="val"></param>
            /// <returns></returns>
            public double InterpolateExtrapolateLow(double val)
            {
                if (val > MaxXValue())
                {
                    return(Point.MissingValueFlag);
                }

                if (val < MinXValue())
                {
                    return(MinYValue());
                }

                return(Math.Interpolate(this, val, this.columnx.ColumnName, this.columny.ColumnName));
            }
Пример #3
0
            public double Interpolate(double val)
            {
                if (val > MaxXValue())
                {
                    return(Point.MissingValueFlag);
                }

                if (val < MinXValue())
                { // if last value on table computes zero, then extrapolate a zero.
                    if (System.Math.Abs(MinYValue()) < 0.01)
                    {
                        return(0);
                    }

                    return(Point.MissingValueFlag);
                }


                return(Math.Interpolate(this, val, this.columnx.ColumnName, this.columny.ColumnName));
            }