示例#1
0
        /// <summary>
        /// 写入文件
        /// </summary>
        public void WriteToFiles()
        {
            log.Info("写入结果到文件!");
            //写最后的结果
            var table = BuildLatestResultTable();

            TableManager.ReductValuesTo();
            if (table.RowCount > 1)
            {
                table.GetAveragesWithStdDevAndAppendToTable();
                this.TableManager.AddTable(this.BasePrn + "_LastWideLaneSatDiffer", table);
            }
            TableManager.WriteAllToFileAndCloseStream();

            foreach (var item in MwWideLaneSolvers)
            {
                item.WriteToFile();
            }
            if (CurrentMaterial != null)
            {
                AddCurrentProductToFcbManager(this.CurrentMaterial.ReceiverTime);
            }
            var path = Path.Combine(OutputDirectory, "DcbProducts.sdfcb.xls");

            DifferFcbManager.WriteToFile(path);
        }
示例#2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="inputPathes"></param>
 /// <param name="BasePrn"></param>
 /// <param name="OutputDirectory"></param>
 public MultiSiteNarrowLineSolver(SatelliteNumber BasePrn, string OutputDirectory, string wideLanePath, int skipCount)
     : base(BasePrn, OutputDirectory)
 {
     this.RunnerFileExtension = "*.*o";
     this.PppResultBufferSize = 10;
     this.PppResultBuffer     = new WindowData <Dictionary <string, PppResult> >(PppResultBufferSize);
     this.DifferFcbManager    = DifferFcbManager.Read(wideLanePath);
     this.SkipCount           = skipCount;
 }
示例#3
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="BasePrn"></param>
 /// <param name="SetWeightWithSat"></param>
 /// <param name="maxError"></param>
 /// <param name="IsOutputDetails"></param>
 public MultiSiteNarrowLaneSolver(SatelliteNumber BasePrn, DifferFcbManager DifferFcbManager, string directory, int skipCount, bool SetWeightWithSat = false, double maxError = 2, bool IsOutputDetails = true)
 {
     this.BasePrn            = BasePrn;
     this.MaxError           = maxError;
     this.IsOutputDetails    = IsOutputDetails;
     this.IsSetWeightWithSat = SetWeightWithSat;
     this.DifferFcbManager   = DifferFcbManager;
     this.TableManager       = new ObjectTableManager(directory);
     this.SkipCount          = skipCount;
 }
示例#4
0
        /// <summary>
        /// 生成产品,此处直接取平均值。??应该剔除粗差!2016.10.19, czs
        /// </summary>
        /// <param name="ReceiverTime"></param>
        private void AddCurrentProductToFcbManager(Time ReceiverTime)
        {
            var tableValues = BuildLatestResultTable();
            var aveDic      = tableValues.GetAverages();

            //输出实时结果文件,多个测站的平滑值
            foreach (var val in aveDic)
            {
                var key = BuildDifferKey(val.Key);

                DifferFcbManager.Add(new DifferFcbOfSatDcbItem(key, ReceiverTime, val.Value));
            }
        }
示例#5
0
        /// <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);
        }