Пример #1
0
        /// <summary>
        /// 读取历元对象
        /// </summary>
        /// <param name="line"></param>
        /// <param name="StreamReader"></param>
        /// <returns></returns>
        private IonoHarmonicSection ReadSection(string line, StreamReader StreamReader)
        {
            IonoHarmonicSection ionoHarmonicSection = new IonoHarmonicSection();

            ionoHarmonicSection.Header = ReadHeader(StreamReader);
            while (!IsStartOfRecord(line))
            {
                line = StreamReader.ReadLine();
            }
            //读取数据内容
            while ((line = StreamReader.ReadLine()) != null)
            {
                if (String.IsNullOrWhiteSpace(line))
                {
                    continue;
                }
                if (line.Contains(IonoHarmonicHeaderLabel.StartLine))
                {
                    break;
                }

                var    items  = Geo.Utils.StringUtil.SplitByBlank(line);
                int    degree = Geo.Utils.StringUtil.ParseInt(items[0]);
                int    order  = Geo.Utils.StringUtil.ParseInt(items[1]);
                double val    = Geo.Utils.StringUtil.ParseDouble(items[2]);
                double rms    = Geo.Utils.StringUtil.ParseDouble(items[3]);

                ionoHarmonicSection.GetOrCreate(degree).Set(order, new RmsedNumeral(val, rms));
            }
            return(ionoHarmonicSection);
        }
Пример #2
0
        /// <summary>
        /// 垂直方向的电子数量
        /// </summary>
        /// <param name="time"></param>
        /// <param name="geocentricLonlatDeg"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        private static RmsedNumeral GetValue(Time time, LonLat geocentricLonlatDeg, IonoHarmonicSection data)
        {
            SphericalHarmonicsCalculater calculater = new SphericalHarmonicsCalculater(data);
            var    radius   = Geo.Referencing.Ellipsoid.MeanRaduis;           // HeightOnSphere + AveRadiusOfEarch;
            LonLat lonLatSE = geocentricLonlatDeg.GetSeLonLat(time.DateTime); //转换为日固坐标系

            var val = calculater.GetValue(data.MaxDegree, lonLatSE, radius);

            return(new RmsedNumeral(val, 0));
        }