Esempio n. 1
0
        /// <summary>
        /// 处理一个卫星
        /// </summary>
        /// <param name="sectionMw"></param>
        /// <param name="basePrn"></param>
        /// <returns></returns>
        private void ProcessOneBaseSat(ObjectTableManager sectionMw, SatelliteNumber basePrn)
        {
            using (var wLSolver = new WideLaneOfBsdSolver(sectionMw, basePrn, MinSiteCount, MinEpoch, this.OutputDirectory))
            {
                wLSolver.MaxAllowedDiffer = MaxAllowedDiffer;
                wLSolver.Run();

                using (var nLSolver = new NarrowLaneOfBsdSolver(basePrn, FloatAmbiguitiesOfPpp, wLSolver.IntValueTables, this.OutputDirectory))
                {
                    nLSolver.MinEpoch         = MinEpoch;
                    nLSolver.MinSiteCount     = MinSiteCount;
                    nLSolver.MaxAllowedDiffer = MaxAllowedDiffer;
                    nLSolver.Run();

                    TotalObsCountOfNL += nLSolver.TotalObsCount;

                    if (this.IsOutputInt && nLSolver.IntValueTables != null)
                    {
                        nLSolver.IntValueTables.WriteAllToFileAndClearBuffer();
                    }
                    if (this.IsOutputFraction && nLSolver.FractionValueTables != null)
                    {
                        nLSolver.FractionValueTables.WriteAllToFileAndClearBuffer();
                    }
                    if (this.IsOutputSummary && nLSolver.SummeryTables != null)
                    {
                        nLSolver.SummeryTables.WriteAllToFileAndClearBuffer();
                    }
                }

                //输出
                if (this.IsOutputInt && wLSolver.IntValueTables != null)
                {
                    wLSolver.IntValueTables.WriteAllToFileAndClearBuffer();
                }
                if (this.IsOutputFraction && wLSolver.FractionValueTables != null)
                {
                    wLSolver.FractionValueTables.WriteAllToFileAndClearBuffer();
                }
                if (this.IsOutputSummary && wLSolver.SummeryTables != null)
                {
                    wLSolver.SummeryTables.WriteAllToFileAndClearBuffer();
                }

                TotalObsCountOfWL += wLSolver.TotalObsCount;
            }
        }
        protected override void Run(string[] pppResultPathes)
        {
            //读取宽巷的整数解
            int    startCountToRemove = this.namedIntControl_removeCountOfEachSegment.GetValue();
            double maxAllowedDiffer   = this.namedFloatControl1maxAllowedDiffer.GetValue();
            bool   isLoopAllSats      = checkBox_calculateAllSat.Checked;
            double maxRmsTimes        = namedFloatControl_maxRMSTImes.GetValue();
            int    minSiteCount       = this.namedIntControl1MinSiteCount.GetValue();
            double maxRms             = namedFloatControl_maxRms.GetValue();
            var    widelaneIntPathes  = fileOpenControl_intWideLaneFiles.GetFilePathes("*_IntOfWL.xls");
            MultiPeriodNarrowLaneOfBsdSolver solver = null;

            if (widelaneIntPathes.Length > 0 && widelaneIntPathes[0].ToLower().Contains("_intofwl.xls"))
            {
                solver = new MultiPeriodNarrowLaneOfBsdSolver(widelaneIntPathes, pppResultPathes, startCountToRemove, IsOutputInEachDirectory, this.OutputDirectory);
            }
            else
            {
                var pathes = fileOpenControl_intWideLaneFiles.FilePathes;

                var windeLaneIntObjs = MultiSitePeriodValueStorage.ParsePrnTables(pathes);
                foreach (var item in windeLaneIntObjs)
                {
                    item.RemoveRmsGreaterThan(maxRms);
                }
                solver = new MultiPeriodNarrowLaneOfBsdSolver(windeLaneIntObjs, pppResultPathes, startCountToRemove, IsOutputInEachDirectory, this.OutputDirectory);
            }
            solver.MaxRms           = maxRms;
            solver.MaxRmsTimes      = maxRmsTimes;
            solver.MinSiteCount     = minSiteCount;
            solver.IsLoopAllSats    = isLoopAllSats;
            solver.MaxAllowedDiffer = maxAllowedDiffer;
            solver.IsOutputFraction = IsOutputFraction;
            solver.IsOutputInt      = IsOutputInt;
            solver.IsOutputSummary  = IsOutputSummary;
            solver.Run();
        }
Esempio n. 3
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);
            }
        }