Exemplo n.º 1
0
        static void Mesure()
        {
            Device PolarizationAnalyzer = new Device(0, 9, 0);
            Device Source = new Device(0, 24, 0);

            double start    = 1550;
            double end      = 1560;
            double stepSize = 1;

            int steps = (int)((end - start) / stepSize) + 3;

            double[] wavelenght = new double[steps];

            //find wavelenghts need to mesure
            for (int i = 0; i < steps; i++)
            {
                wavelenght[i] = (start - stepSize) + (i * stepSize);
            }

            //for save PAT9300 JM information
            JonesMatCar[] jMat = new JonesMatCar[steps];

            double[] DGDval = new double[2];
            double[,] DGDs = new double[steps - 2, 2];

            int delay = 5000;

            InitMesure(Source, PolarizationAnalyzer);

            for (int i = 0; i < steps; i++)
            {
                if (i < 2)
                {
                    jMat[i] = MesurTanPiDelta2JonesMat(Source, PolarizationAnalyzer, wavelenght[i], delay);
                }
                else
                {
                    jMat[i] = MesurTanPiDelta2JonesMat(Source, PolarizationAnalyzer, wavelenght[i], delay);

                    DGDval         = Utility.DGD(jMat[i - 2], jMat[i], wavelenght[i - 2], wavelenght[i]);
                    DGDs[i - 2, 0] = DGDval[0];
                    DGDs[i - 2, 1] = DGDval[1];

                    Console.WriteLine(DGDval[0]);
                    Console.WriteLine(DGDval[1]);
                    Console.WriteLine();
                }
            }

            Done(Source); // turn off the laser


            PolarizationAnalyzer.Dispose();
            Source.Dispose();
        }
Exemplo n.º 2
0
        public static JonesMatPol Car2Pol(JonesMatCar jonesMatCar)
        {
            JonesMatPol jonesMatPol;

            jonesMatPol.J11 = Car2Pol(jonesMatCar.J11);
            jonesMatPol.J12 = Car2Pol(jonesMatCar.J12);
            jonesMatPol.J21 = Car2Pol(jonesMatCar.J21);
            jonesMatPol.J22 = Car2Pol(jonesMatCar.J22);

            return(jonesMatPol);
        }
Exemplo n.º 3
0
 public static void Print(JonesMatCar mat)
 {
     Print(mat.J11);
     Console.Write("  ");
     Print(mat.J12);
     Console.WriteLine();
     Print(mat.J21);
     Console.Write("  ");
     Print(mat.J22);
     Console.WriteLine();
 }
Exemplo n.º 4
0
        public static ComplexCar[] Eigenvalues(JonesMatCar jonesMatCar)
        {
            ComplexCar[] complexCar = new ComplexCar[2];

            ComplexCar a = (jonesMatCar.J11 + jonesMatCar.J22);
            ComplexCar b = Sqrt((a * a) + (4 * ((jonesMatCar.J12 * jonesMatCar.J21) - (jonesMatCar.J11 * jonesMatCar.J22))));

            complexCar[0] = (a + b) / 2;
            complexCar[1] = (a - b) / 2;

            return(complexCar);
        }
Exemplo n.º 5
0
        public static JonesMatCar Inverse(JonesMatCar jonesMatCar)
        {
            JonesMatCar JInv;
            ComplexCar  JDet = Det(jonesMatCar);

            JInv.J11 = jonesMatCar.J22 / JDet;
            JInv.J12 = (-1 * jonesMatCar.J12) / JDet;
            JInv.J21 = (-1 * jonesMatCar.J21) / JDet;
            JInv.J22 = jonesMatCar.J11 / JDet;

            return(JInv);
        }
Exemplo n.º 6
0
        public static JonesMatCar K2JonesMat(ComplexCar k0, ComplexCar k90, ComplexCar k45)
        {
            JonesMatCar jonesMatCar = new JonesMatCar();

            ComplexCar k4 = (k90 - k45) / (k45 - k0);

            jonesMatCar.J11 = k0 * k4;
            jonesMatCar.J12 = k90;
            jonesMatCar.J21 = k4;
            jonesMatCar.J22 = new ComplexCar(1, 0);

            return(jonesMatCar);
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            //Mesure();

            double[] values1 = Utility.SC2EybyExDelta(Utility.text_SC1);
            double[] values2 = Utility.SC2EybyExDelta(Utility.text_SC2);
            double[] values3 = Utility.SC2EybyExDelta(Utility.text_SC3);

            ComplexCar k1 = Utility.TanPiDelta2K(values1[1], values1[2]);
            ComplexCar k2 = Utility.TanPiDelta2K(values2[1], values2[2]);
            ComplexCar k3 = Utility.TanPiDelta2K(values3[1], values3[2]);

            JonesMatCar mat = Utility.K2JonesMat(k1, k2, k3);

            CMath.Print(mat);

            Console.Read();
        }
Exemplo n.º 8
0
        public static double[] DGD(JonesMatCar J1, JonesMatCar J2, double w1, double w2)
        {
            JonesMatCar J1Inv = CMath.Inverse(J1);

            JonesMatCar J2_J1Inv = J2 * J1Inv;

            ComplexCar[] complexCars = CMath.Eigenvalues(J2_J1Inv);

            ComplexPol[] complexPols = new ComplexPol[2];

            complexPols[0] = CMath.Car2Pol(complexCars[0]);
            complexPols[1] = CMath.Car2Pol(complexCars[1]);

            double Ang = complexPols[0].ang - complexPols[1].ang;

            double f1 = Wavelength2Frequency(w1);
            double f2 = Wavelength2Frequency(w2);

            double[] DGD_WL = { CMath.Abs(Ang / (f1 - f2)), (w1 + w2) / 2 };

            return(DGD_WL);
        }
Exemplo n.º 9
0
 public static ComplexCar Det(JonesMatCar jonesMatCar)
 {
     return((jonesMatCar.J11 * jonesMatCar.J22) - (jonesMatCar.J12 * jonesMatCar.J21));
 }