Beispiel #1
0
        public void CalculateModelTest()
        {
            var           lines = FileHelper.ReadThenSplitLine(".\\data\\ionex\\codg0150.16I.txt", ',');
            List <double> b     = new List <double>(10000);
            List <double> l     = new List <double>(10000);
            List <double> tec   = new List <double>(10000);

            for (int i = 0; i < 71; i++)
            {
                for (int j = 0; j < 72; j++)
                {
                    double bb  = (87.5 - 2.5 * i) * Angle.D2R;
                    double ll  = (-180d + j * 5) * Angle.D2R;
                    double ion = double.Parse(lines[i][j]);
                    b.Add(bb);
                    l.Add(ll);
                    tec.Add(ion);
                }
            }

            SphericalHarmonicIonoModel sm = SphericalHarmonicIonoModel.CalculateModel(15, 15, b, l, tec);
            var res = sm.Calculate(87.5 * Angle.D2R, -180d * Angle.D2R);

            Console.WriteLine(res - 23);
        }
Beispiel #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            double latMin = double.Parse(tbxLatMin.Text);
            double latMax = double.Parse(tbxLatMax.Text);
            double lonMin = double.Parse(tbxLonMin.Text);
            double lonMax = double.Parse(tbxLonMax.Text);
            double res    = double.Parse(tbxResolution.Text);

            int rowNum = (int)((latMax - latMin + 0.5) / res);
            int colNum = (int)((lonMax - lonMin + 0.5) / res);

            ESRIASC ascf = new ESRIASC(rowNum, colNum);

            ascf.XLLCenter = lonMin;
            ascf.YLLCenter = latMin;
            ascf.CellSize  = double.Parse(tbxResolution.Text);

            SphericalHarmonicIonoModel spm = SphericalHarmonicIonoModel.Load(tbxOpen.Text);

            int    hour = 12;
            int    minute = 0;
            int    second = 0;
            double sgb, sgl;
            double b, l;

            for (int i = 0; i < rowNum; i++)
            {
                for (int j = 0; j < colNum; j++)
                {
                    b = latMin - res / 2d + i * res;
                    l = lonMin - res / 2d + j * res;

                    b *= Angle.D2R;
                    l *= Angle.D2R;

                    Coordinate.SunGeomagnetic(b, l, hour, minute, second,
                                              GeoFun.GNSS.Common.GEOMAGNETIC_POLE_LAT, GeoFun.GNSS.Common.GEOMAGENTIC_POLE_LON,
                                              out sgb, out sgl);

                    ascf.Data[i, j] = spm.Calculate(sgb, sgl);
                }
            }

            ascf.WriteAs(tbxSave.Text);
        }
 public void LoadTest()
 {
     SphericalHarmonicIonoModel.Load(AppDomain.CurrentDomain.BaseDirectory + "\\Data\\spm\\2016190_0000.spm.txt");
 }