Exemplo n.º 1
0
        public double StokesV(double magStr, double theta, double lambda)
        {
            double[] xSet = new double[this.stokesV.ZMas.Length];
            double[] ySet = new double[xSet.Length];

            for (int i = 0; i < xSet.Length; i++)
            {
                ySet[i] = this.liV[i].Interp(theta, magStr);
                //ySet[i] = this.splineV[i].Interp(theta, magStr);
                xSet[i] = Math.Log10(this.stokesV.ZMas[i]);
                //ySet[i] = this.liV[i].Interp(theta, magStr);
            }



            LinInterpolator li = new LinInterpolator(xSet, ySet);

            double stI = StokesI(magStr, theta, lambda);

            double part = li.Interp(Math.Log10(lambda));

            double res = part * stI;

            return(res);
        }
Exemplo n.º 2
0
        public double StokesI(double magStr, double theta, double lambda)
        {
            double[] xSet = new double[this.stokesI.ZMas.Length];
            double[] ySet = new double[xSet.Length];

            for (int i = 0; i < xSet.Length; i++)
            {
                xSet[i] = Math.Log10(this.stokesI.ZMas[i]);
                if (this.interpFlag == "spline")
                {
                    ySet[i] = this.splineI[i].Interp(theta, magStr);
                }

                if (this.interpFlag == "linear")
                {
                    ySet[i] = this.liI[i].Interp(theta, magStr);
                }
            }
            double res = 0;

            if (this.interpFlag == "spline")
            {
                MathLib.Spline31D sp = new MathLib.Spline31D(xSet, ySet);
                res = Math.Pow(10, sp.Interp(Math.Log10(lambda)));
            }

            if (this.interpFlag == "linear")
            {
                LinInterpolator li = new LinInterpolator(xSet, ySet);
                res = Math.Pow(10, li.Interp(Math.Log10(lambda)));
            }
            return(res);
        }