/// <summary> /// 遍历每一个历元 /// </summary> /// <param name="epochInfo"></param> /// <returns></returns> public override bool Revise(ref EpochInformation epochInfo) { //如果没有基准卫星,则不可计算 if (!epochInfo.TotalPrns.Contains(BasePrn)) { return(false); } //1.计算所有的滤波值,并存储 foreach (var sat in epochInfo) { CaculateOneSat(sat); } //2.构建星间差分对象 var baseMwValue = this.LatestEpochSatWmValues[BasePrn]; foreach (var sat in epochInfo) //只处理本历元具有的卫星 { var val = this.LatestEpochSatWmValues[sat.Prn]; //计算差分值 CaculateDifferValue(val, baseMwValue); } //3.输出 if (IsOutputDetails) { TableStorage.NewRow(); TableStorage.AddItem("Epoch", epochInfo.ReceiverTime.ToShortTimeString()); foreach (var sat in epochInfo) //只处理本历元具有的卫星 { var val = this.LatestEpochSatWmValues[sat.Prn]; var prnKey = val.Prn.ToString(); var smoothKey = BuildSmoothKey(prnKey); //表格输出小数部分 TableStorage.AddItem(prnKey + "_Raw", val.RawValue); TableStorage.AddItem(smoothKey, val.SmoothValue); TableStorage.AddItem(prnKey + "_MwDiffer", val.DifferValue); } } return(true); }
/// <summary> /// 遍历每一个历元 /// </summary> /// <param name="epochInfo"></param> /// <returns></returns> public override bool Revise(ref EpochInformation epochInfo) { //如果没有基准卫星,则不可计算 if (!epochInfo.EnabledPrns.Contains(BasePrn)) { return(false); } //1.计算宽项滤波值,并存储 foreach (var sat in epochInfo) { SolveAndUpdateWideLane(sat); } //2.计算平滑宽项星间差分值 var baseMwValue = this.LatestEpochSatWmValues[BasePrn]; foreach (var sat in epochInfo) //只处理本历元具有的卫星 { var val = this.LatestEpochSatWmValues[sat.Prn]; //计算差分值 SovleAndUpdateDifferValue(val, baseMwValue); } //3.提取PPP计算结果,模糊度差分结果,先不做平滑 foreach (var prn in epochInfo.EnabledPrns) { var floatVal = PppResult.GetFloatAmbiguityCycle(prn); LatestEpochFloatAmbiguityValues[prn] = new EpochSatDifferValue() { Index = epochInfo.EpochIndexOfDay, Prn = prn, RawValue = floatVal, SmoothValue = floatVal, }; } //3.1 星间单差值,更新到结果 var baseFloat = this.LatestEpochFloatAmbiguityValues[BasePrn]; foreach (var prn in epochInfo.EnabledPrns) { var val = LatestEpochFloatAmbiguityValues[prn]; val.DifferValue = val.SmoothValue - baseFloat.SmoothValue; } //4.计算窄巷值 foreach (var sat in epochInfo.EnabledSats) { var prn = sat.Prn; var prnKey = prn.ToString(); var val = LatestEpochFloatAmbiguityValues[prn]; var wideLane = this.LatestEpochSatWmValues[sat.Prn]; double fcbOfWideLaneDiffer = 0; var differkey = BuildDifferKey(prn); if (DifferFcbManager != null && DifferFcbManager.Contains(differkey)) { var dcb = DifferFcbManager.Get(differkey).Last; fcbOfWideLaneDiffer = dcb.WideLaneValue; if (Math.Abs(dcb.Time - sat.ReceiverTime) > 7 * 3600 * 24) { log.Warn("提供的宽项星间单差已经超过一周!"); } } var intWideLane = wideLane.DifferValue - fcbOfWideLaneDiffer; //此处应该减去星间单差的小数部分。2016.10.20. var wideLaneInt = (int)Math.Round(intWideLane); var narrowValue = GetNarrowLaneValue(sat, val.DifferValue, wideLaneInt); //此处应该固定模糊度,不应该直接取整。 this.LatestEpochNarrowLaneValues[prn] = new EpochSatValue() { Index = epochInfo.EpochIndexOfDay, Prn = prn, RawValue = narrowValue, Tag = wideLaneInt // 存储整型宽项模糊度 }; //获取小数部分 var narrowBuffer = NarrowBufferManager.GetOrCreate(prnKey); if (narrowBuffer.IsFull) { var filter = this.NarrowLaneFilterManager.GetOrCreate(prnKey); filter.Buffers = narrowBuffer; var rms = IsSetWeightWithSat ? SatWeightProvider.GetStdDev(sat) : 1; var input = new RmsedNumeral(narrowValue, rms); var smoothAligned = filter.Filter(input); this.LatestEpochNarrowLaneValues[prn].SmoothValue = smoothAligned.Value; } narrowBuffer.Add(narrowValue); } //3.输出 if (IsOutputDetails) { TableStorage.NewRow(); TableStorage.AddItem("Epoch", epochInfo.ReceiverTime.ToShortTimeString()); foreach (var sat in epochInfo.EnabledSats) //只处理本历元具有的卫星 { var val = this.LatestEpochSatWmValues[sat.Prn]; var prnKey = val.Prn.ToString(); var wideLaneKey = BuildWideLaneKey(prnKey); //宽项 TableStorage.AddItem(wideLaneKey + "_Raw", val.RawValue); TableStorage.AddItem(wideLaneKey + "_Smooth", val.SmoothValue); TableStorage.AddItem(wideLaneKey + "_MwDiffer", val.DifferValue); //浮点解 var floatVal = this.LatestEpochFloatAmbiguityValues[sat.Prn]; var floatKey = prnKey; var differKey = BuildDifferKey(prnKey); TableStorage.AddItem(floatKey + "_FloatAmbi_Raw", floatVal.RawValue); //TableStorage.AddItem(floatKey + "_Smooth", floatVal.SmoothValue); TableStorage.AddItem(differKey, floatVal.DifferValue); //窄巷 var narrowVal = this.LatestEpochNarrowLaneValues[sat.Prn]; var narrowLaneKey = BuildNarrowLaneKey(prnKey); TableStorage.AddItem(narrowLaneKey + "_Raw", narrowVal.RawValue); TableStorage.AddItem(narrowLaneKey + "_WideLaneInt", narrowVal.Tag); TableStorage.AddItem(narrowLaneKey + "_Smooth", narrowVal.SmoothValue); //TableStorage.AddItem(narrowLaneKey + "_MwDiffer", narrowVal.DifferValue); } } return(true); }