} //Calculates ratio between Z data from Calibration and Z data from Data points static public double[] CalibrationAbsoluteArrayCalculation(double[] DataX, double[] DataY, double[] DataZ, double[] XBkpt, double[] YBkpt, double[,] ZTab) { if (DataX.Length == DataY.Length && DataY.Length == DataZ.Length) //Check Data size plausibility { double[] ZArray = new double[DataX.Length]; for (int i = 0; i < DataX.Length; i++) { if (TabManagementMethods.BilinearInterpolation(DataX[i], DataY[i], XBkpt, YBkpt, ZTab) != 0) { ZArray[i] = TabManagementMethods.BilinearInterpolation(DataX[i], DataY[i], XBkpt, YBkpt, ZTab); } else { ZArray[i] = 0; } } return(ZArray); } else { throw new System.ArgumentException("The X, Y and Z data arrays are not the same size", "original"); } } //Calculates resulting Z calibrated value for each provided X, Y data point
static public double[] CalibrationRatioArrayCalculation(double[] DataX, double[] DataY, double[] DataZ, double[] XBkpt, double[] YBkpt, double[,] ZTab) { if (DataX.Length == DataY.Length && DataY.Length == DataZ.Length) //Check Data size plausibility { double[] ZRatioArray = new double[DataX.Length]; for (int i = 0; i < DataX.Length; i++) { if (TabManagementMethods.BilinearInterpolation(DataX[i], DataY[i], XBkpt, YBkpt, ZTab) != 0) { DataZ[i] = DataZ[i] == 0 ? 0.00000001 : DataZ[i]; ZRatioArray[i] = DataZ[i] / TabManagementMethods.BilinearInterpolation(DataX[i], DataY[i], XBkpt, YBkpt, ZTab); } else if (TabManagementMethods.BilinearInterpolation(DataX[i], DataY[i], XBkpt, YBkpt, ZTab) == 0 && DataZ[i] == 0) { ZRatioArray[i] = 0; } else { DataZ[i] = DataZ[i] == 0 ? 0.00000001 : DataZ[i]; ZRatioArray[i] = DataZ[i] / 0.00000001; } } return(ZRatioArray); } else { throw new System.ArgumentException("The X, Y and Z data arrays are not the same size", "original"); } } //Calculates ratio between Z data from Calibration and Z data from Data points