/// <summary> /// 提取一个测站所有时段卫星的MW平均值,作为具有卫星和接收机硬件延迟的宽巷模糊度。 /// 此处假定时段内卫星和接收机硬件延迟变化可以忽略不计。 /// </summary> /// <returns></returns> public MultiSatPeriodRmsNumeralStorage Build() { Init(); foreach (var epoch in BuffferStream) { //简单的质量控制 if (epoch == null) { continue; } Run(epoch); }//end of stream //最后,将最后的窗口数据进行检查输出 foreach (var item in WindowDataManager.Data) { var prn = item.Key; var windowData = WindowDataManager.GetOrCreate(prn); CheckBuildPeriodResultAndClear(windowData, prn); } this.OnCompleted(); return(Result); }
/// <summary> /// 过滤掉小历元时段,在缓存中操作,确保缓存大于断裂数量 /// </summary> /// <param name="info"></param> private void CheckAndFiltSmallSpan(EpochInformation info) { //添加 foreach (var sat in info) { WindowDataManager.GetOrCreate(sat.Prn).Add(info.ReceiverTime); } ////保证有足够的数量 //if (!WindowDataManager.HasFull) { return; } JudgeAndFiltSmallSpanInBuffer(info.ReceiverTime, info.ReceiverTime == LastEpoch); }
/// <summary> /// 处理一个 /// </summary> /// <param name="epoch"></param> public void Process(EpochInformation epoch) { Time time = epoch.ReceiverTime; //计算 foreach (var sat in epoch) { if (!IsValid(sat) || !SatelliteTypes.Contains(sat.Prn.SatelliteType) || sat.Ephemeris == null) { continue; } var prn = sat.Prn; double mwValue = sat.Combinations.MwPhaseCombinationValue; var weight = 1.0; if (sat.Polar.Elevation < 30) { weight = 2 * Math.Sin(sat.GeoElevation * Geo.Coordinates.AngularConvert.DegToRadMultiplier); } var windowData = WindowDataManager.GetOrCreate(prn); //弧段断裂,求值 if (sat.IsUnstable || windowData.IsKeyBreaked(time)) { CheckBuildPeriodResultAndClear(windowData, prn); } windowData.Add(time, new WeightedNumeral(mwValue, weight)); } //每一历元结束,都做一次判断,确保数据完全输出 foreach (var item in WindowDataManager.Data) { var prn = item.Key; var windowData = WindowDataManager.GetOrCreate(prn); //弧段断裂,求值 if (windowData.IsKeyBreaked(time)) { CheckBuildPeriodResultAndClear(windowData, prn); } } }
/// <summary> /// 过滤掉小历元时段,在缓存中操作,确保缓存大于断裂数量 /// </summary> /// <param name="info"></param> private void CheckAndFiltSmallSpan(RinexEpochObservation info) { //是否启用 if (!this.Option.IsEnableMinEpochCount) { return; } //添加 foreach (var sat in info) { WindowDataManager.GetOrCreate(sat.Prn).Add(info.ReceiverTime); } ////保证有足够的数量 //if (!WindowDataManager.HasFull) { return; } JudgeAndFiltSmallSpanInBuffer(info.ReceiverTime, info.ReceiverTime == LastEpoch); }
/// <summary> /// 判断过滤 /// </summary> /// <param name="currentTime"></param> /// <param name="isLastEpoch"></param> private void JudgeAndFiltSmallSpanInBuffer(Time currentTime, bool isLastEpoch) { if (this.Inverval == 0 || this.Inverval == Double.MaxValue) { this.Inverval = GetInteval(this.Buffers); } //执行判断,并移除历元卫星 foreach (var prn in WindowDataManager.Keys) { var window = WindowDataManager.Get(prn); if (window.Count == 0) { continue; } if (isLastEpoch) { int ii = 0; } //当前与上一个在指定历元内,且非最后,即后续还有数据需要添加后再判断,这样可以节约大量时间 var lastSan = Math.Abs(currentTime - window.Last); if (lastSan < MinBreakTimeSpan && !isLastEpoch) { continue; } //按照允许的最大间隔分离 var gapedWindows = window.Split((prev, current) => { return(Math.Abs(current - prev) > MinBreakTimeSpan); }); int subCount = 0; foreach (var subWindow in gapedWindows) { subCount++; if (subWindow.Count == 0) { continue; } //包括当前,且非最后,即后续还有数据需要添加后再判断 if (subWindow.Contains(currentTime) && !isLastEpoch) { continue; } //没有包括当前,但是窗口最后一个历元与当前不超过指定的阈值,且非最后历元,则直接继续,需要添加后判断 lastSan = Math.Abs(currentTime - subWindow.Last); if (!subWindow.Contains(currentTime) && lastSan < MinBreakTimeSpan && !isLastEpoch) { continue; } //-----------以下数据进行判断长度并删除过短的数据----------- //小于指定的数量 if (subWindow.Count < MinEpochCount && this.Buffers != null) { log.Debug(prn + " 第 " + subCount + "/" + gapedWindows.Count + " 段 " + ",在缓存中移除时段 " + subWindow.ToString() + ", 当前: " + currentTime + ", 与最后差(s):" + lastSan + ", 是否最后历元:" + isLastEpoch); int i = 0; foreach (var epoch in this.Buffers) { if (epoch.Contains(prn) && window.Contains(epoch.ReceiverTime)) { epoch.Remove(prn); i++; } } //处理最后一个历元 if (isLastEpoch) { var epo = Current; if (epo.Contains(prn) && window.Contains(epo.ReceiverTime)) { epo.Remove(prn); i++; } } if (i > 0) { log.Debug(prn + " 移除了 " + i + " 个"); } } //除了当前历元(已跳过continue),判断一次后清空过期的数据窗口,第二段重新积累,历史车轮滚滚向前 window.Remove(subWindow); } } }