예제 #1
0
        static public ObjectTableStorage GetRangeErrorTable(RinexObsFile ObsFile, double k1, double k2, FileEphemerisService FileEphemerisService)
        {
            var    table     = new ObjectTableStorage("Range Error of " + ObsFile.SiteInfo.SiteName);
            double interval  = ObsFile.Header.Interval;
            var    lastTimes = new BaseDictionary <SatelliteNumber, Time>();

            var prns = ObsFile.GetPrns();

            foreach (var prn in prns)
            {
                int index = 1;
                foreach (var epoch in ObsFile)
                {
                    if (epoch.Contains(prn))
                    {
                        var sat     = epoch[prn];
                        var isError = sat.IsRangeGrossError(k1, k2);
                        if (isError)
                        {
                            if (index == 1)
                            {
                                table.NewRow();
                                table.AddItem("Prn", prn.ToString());
                            }
                            table.AddItem("Error" + (index++), epoch.ReceiverTime);
                        }
                    }
                }
            }
            return(table);
        }
 /// <summary>
 /// 初始化
 /// </summary>
 protected override void Init()
 {
     base.Init();
     PolyfitBuilders = new BaseDictionary <int, PolyfitBuilder>()
     {
         CreateFunc = new Func <int, PolyfitBuilder>(keyOrder => new PolyfitBuilder(keyOrder))
     };
     //Geo.Utils.DoubleUtil.AutoSetKeyToDouble(out KeyToDouble, this.TheVeryFirstKey);//基类已设
 }
예제 #3
0
        /// <summary>
        /// 以列表形式返回。
        /// </summary>
        /// <returns></returns>
        public BaseDictionary <TKey, List <KeyValuePair <TGroup, RmsedNumeral> > > GetSatValueList()
        {
            var list = new BaseDictionary <TKey, List <KeyValuePair <TGroup, RmsedNumeral> > >();

            foreach (var item in this.GetKeyValueList())
            {
                list.Add(item.Key, item.Value.GetKeyValueList());
            }

            return(list);
        }
예제 #4
0
        /// <summary>
        /// 并行执行插值操作
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        public IDictionaryClass <string, RatedValue> GetInterpolateValuesParallel(double index)
        {
            var vals = new BaseDictionary <string, RatedValue>();
            var list = new List <NamedRatedValue>();

            Parallel.ForEach(this.Keys, new Action <string>(delegate(string key)
            {
                double y = 0, dydx = 0;
                Lagrange(Indexes, this[key], index, ref y, ref dydx);
                vals.Add(key, new NamedRatedValue(key, y, dydx));
            }));
            return(vals);
        }
        private static void RemoveRmsGreaterThan(BaseDictionary <TimePeriod, RmsedNumeral> vals, double maxRms)
        {
            List <TimePeriod> toRemoved = new List <TimePeriod>();

            foreach (var item in vals.KeyValues)
            {
                if (item.Value.Rms > maxRms)
                {
                    toRemoved.Add(item.Key);
                }
            }
            vals.Remove(toRemoved);
        }
        static public ObjectTableStorage GetLiCycleSlipTable(RinexObsFile ObsFile, double maxDiffer = 1)
        {
            var    table     = new ObjectTableStorage("Li Cycle Slips Of Sats of " + ObsFile.SiteInfo.SiteName);
            double interval  = ObsFile.Header.Interval;
            var    lastTimes = new BaseDictionary <SatelliteNumber, Time>();

            var prns = ObsFile.GetPrns();

            foreach (var prn in prns)
            {
                int    index   = 1;
                double lastVal = 0;
                foreach (var epoch in ObsFile)
                {
                    if (epoch.Contains(prn))
                    {
                        var sat = epoch[prn];

                        if (sat.PhaseA == null || sat.PhaseB == null)
                        {
                            lastVal = 0;
                            continue;
                        }

                        if (lastVal == 0)
                        {
                            lastVal = sat.GfValue;
                            continue;
                        }

                        var differ = Math.Abs(sat.GfValue - lastVal);
                        if (differ > maxDiffer)
                        {
                            if (index == 1)
                            {
                                table.NewRow();
                                table.AddItem("Prn", prn.ToString());
                            }
                            //record and reset
                            table.AddItem("Cycle" + (index++), epoch.ReceiverTime);
                        }

                        lastVal = sat.GfValue;
                    }
                }
            }

            return(table);
        }
예제 #7
0
        public static ObjectTableStorage GetSatVisiblityTable(RinexObsFile ObsFile)
        {
            var    table     = new ObjectTableStorage("Visiblity Of Sats of " + ObsFile.SiteInfo.SiteName);
            double interval  = ObsFile.Header.Interval;
            var    lastTimes = new BaseDictionary <SatelliteNumber, Time>();

            var prns = ObsFile.GetPrns();

            foreach (var prn in prns)
            {
                Time lastTime    = null;
                Time firstTime   = null;
                int  periodIndex = 1;
                table.NewRow();
                table.AddItem("Prn", prn.ToString());
                foreach (var epoch in ObsFile)
                {
                    if (epoch.Contains(prn))
                    {
                        if (firstTime == null)
                        {
                            lastTime  = epoch.ReceiverTime;
                            firstTime = epoch.ReceiverTime;
                        }

                        if (epoch.ReceiverTime - lastTime > interval + 0.001)
                        {
                            TimePeriod timePeriod = new TimePeriod(firstTime, lastTime);
                            table.AddItem("Period" + (periodIndex++), timePeriod.ToString());

                            firstTime = null;
                        }

                        lastTime = epoch.ReceiverTime;
                    }
                }
                if (firstTime != null)
                {
                    TimePeriod timePeriod = new TimePeriod(firstTime, lastTime);
                    table.AddItem("Period" + (periodIndex++), timePeriod.ToString());
                    firstTime = null;
                }
            }

            return(table);
        }
예제 #8
0
        /// <summary>
        /// 采用四舍五入法,获取本分组MW的小数部分[-0.5, 0.5],将所有分段的MW合并,加权平均。以第RMS最小的为基准,作差比较,确保在同一个小数区间
        /// </summary>
        /// <param name="maxRms"></param>
        /// <returns></returns>
        public BaseDictionary <TKey, RmsedNumeral> GetAverageRoundFraction(double maxRms = 0.5)
        {
            var dat = new BaseDictionary <TKey, RmsedNumeral>();

            foreach (var item in this.Data)
            {
                var list = item.Value.Values;

                RmsedNumeral ave = Gdp.Utils.DoubleUtil.GetAverageRoundFraction(list, maxRms, 3);

                if (ave != null)
                {
                    dat[item.Key] = ave;
                }
            }
            return(dat);
        }
        /// <summary>
        /// 获取历元信息
        /// </summary>
        /// <param name="epoch"></param>
        /// <returns></returns>
        public BaseDictionary <TKey, RmsedNumeral> GetEpochValues(Time epoch)
        {
            var result = new BaseDictionary <TKey, RmsedNumeral>();

            foreach (var kv in this.KeyValues)
            {
                foreach (var item in kv.Value.KeyValues)
                {
                    if (item.Key.Contains(epoch))
                    {
                        result[kv.Key] = item.Value;
                        break;//一个卫星获取一个数值即可
                    }
                }
            }
            return(result);
        }
 public NumeralWindowData(BaseDictionary <TKey, double> dic) : base(dic)
 {
     ValueToDouble = m => m;
 }