Beispiel #1
0
        /// <summary>
        /// 初始化
        /// </summary>
        public override void Init()
        {
            //缓存的数据可能被过滤或删除,因此必须大于最小历元数加上断裂数量
            this.BufferSize        = this.Option.MinEpochCount + this.Option.MaxBreakCount + 5;
            this.WindowDataManager = new WindowDataManager <SatelliteNumber, Time>(this.Option.MinEpochCount + this.Option.MaxBreakCount + 2);


            //构建数据流
            base.Init();
            this.BufferedStream.Completed     += BufferedStream_Completed;
            this.BufferedStream.MaterialEnded += BufferedStream_MaterialEnded;
            var OldHeader = ReadOriginalHeader(FilePath);

            this.Option.Interval    = Math.Max(Option.Interval, OldHeader.Interval);
            this.InputTimeInMinutes = (OldHeader.EndTime - OldHeader.StartTime) / 60.0;
            this.CurrentStartTime   = OldHeader.StartTime;
            this.OldHeader          = OldHeader;
            this.TableTextManager   = new ObjectTableManager(10000, OutputDirectory);
            this.TableTextManager.Clear();

            this.NumericalAlignerManagerPhaseA = new NumericalAlignerManager <SatelliteNumber, Time>(this.Option.Interval * 3, m => m.SecondsOfWeek);
            this.PhaseAAmenderAligner          = new NumericalAlignerManager <SatelliteNumber, Time>(this.Option.Interval * 3, m => m.SecondsOfWeek);

            PhaseACycleSlipAmender = new TimeNumeralWindowDataManager <SatelliteNumber>(this.BufferSize - 2, this.Option.Interval * 3);

            LastEpoch = this.OldHeader.EndTime;
            //医学院, 75-112,33, 900-9500,学区房,五证全
        }
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="processOption"></param>
 public BufferPolyRangeSmoothReviser(GnssProcessOption processOption)
 {
     this.ProcessOption             = processOption;
     WindowSize                     = ProcessOption.WindowSizeOfPhaseSmoothRange;
     this.Name                      = "缓存多项式伪距拟合平滑";
     TimedSmoothValueBuilderManager = new TimedSmoothValueBuilderManager(10);
     //窗口大小为原始缓存大小,再加上一定的过去数据
     LastWindowDataManager = new TimeNumeralWindowDataManager <string>(WindowSize / 2, 300);
     log.Info("启用:" + this.Name + " 对观测值进行改正!");
 }
        /// <summary>
        /// 构建窗口数据。
        /// </summary>
        /// <param name="satData"></param>
        /// <returns></returns>
        private TimeNumeralWindowDataManager <SatelliteNumber> BuildWindowData(Dictionary <SatelliteNumber, Dictionary <Time, EpochSatellite> > satData)
        {
            var WindowDataManager = new TimeNumeralWindowDataManager <SatelliteNumber>(Int16.MaxValue);

            foreach (var satDic in satData)
            {
                var window = WindowDataManager.GetOrCreate(satDic.Key);
                foreach (var sat in satDic.Value)
                {
                    var val = sat.Value[SatObsDataType].CorrectedValue;
                    window.Add(sat.Key, val);
                }
            }
            return(WindowDataManager);
        }
        /// <summary>
        /// 探测粗差或周跳
        /// </summary>
        /// <param name="WindowDataManager"></param>
        /// <param name="maxTimeSpan"></param>
        /// <returns></returns>
        private Dictionary <SatelliteNumber, List <Time> > DetectGrossError(TimeNumeralWindowDataManager <SatelliteNumber> WindowDataManager, double maxTimeSpan)
        {
            var grossDataKeys = new Dictionary <SatelliteNumber, List <Time> >();

            foreach (var kv in WindowDataManager.Data)
            {
                var prn    = kv.Key;
                var window = kv.Value;
                //if (prn == SatelliteNumber.Parse("G29"))
                //{
                //    int i=0;
                //}
                List <Time> grossTimes = window.SplitAndGetKeysOfGrossError(m => m.SecondsOfWeek, maxTimeSpan, PolyFitOrder, MaxErrorTimes, MinWindowSize, DifferTime, IsFirstWindow);

                grossDataKeys[prn] = grossTimes;
            }
            return(grossDataKeys);
        }
