示例#1
0
        /// <summary>
        /// 运行。
        /// </summary>
        public void Run()
        {
            var TotalObsCount = 0;

            if (BsdWidelaneInts != null)//对象差分整数
            {
                log.Info("采用新方法");
                if (MultiSitePppEpochValue != null)
                {
                    Dictionary <SatelliteNumber, MultiSatEpochRmsNumeralStorage> products = new Dictionary <SatelliteNumber, MultiSatEpochRmsNumeralStorage>();
                    foreach (var basePrn in BsdWidelaneInts.Keys)
                    {
                        log.Info("正在计算基准星为 " + basePrn + " 的窄巷模糊度");
                        var intWideLaneObj = BsdWidelaneInts[basePrn];

                        var solver = new EpochBsdOfNarrowLaneSolver(basePrn, MultiSitePppEpochValue, intWideLaneObj, this.OutputDirectory);
                        solver.MaxAllowedDiffer = MaxAllowedDiffer;
                        solver.MinSiteCount     = MinSiteCount;
                        solver.MaxRmsTimes      = MaxRmsTimes;
                        solver.Run();

                        if (IsOutputFraction && solver.FractionValueTables != null)
                        {
                            solver.FractionValueTables.WriteAllToFileAndClearBuffer();
                        }
                        if (IsOutputSummary && solver.SummeryTables != null)
                        {
                            solver.SummeryTables.WriteAllToFileAndClearBuffer();
                        }
                        //if (IsOutputInt && solver.IntValueTables != null) { solver.IntValueTables.WriteAllToFileAndClearBuffer(); }
                        //需要计算所有历元的数值!!!!宽巷也可以,用于查看结果。

                        if (!IsLoopAllSats)
                        {
                            break;
                        }
                        products[basePrn] = solver.FcbProducts;
                    }

                    if (IsLoopAllSats)//汇集产品到一起
                    {
                        //归算到基准星
                        var samePrnProducts = new MultiSiteEpochValueStorage("归算到同一颗卫星");
                        var basePrn         = BsdWidelaneInts.Keys.First();
                        foreach (var kv in products)
                        {
                            var name = kv.Key.ToString();
                            if (kv.Key == basePrn)
                            {
                                samePrnProducts[kv.Key.ToString()] = kv.Value;
                            }
                            else
                            {
                                samePrnProducts[name] = kv.Value.GetRawDiffer(basePrn);
                            }
                        }

                        //汇集各卫星产品到一起
                        var together = samePrnProducts.GetSameSatValues();
                        //计算不准确,算法有待改进!!

                        //求加权平均,每一个历元,每颗卫星只有一个产品,忽略数量太少的历元
                        var FcbProducts = together.GetAverage(1, 3);

                        //生成窄巷FCB 产品,并写入文件
                        var FcbOfUpds = FcbProducts.GetFcbProduct(basePrn);

                        //写入文件  //写入文件
                        FcbOfUpdWriter.WriteEpochProducts(FcbOfUpds, basePrn + "_FinalEpochNLFcbOfDcb");
                    }
                }
                else // 次新方法
                {
                    foreach (var basePrn in BsdWidelaneInts.Keys)
                    {
                        var intWideLaneObj = BsdWidelaneInts[basePrn];
                        var solver         = new BsdOfNarrowLaneSolver(basePrn, FloatAmbiguitiesOfPpp, intWideLaneObj, this.OutputDirectory);
                        solver.MaxAllowedDiffer = MaxAllowedDiffer;
                        solver.Run();

                        if (IsOutputFraction)
                        {
                            solver.FractionValueTables.WriteAllToFileAndClearBuffer();
                        }
                        if (IsOutputSummary)
                        {
                            solver.SummeryTables.WriteAllToFileAndClearBuffer();
                        }
                        if (IsOutputInt)
                        {
                            solver.IntValueTables.WriteAllToFileAndClearBuffer();
                        }
                        //需要计算所有历元的数值!!!!宽巷也可以,用于查看结果。
                    }
                }
            }
            else
            {
                log.Info("采用老表格方法");

                foreach (var kv in IntOfWLPathes)
                {
                    ObjectTableManager intWideLane = ObjectTableManager.Read(kv.Value.ToArray());// ReadWideLaneTable(PppResultTableManager);
                    var    basePrn         = kv.Key;
                    string outputDirectory = this.OutputDirectory;
                    if (IsOutputInEachDirectory)
                    {
                        var start = intWideLane.GetFirstIndexValue <Time>();
                        var end   = intWideLane.GetLastIndexValue <Time>();
                        var span  = new TimePeriod(start, end);

                        outputDirectory                       = System.IO.Path.Combine(this.OutputDirectory, span.ToPathString(false, true, false) + "_" + basePrn);
                        intWideLane.OutputDirectory           = outputDirectory;
                        FloatAmbiguitiesOfPpp.OutputDirectory = outputDirectory;
                    }
                    BsdProductSolver solver;


                    //PPP模糊度浮点解
                    solver = new NarrowLaneOfBsdSolver(basePrn, FloatAmbiguitiesOfPpp, intWideLane, outputDirectory);
                    solver.MaxAllowedDiffer = MaxAllowedDiffer;
                    solver.Run();
                    if (IsOutputFraction)
                    {
                        solver.FractionValueTables.WriteAllToFileAndClearBuffer();
                    }
                    if (IsOutputSummary)
                    {
                        solver.SummeryTables.WriteAllToFileAndClearBuffer();
                    }
                    if (IsOutputInt)
                    {
                        solver.IntValueTables.WriteAllToFileAndClearBuffer();
                    }

                    TotalObsCount += solver.TotalObsCount;
                }

                log.Info(" 总共处理的观测数值数 " + TotalObsCount);
            }
        }