Ejemplo n.º 1
0
        static CylData CorrectRing(CylData uncorrectedData, CylData landPointArr, ProbeDirection probeDirection, double nominalRadius)
        {
            try
            {
                int  polyOrder  = 1;
                bool segmentFit = true;

                var coeffList     = new List <double[]>();
                var landPointList = new CylData(uncorrectedData.FileName);

                landPointList.AddRange(landPointArr);

                AddSelfPoints(ref landPointList, landPointArr);
                landPointList.SortByTheta();

                var fitData = new FitData(segmentFit, polyOrder);

                fitData.CalcFitCoeffs(landPointList);
                var eccData = fitData.CorrectData(uncorrectedData);

                eccData.SortByTheta();
                eccData.MinRadius = GetMinAveRadius(eccData, 5);

                double rCorrection = uncorrectedData.MinRadius - eccData.MinRadius;

                var correctedData = CorrectRadius(eccData, rCorrection, probeDirection);
                return(correctedData);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// find min radius and reset radii to nominal
        /// </summary>
        /// <param name="singleRing"></param>
        /// <param name="_nominalRadius"></param>
        /// <returns></returns>
        static CylData CorrectRadius(CylData singleRing, double rCorrection, ProbeDirection probeDir)
        {
            try
            {
                var result = new CylData(singleRing.FileName);

                foreach (var pt in singleRing)
                {
                    PointCyl newPt;
                    double   r = 0;
                    if (probeDir == ProbeDirection.ID)
                    {
                        r = pt.R + rCorrection;
                    }
                    else
                    {
                        r = rCorrection - pt.R;
                    }
                    newPt = new PointCyl(r, pt.ThetaRad, pt.Z, pt.ID);
                    result.Add(newPt);
                }
                result.MinRadius = singleRing.MinRadius;
                return(result);
            }
            catch (Exception)
            {
                throw;
            }
        }