Ejemplo n.º 1
0
        private void CalcSpotDeviations()
        {
            instrument.CalcSpotToReferenceDeviations(sampleOptionCancelTilt);

            // get spot deviations
            float[,] deviationX = new float[WFS.MaxSpotY, WFS.MaxSpotX];
            float[,] deviationY = new float[WFS.MaxSpotY, WFS.MaxSpotX];
            instrument.GetSpotDeviations(deviationX, deviationY);

            // print out some spot deviations
            Console.WriteLine("\nSpot Deviation X in pixels (first 5x5 elements)\n");
            for (int i = 0; i < samplePrintoutSpots; ++i)
            {
                for (int j = 0; j < samplePrintoutSpots; ++j)
                {
                    Console.Write(" " + deviationX[i, j].ToString("F3"));
                }
                Console.WriteLine("");
            }
            Console.WriteLine("\nSpot Deviation Y in pixels (first 5x5 elements)\n");
            for (int i = 0; i < samplePrintoutSpots; ++i)
            {
                for (int j = 0; j < samplePrintoutSpots; ++j)
                {
                    Console.Write(" " + deviationY[i, j].ToString("F3"));
                }
                Console.WriteLine("");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// calculate and printout spot deviations to reference positions
        /// </summary>
        private void CalcSpotDeviations()
        {
            instrument.CalcSpotToReferenceDeviations(sampleOptionCancelTilt);

            // get spot deviations
            float[,] deviationX = new float[WFS.MaxSpotY, WFS.MaxSpotX];
            float[,] deviationY = new float[WFS.MaxSpotY, WFS.MaxSpotX];
            instrument.GetSpotDeviations(deviationX, deviationY);

            // Saving the spot deviations to their respective files
            using (StreamWriter devXFile = new StreamWriter(spotPath + "_X.csv"))
            {
                using (StreamWriter devYFile = new StreamWriter(spotPath + "_Y.csv"))
                {
                    string contentX;
                    string contentY;

                    for (int i = 0; i < WFS.MaxSpotX; i++)
                    {
                        contentX = "";
                        contentY = "";

                        for (int j = 0; j < WFS.MaxSpotY; j++)
                        {
                            contentX += Convert.ToString(deviationX[j, i]) + ",";
                            contentY += Convert.ToString(deviationX[j, i]) + ",";
                        }

                        devXFile.WriteLine(contentX);
                        devYFile.WriteLine(contentY);
                    }
                }
            }

            // print out some spot deviations

            /*Console.WriteLine("\nSpot Deviation X in pixels (first 5x5 elements)\n");
             * for (int i = 0; i < samplePrintoutSpots; ++i)
             * {
             *  for (int j = 0; j < samplePrintoutSpots; ++j)
             *  {
             *      Console.Write(" " + deviationX[i, j].ToString("F3"));
             *  }
             *  Console.WriteLine("");
             * }
             * Console.WriteLine("\nSpot Deviation Y in pixels (first 5x5 elements)\n");
             * for (int i = 0; i < samplePrintoutSpots; ++i)
             * {
             *  for (int j = 0; j < samplePrintoutSpots; ++j)
             *  {
             *      Console.Write(" " + deviationY[i, j].ToString("F3"));
             *  }
             *  Console.WriteLine("");
             * }*/
        }