Beispiel #5
0
        /// <summary>
        /// 初始化
        /// </summary>
        public override void Init()
        {
            //缓存的数据可能被过滤或删除,因此必须大于最小历元数加上断裂数量
            this.BufferSize = this.Option.MinEpochCount + this.Option.MaxBreakCount + 5;

            //构建数据流
            base.Init();
            if (Option.IndicatedEphemeris.Enabled && File.Exists(Option.IndicatedEphemeris.Value))
            {
                EphemerisService = EphemerisDataSourceFactory.Create(Option.IndicatedEphemeris.Value);
            }
            if (EphemerisService == null)
            {
                EphemerisService = GlobalNavEphemerisService.Instance;
            }

            var OldHeader = ReadOriginalHeader(FilePath);

            this.Option.Interval    = Math.Max(Option.Interval, OldHeader.Interval);
            this.InputTimeInMinutes = (OldHeader.EndTime - OldHeader.StartTime) / 60.0;
            this.CurrentStartTime   = OldHeader.StartTime;
            this.OldHeader          = OldHeader;
            this.TableTextManager   = new ObjectTableManager(10000, OutputDirectory);
            this.TableTextManager.Clear();

            this.NumericalAlignerManagerPhaseA = new NumericalAlignerManager <SatelliteNumber, Time>(this.Option.Interval * 3, m => m.SecondsOfWeek);
            this.NumericalAlignerManagerPhaseB = new NumericalAlignerManager <SatelliteNumber, Time>(this.Option.Interval * 3, m => m.SecondsOfWeek);
            this.PhaseAAmenderAligner          = new NumericalAlignerManager <SatelliteNumber, Time>(this.Option.Interval * 3, m => m.SecondsOfWeek);

            PhaseACycleSlipAmender = new TimeNumeralWindowDataManager <SatelliteNumber>(this.BufferSize - 2, this.Option.Interval * 3);
            PhaseBCycleSlipAmender = new TimeNumeralWindowDataManager <SatelliteNumber>(this.BufferSize - 2, this.Option.Interval * 3);

            LastEpoch = this.OldHeader.EndTime;
            //医学院, 75-112,33, 900-9500,学区房,五证全

            SmallObsPeriodRemover = new SmallObsPeriodRemover <RinexEpochObservation>(BufferedStream, Option.MinEpochCount, Option.MaxBreakCount, LastEpoch, this.OldHeader.Interval);
        }
 /// <summary>
 /// 构造函数
 /// </summary>
 public PostResidualCheckerManager(double MaxErrorTimes = 5)
 {
     ElementResidualCheckers = new TimeNumeralWindowDataManager <string>(5, 5);
     this.MaxErrorTimes      = MaxErrorTimes;
 }
Beispiel #7
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="epochCount"></param>
 /// <param name="breakSpanSeconds"></param>
 public SmoothMwProvider(int epochCount = 120, double breakSpanSeconds = 121)
 {
     MwDataSmoothManager = new TimeNumeralWindowDataManager <SatelliteNumber>(epochCount, breakSpanSeconds);
 }
Beispiel #8
0
        private BaseDictionary <string, TimePeriod> CalculateConvergeceTimePeriods(ObjectTableStorage epochParamTable)
        {
            BaseDictionary <string, TimePeriod> dic = new BaseDictionary <string, TimePeriod>();
            string fileKey = epochParamTable.Name;
            //提取最后的结果作为比较依据
            Dictionary <string, double> finalValuesForCompare = new Dictionary <string, double>();

            foreach (var paramName in ParamNames)
            {
                finalValuesForCompare[paramName] = Geo.Utils.ObjectUtil.GetNumeral(epochParamTable.GetLastValue(paramName));
            }
            bool isAllOk   = false;
            var  indexName = epochParamTable.GetIndexColName();
            TimeNumeralWindowDataManager windowManager = new TimeNumeralWindowDataManager(SequentialEpochCount);
            int converedCount = 0; //已经收敛的数量

            foreach (var row in epochParamTable.BufferedValues)
            {
                var index = (Time)row[indexName];
                foreach (var item in row)
                {
                    var paramName = item.Key;
                    if (ParamNames.Contains(paramName))
                    {
                        if (dic.Contains(paramName))
                        {
                            continue;
                        }                                          //存在即收敛!!!

                        var window = windowManager.GetOrCreate(paramName);
                        window.IsSetTheVeryFirstKey = true;
                        var val = Geo.Utils.ObjectUtil.GetNumeral(item.Value);
                        if (!Geo.Utils.DoubleUtil.IsValid(val))
                        {
                            continue;
                        }

                        window.Add(index, val);
                        if (window.IsFull)
                        {
                            var lastVal = finalValuesForCompare[paramName];
                            var differ  = window.GetMaxDifferReferTo(lastVal);
                            if (Math.Abs(differ.Value) <= MaxDiffer) // 已经收敛
                            {
                                var convergeEpoch = window.FirstKey;
                                //differ.Key.Tag = window.TheVeryFirstKey;
                                dic[paramName] = new TimePeriod((Time)epochParamTable.FirstIndex, convergeEpoch);
                                converedCount++;
                            }
                        }
                    }
                }
                isAllOk = converedCount == ParamNames.Count;
                if (isAllOk) //所有都收敛了,不用再计算
                {
                    break;
                }
            }

            //查找收敛的参数
            if (!isAllOk)//表示遍历完成也没有收敛
            {
                var notConvered = Geo.Utils.ListUtil.GetDifferences(ParamNames, dic.Keys);
                foreach (var paramName in notConvered)
                {
                    dic[paramName] = new TimePeriod((Time)epochParamTable.FirstIndex, Time.MaxValue);
                    log.Warn(fileKey + " 的 " + paramName + " 没有收敛!");
                }
            }
            log.Info("计算完成:" + epochParamTable.Name);
            return(dic);
        }