コード例 #1
0
ファイル: StokesParsProvider.cs プロジェクト: arneb89/Mapper
        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);
        }
コード例 #2
0
        public double InterpCircularPart(double x, double y, double z)
        {
            double[] fForGrigZ = new double[this.zC.Length];

            for (int iZ = 0; iZ < fForGrigZ.Length; iZ++)
            {
                double[] fForGridY = new double[this.yC.Length];
                for (int iY = 0; iY < fForGridY.Length; iY++)
                {
                    MathLib.Spline31D splineX = new MathLib.Spline31D(this.xC, this.fC[iZ][iY]);
                    fForGridY[iY] = splineX.Interp(x);
                }
                MathLib.Spline31D splineY = new MathLib.Spline31D(this.yC, fForGridY, 0, 0);
                fForGrigZ[iZ] = splineY.Interp(y);
            }

            MathLib.PolynomInterpolator pi = new MathLib.PolynomInterpolator(this.zC, fForGrigZ);

            double val = pi.Interp(z) / 100;

            return(val);
        }
コード例 #3
0
        public double InterpTotal(double x, double y, double z)
        {
            double[] fForGrigZ = new double[this.zT.Length];

            for (int iZ = 0; iZ < fForGrigZ.Length; iZ++)
            {
                double[] fForGridY = new double[this.yT.Length];
                for (int iY = 0; iY < fForGridY.Length; iY++)
                {
                    MathLib.Spline31D splineX = new MathLib.Spline31D(this.xT, this.fT[iZ][iY]);
                    fForGridY[iY] = splineX.Interp(x);
                }
                MathLib.Spline31D splineY = new MathLib.Spline31D(this.yT, fForGridY, 0, 0);
                fForGrigZ[iZ] = splineY.Interp(y);
            }

            MathLib.PolynomInterpolator pi = new MathLib.PolynomInterpolator(this.zT, fForGrigZ);

            double val = pi.Interp(z);

            return(val);
        }
コード例 #4
0
        public double InterpLinearPart(double x, double y, double z)
        {
            double[] fForGrigZ = new double[this.zL.Length];

            for (int iZ = 0; iZ < fForGrigZ.Length; iZ++)
            {
                double[] fForGridY = new double[this.yL.Length];
                for (int iY = 0; iY < fForGridY.Length; iY++)
                {
                    MathLib.Spline31D splineX = new MathLib.Spline31D(this.xL, this.fL[iZ][iY]);
                    fForGridY[iY] = Math.Log10(splineX.Interp(x) + 100);
                }

                MathLib.Spline31D splineY = new MathLib.Spline31D(this.yL, fForGridY);//, 0, 0);
                fForGrigZ[iZ] = splineY.Interp(y);
            }

            MathLib.PolynomInterpolator pi = new MathLib.PolynomInterpolator(this.zL, fForGrigZ);

            double val = (Math.Pow(10, pi.Interp(z)) - 100) / 100;

            return(val);
        }