Esempio n. 1
0
        /// <summary>
        /// 初始化计算器
        /// </summary>
        private void InitSolver()
        {
            this.Solver = new SingleSiteGnssSolveStreamer(OutpuDirectory);
            var Option = GnssProcessOptionManager.Instance.Get(GnssSolverType.无电离层组合PPP);

            Option.OutputDirectory = OutpuDirectory;
            // Option.EnableAutoFindingFile = false;
            Setting.EnableNet = false;
            var epheService = EphemerisService;

            if (epheService == null)
            {
                epheService = new SingleParamNavFileEphService(NavFile);
            }

            var obsData = new MemoRinexFileObsDataSource(ObsFile);

            this.Solver.Context        = DataSourceContext.LoadDefault(Option, obsData, epheService, null);
            this.Solver.BufferedStream = BuildBufferedStream();
            this.Solver.Option         = Option;
            this.Solver.DataSource     = obsData;
            //Solver.InfoProduced += Solver_InfoProduced;
            //Solver.ResultProduced += Solver_ResultProduced;
            //Solver.EpochEntityProduced += Solver_EpochEntityProduced;
            //Solver.Completed += OneSolver_Completed;
            this.Solver.Init();
        }
Esempio n. 2
0
        /// <summary>
        /// 数据分析
        /// </summary>
        public void Analysis()
        {
            if (RefObsDataSource == null || RovObsDataSource == null)
            {
                MessageBox.Show("请先读取数据。");
                return;
            }
            FormUtil.ShowWaittingForm("正在对数据进行分析。。。");

            GnssProcessOption option = GetModel(RovObsDataSource.ObsInfo.StartTime);

            LoadDataSource();

            DataSourceContext DataSourceContext = DataSourceContext.LoadDefault(option, this.textBox_obsPath_ref.Text, ephemerisDataSource, clockFile);

            ObsDataAnalyst = new BaseLineObsDataAnalyst(DataSourceContext, RefObsDataSource, RovObsDataSource, option);

            ObsDataAnalyst.SatCycleSlipMaker.SaveSatPeriodText(ProjectOutputDirectory + "\\SatCycleSlipMaker_" + DateTime.Now.Ticks + ".txt");
            ObsDataAnalyst.SatVisibleMaker.SaveSatPeriodText(ProjectOutputDirectory + "\\SatVisibleMaker_" + DateTime.Now.Ticks + ".txt");

            File.WriteAllText(ProjectOutputDirectory + "\\BaseSat_" + DateTime.Now.Ticks + ".txt", ObsDataAnalyst.SatelliteSelector.GetFormatedString());

            var title = ("\r\n----------已经选择的基准卫星-----------\r\n");

            ShowInfo(title + ObsDataAnalyst.SatelliteSelector.GetFormatedString());
            title = ("\r\n----------卫星的可见性-----------\r\n");
            ShowInfo(title + ObsDataAnalyst.SatVisibleMaker.ToFormatedString());
            title = ("\r\n----------卫星周跳-----------\r\n");
            ShowInfo(title + ObsDataAnalyst.SatCycleSlipMaker.ToFormatedString());
        }
Esempio n. 3
0
        private void button_viewObs_Click(object sender, EventArgs e)
        {
            if (ObsFile == null)
            {
                MessageBox.Show("请先读取数据!"); return;
            }
            var window = this.namedIntControl_smoothWindow.GetValue();

            SmoothedRangeBuilderManager = new CarrierSmoothedRangeBuilderManager(true, window, true, IonoDifferCorrectionType.DualFreqCarrier);

            ObjectTableStorage table = new ObjectTableStorage();
            var EpochInfoBuilder     = new RinexEpochInfoBuilder(ObsFile.Header);
            var _obsDataSource       = new RinexFileObsDataSource(ObsPath);
            var option         = new GnssProcessOption();
            var context        = DataSourceContext.LoadDefault(option, _obsDataSource);
            var bufferedStream = new BufferedStreamService <EpochInformation>(_obsDataSource, option.BufferSize);
            SatTimeInfoManager SatTimeInfoManager = new Gnsser.SatTimeInfoManager(_obsDataSource.ObsInfo.Interval);
            var Reviser = EpochInfoReviseManager.GetDefaultEpochInfoReviser(context, option, SatTimeInfoManager);
            var checker = EpochCheckingManager.GetDefaultCheckers(context, option);
            int i       = -1;

            foreach (var item in bufferedStream)
            {
                i++;

                //原始数据检核
                var epochInfo = item;
                if (!checker.Check(item))
                {
                    continue;
                }
                //数据矫正
                bool result = Reviser.Revise(ref epochInfo);
                if (!result)
                {
                    continue;
                }

                table.NewRow();
                table.AddItem("Epoch", epochInfo.ReceiverTime.ToShortTimeString());
                //计算伪距平滑值
                foreach (var sat in epochInfo)
                {
                    //观测值,或组合值
                    var rangeVal = sat.FrequenceA.PseudoRange.CorrectedValue;      // sat[type].CorrectedValue;

                    var phaseVal       = sat.FrequenceA.PhaseRange.CorrectedValue; // sat[option.PhaseTypeToSmoothRange].CorrectedValue;
                    var manager        = SmoothedRangeBuilderManager.GetOrCreate(sat.Prn);
                    var smoothRangeVal = manager.SetRawValue(sat.ReceiverTime, rangeVal, phaseVal, sat.IonoLenOfL1ByDifferL1L2).SetReset(sat.IsUnstable).Build();

                    table.AddItem(sat.Prn + "_Raw", rangeVal + "");
                    table.AddItem(sat.Prn + "_Smooth", smoothRangeVal + "");
                }

                i++;
            }

            table.EndRow();
            this.BindDataSource(table);
        }
Esempio n. 4
0
        /// <summary>
        /// 创建单点定位
        /// </summary>
        /// <param name="obsPath">测站信息</param>
        /// <param name="startTime">起始计算时间</param>
        /// <returns></returns>
        private IonFreeDoubleDifferPositioner BuildPositioner(string obsPath, RinexFileObsDataSource refStationPath, BufferedTimePeriod startTime)
        {
            GnssProcessOption PositionOption = GetModel(startTime);

            #region 星历钟差数据源配置
            #region 星历数据配置
            FileEphemerisService ephemerisDataSource = null;
            if (IsSetEphemerisFile)
            {
                string ephemerisPath = this.textBox_navPath.Text;
                if (!File.Exists(ephemerisPath))
                {
                    throw new FileNotFoundException("指定星历文件不存在!\r\n" + ephemerisPath);
                }
                FileEphemerisType ephType = EphemerisDataSourceFactory.GetFileEphemerisTypeFromPath(ephemerisPath);
                ephemerisDataSource = EphemerisDataSourceFactory.Create(ephemerisPath);
            }
            #endregion
            #region 钟差数据配置
            Data.ISimpleClockService clock = null;
            if (this.checkBox_enableClockFile.Checked)
            {
                clock = new Data.SimpleClockService(this.textBox_ClockPath.Text);
            }
            #endregion
            #endregion

            #region 定位器构造


            //加载文件数据
            RinexFileObsDataSource refObservationDataSource = (refStationPath);

            var rovObservationDataSource = new RinexFileObsDataSource(obsPath);

            DataSourceContext             context = DataSourceContext.LoadDefault(PositionOption, rovObservationDataSource, ephemerisDataSource, clock);
            IonFreeDoubleDifferPositioner pp      = new IonFreeDoubleDifferPositioner(context, PositionOption);

            //pp.Produced += pp_ProgressIncreased;
            return(pp);

            #endregion
        }
Esempio n. 5
0
        private void button_viewObs_Click(object sender, EventArgs e)
        {
            if (ObsFile == null)
            {
                MessageBox.Show("请先读取数据!"); return;
            }

            EnableRunButton(false);

            double cutOff           = namedFloatControl_satCutoff.GetValue();
            int    smoothWindow     = this.namedIntControl_smoothWindow.GetValue();
            var    EpochInfoBuilder = new RinexEpochInfoBuilder(ObsFile.Header);

            var _obsDataSource = new RinexFileObsDataSource(ObsPath);

            SmoothedRangeBuilderManagerP1 = BuildPhaseSmoothRangeBulider();


            ObjectTableManager txtManager = new ObjectTableManager(10000000, OutDirectory);
            ObjectTableStorage table      = txtManager.GetOrCreate(System.IO.Path.GetFileNameWithoutExtension(ObsPath) + "_Data");// new TableTextStorage();

            var option = new GnssProcessOption();

            option.VertAngleCut = this.namedFloatControl_satCutoff.GetValue();
            var context = DataSourceContext.LoadDefault(option, _obsDataSource);

            var bufferedStream = new BufferedStreamService <EpochInformation>(_obsDataSource, option.BufferSize);

            //var EphemerisEndTime = context.EphemerisService.TimePeriod.BufferedEnd;
            SatTimeInfoManager SatTimeInfoManager = new Gnsser.SatTimeInfoManager(_obsDataSource.ObsInfo.Interval);
            //var Reviser = EpochInfoReviseManager.GetDefaultCycleSlipDetectReviser(context, option);

            var Reviser = new BufferPolyRangeSmoothReviser(option);
            //.GetDefaultEpochInfoReviser(context, option, SatTimeInfoManager);
            var checker = EpochCheckingManager.GetDefaultCheckers(context, option);
            int i       = -1;

            progressBarComponent1.InitProcess(ObsFile.Count);
            foreach (var item in bufferedStream)
            {
                i++;

                progressBarComponent1.PerformProcessStep();

                //原始数据检核
                var epochInfo = item;
                if (!checker.Check(item))
                {
                    continue;
                }
                //数据矫正
                Reviser.Buffers = bufferedStream.MaterialBuffers;
                bool result = Reviser.Revise(ref epochInfo);
                if (!result)
                {
                    continue;
                }

                table.NewRow();
                table.AddItem("Epoch", epochInfo.ReceiverTime.ToShortTimeString());
                //计算伪距平滑值
                foreach (var sat in epochInfo)
                {
                    //观测值,或组合值
                    var rangeVal       = sat.FrequenceA.PseudoRange.Value; // sat[type].CorrectedValue;
                    var phaseVal       = sat.FrequenceA.PhaseRange.Value;  // sat[option.PhaseTypeToSmoothRange].CorrectedValue;
                    var manager        = SmoothedRangeBuilderManagerP1.GetOrCreate(sat.Prn);
                    var smoothRangeVal = manager.SetRawValue(sat.ReceiverTime, rangeVal, phaseVal, 0)
                                         .SetReset(sat.IsUnstable).Build().Value;

                    table.AddItem(sat.Prn + "_P1_Raw", rangeVal);
                    table.AddItem(sat.Prn + "_P1_PolySmooth", sat.FrequenceA.PseudoRange.CorrectedValue);
                    table.AddItem(sat.Prn + "_P1_PhaseSmooth", smoothRangeVal);
                }

                i++;
            }
            progressBarComponent1.Full();

            table.EndRow();

            this.objectTableControl1.DataBind(table);
            txtManager.WriteAllToFileAndCloseStream();


            Geo.Utils.FormUtil.ShowIfOpenDirMessageBox(OutDirectory);


            EnableRunButton(true);
        }
Esempio n. 6
0
        /// <summary>
        /// 具体的执行
        /// </summary>
        /// <param name="baseline"></param>
        /// <param name="outPath"></param>
        protected void Execute(Baseline baseline, string outPath)
        {
            if (PathUtil.IsValidPath(CurrentParam.EphemerisPath))
            {
                if (this.EphemerisDataSource == null || this.EphemerisDataSource.Name != Path.GetFileName(CurrentParam.EphemerisPath))
                {
                    var sp3 = InputFileManager.GetLocalFilePath(CurrentParam.EphemerisPath, "*.sp3");
                    if (PathUtil.IsValidPath(sp3))
                    {
                        this.EphemerisDataSource = EphemerisDataSourceFactory.Create(sp3);
                    }
                }
            }
            if (PathUtil.IsValidPath(CurrentParam.ClockPath))
            {
                if (this.ClockFile == null || this.ClockFile.Name != Path.GetFileName(CurrentParam.ClockPath))
                {
                    var clk = InputFileManager.GetLocalFilePath(CurrentParam.ClockPath, "*.clk");
                    if (PathUtil.IsValidPath(clk))
                    {
                        this.ClockFile = new Data.SimpleClockService(clk);
                    }
                }
            }

            var refPath = ObsFiles.Find(m => m.ToLower().Contains(baseline.StartName.ToLower()));
            var rovPath = ObsFiles.Find(m => m.ToLower().Contains(baseline.EndName.ToLower()));

            if (refPath == null || rovPath == null)
            {
                throw new ArgumentException("没有找到基线对应的文件!" + baseline.ToString());
                return;
            }
            var inputPathes = new string[] { refPath, rovPath };

            RinexFileObsDataSource refObsDataSource = new RinexFileObsDataSource(refPath, true);
            RinexFileObsDataSource rovObsDataSource = new RinexFileObsDataSource(rovPath, true);

            if (SiteInfoDics != null)
            {
                var siteName = baseline.StartName.ToUpper();
                if (SiteInfoDics.ContainsKey(siteName))
                {
                    refObsDataSource.SiteInfo.SetApproxXyz(SiteInfoDics[siteName].EstimatedXyz);
                }
                siteName = baseline.EndName.ToUpper();
                if (SiteInfoDics.ContainsKey(siteName))
                {
                    rovObsDataSource.SiteInfo.SetApproxXyz(SiteInfoDics[siteName].EstimatedXyz);
                }
            }

            GnssProcessOption option = GnssProcessOption.GetDefault(GnsserConfig, refObsDataSource.ObsInfo);

            option.GnssSolverType = GnssSolverType.无电离层双差;

            var source = new MultiSiteObsStream(inputPathes, BaseSiteSelectType.GeoCenter, true, "");
            DataSourceContext context = DataSourceContext.LoadDefault(option, source, EphemerisDataSource, ClockFile);

            IntegralGnssFileSolver Solver = new IntegralGnssFileSolver();

            Solver.Completed += Solver_Completed;
            Solver.Option     = option;
            Solver.IsCancel   = false;
            Solver.Solver     = GnssSolverFactory.Create(context, option);;

            Solver.Init(inputPathes);

            Solver.Run();
            var last = Solver.CurrentGnssResult;

            lock (locker)
            {
                Geo.Utils.FileUtil.CheckOrCreateDirectory(Path.GetDirectoryName(outPath));
                SaveLastResult(last);
            }
        }
Esempio n. 7
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            startTime = DateTime.Now;
            //线程访问,避免等待。
            this.Invoke(new Action(delegate() { LoadDataSource(); }));

            ObsDataAnalyst = null;
            if (checkBox_preAnalysis.Checked && this.CaculateType == CaculateType.Filter) // 分析一次就够了,否则浪费时间。
            {
                Analysis();
            }

            ShowInfo("数据分析时间:" + (DateTime.Now - startTime));

            //  try
            //{
            ProcessCount = 0;
            startTime    = DateTime.Now;

            int MaxProcessCount = int.Parse(this.textBox_caculateCount.Text);
            int startEphoch     = int.Parse(textBox_startEpoch.Text);

            _results.Clear();
            Adjustments.Clear();

            GnssProcessOption option = GetModel(RovObsDataSource.ObsInfo.StartTime);
            //统计共同卫星
            //   SourcePrnStatistics sta = new SourcePrnStatistics(RefObsDataSource, RovObsDataSource, option.SatelliteTypes, 6);
            //   option.CommonPrns = sta.CommonPRNs;
            List <string> oPathes = new List <string>()
            {
                this.textBox_obsPath_ref.Text, rovPath
            };
            var MultiSiteObsDataSource = new MultiSiteObsStream(oPathes, option.BaseSiteSelectType, true, option.IndicatedBaseSiteName);

            DataSourceContext context = DataSourceContext.LoadDefault(option, MultiSiteObsDataSource, ephemerisDataSource, clockFile);

            //选择适当的差分算法
            if (radioButton_pppResidualDiffer.Checked)
            {
                _positioner = new IonFreeDoubleDifferPositioner(context, option);
                ((IonFreeDoubleDifferPositioner)_positioner).Produced += pp_ProgressIncreased;
            }
            if (radioButton_phaseSingleDiffer.Checked)
            {
                //   option.IsUseFiexedSats = true;
                _positioner = new SingleDifferPositioner(context, option);
                ((SingleDifferPositioner)_positioner).Produced += pp_ProgressIncreased;
            }
            if (radioButton_norelevant.Checked)
            {
                //   option.IsUseFiexedSats = true;
                _positioner = new SingleDifferNoRelevantPositioner(context, option);
                ((SingleDifferNoRelevantPositioner)_positioner).Produced += pp_ProgressIncreased;
            }
            if (radioButton_doubleDiffer.Checked)
            {
                // option.IsUseFiexedSats = true;
                _positioner = new PeriodDoublePhaseDifferPositioner(context, option);
                ((PeriodDoublePhaseDifferPositioner)_positioner).Produced += pp_ProgressIncreased;
            }


            int CurrentIndex = 0;
            var MultiSiteSatTimeInfoManager = new Gnsser.MultiSiteSatTimeInfoManager(MultiSiteObsDataSource.BaseDataSource.ObsInfo.Interval);
            var checker                    = MultiSiteEpochCheckingManager.GetDefault(context, option);
            var reviser                    = MultiSiteEpochInfoReviseManager.GetDefault(context, option, MultiSiteSatTimeInfoManager);
            var rawreviser                 = MultiSiteEpochInfoReviseManager.GetDefaultRaw(context, option);
            var bufferedStream             = new Geo.BufferedStreamService <MultiSiteEpochInfo>(context.ObservationDataSources, option.BufferSize);
            var MultiSitePeriodInfoBuilder = new Domain.MultiSitePeriodInfoBuilder(option);

            foreach (var item in bufferedStream)
            {
                if (IsCancel)
                {
                    log.Info("计算被手动取消。"); break;
                }
                if (CurrentIndex < option.StartIndex)
                {
                    log.Info("略过历元编号 " + CurrentIndex + ", 将开始于 " + option.StartIndex); continue;
                }
                if (CurrentIndex > option.StartIndex + option.CaculateCount)
                {
                    log.Info("计算达到设置的最大数量" + option.CaculateCount); break;
                }
                //if (key.First.ReceiverTime > this.EphemerisEndTime)
                //{
                //    log.Error("星历服务停止!无法继续计算。");
                //    break;
                //}
                if (!checker.Check(item))
                {
                    continue;
                }
                var val = item;
                if (!rawreviser.Revise(ref val))
                {
                    continue;
                }

                if (!reviser.Revise(ref val))
                {
                    continue;
                }

                BaseGnssResult GnssResult = null;
                if (_positioner is MultiSitePeriodSolver)
                {
                    MultiSitePeriodInfoBuilder.Add(item);
                    var period = MultiSitePeriodInfoBuilder.Build();
                    if (period == null || !period.Enabled)
                    {
                        continue;
                    }

                    GnssResult = ((MultiSitePeriodSolver)_positioner).Get(period);
                }
                else
                {
                    GnssResult = ((MultiSiteEpochSolver)_positioner).Get(item);
                }

                if (GnssResult == null)
                {
                    continue;
                }


                //GnssResults.Add(GnssResult);

                ////注册参数名称
                //NamedValueRowManager.Regist(GnssResult.ParamNames);

                //if (IsCancel) { break; }
                //ShowNotice("当前进度:" + CurrentIndex++);
            }

            //_positioner.Gets(startEphoch, MaxProcessCount);
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message);
            //}
        }
Esempio n. 8
0
        private void button_multiSolve_Click(object sender, EventArgs e)
        {
            CheckAndReadObsFile();
            double cutOff             = namedFloatControl_satCutoff.GetValue();
            int    smoothWindow       = this.namedIntControl_smoothWindow.GetValue();
            bool   isUserRawValue     = this.radioButton_isUserRawValue.Checked;
            bool   isUseSphaseSmoothP = this.radioButton_isUsePhaaseSmoothP.Checked;
            bool   isUserPolyFitValue = this.radioButton_isUserPolyFitVal.Checked;

            var PhaseSmoothRangeBulider = new NamedCarrierSmoothedRangeBuilderManager(true, smoothWindow, true, IonoDifferCorrectionType.DualFreqCarrier);


            GlobalIgsGridIonoService    ionoService      = GlobalIgsGridIonoService.Instance;
            GlobalIgsGridIonoDcbService ionoDcbService   = GlobalIgsGridIonoDcbService.Instance;
            GlobalIgsEphemerisService   ephemerisService = GlobalIgsEphemerisService.Instance;

            ObjectTableStorage table = new ObjectTableStorage(Path.GetFileName(ObsPath) + "_硬件延迟");
            var EpochInfoBuilder     = new RinexEpochInfoBuilder(ObsFile.Header);
            var _obsDataSource       = new RinexFileObsDataSource(ObsPath);
            var option         = new GnssProcessOption();
            var context        = DataSourceContext.LoadDefault(option, _obsDataSource);
            var bufferedStream = new BufferedStreamService <EpochInformation>(_obsDataSource, option.BufferSize);
            SatTimeInfoManager SatTimeInfoManager = new Gnsser.SatTimeInfoManager(_obsDataSource.ObsInfo.Interval);
            var CycleReviser = EpochInfoReviseManager.GetDefaultCycleSlipDetectReviser(context, option);
            var Reviser      = new BufferPolyRangeSmoothReviser(option);
            //EpochInfoReviseManager.GetDefaultEpochInfoReviser(context, option, SatTimeInfoManager);
            var checker = EpochCheckingManager.GetDefaultCheckers(context, option);
            int i       = -1;
            var siteXyz = ObsFile.Header.ApproxXyz;

            progressBarComponent1.InitProcess(ObsFile.Count);
            foreach (var item in bufferedStream)
            {
                i++;
                progressBarComponent1.PerformProcessStep();
                //原始数据检核
                var epochInfo = item;
                //if (!checker.Check(item))
                //{
                //    continue;
                //}
                ////数据矫正

                if (isUseSphaseSmoothP) //需要周跳探测
                {
                    bool result = CycleReviser.Revise(ref epochInfo);
                    if (!result)
                    {
                        continue;
                    }
                }

                if (isUserPolyFitValue)//缓存与多项式拟合改正
                {
                    Reviser.Buffers = bufferedStream.MaterialBuffers;
                    bool result = Reviser.Revise(ref epochInfo);
                    if (!result)
                    {
                        continue;
                    }
                }

                table.NewRow();
                table.AddItem("Epoch", epochInfo.ReceiverTime.ToShortTimeString());
                //计算伪距平滑值
                foreach (var sat in epochInfo)
                {
                    var prn  = sat.Prn;
                    var time = sat.ReceiverTime;
                    var eph  = ephemerisService.Get(prn, time);
                    if (eph == null)
                    {
                        continue;
                    }

                    var satXyz = eph.XYZ;

                    var polar = Geo.Coordinates.CoordTransformer.XyzToGeoPolar(satXyz, siteXyz, AngleUnit.Degree);
                    if (polar.Elevation < cutOff)
                    {
                        continue;
                    }

                    double P1_P2sat = ionoDcbService.GetDcb(time, prn).Value *GnssConst.MeterPerNano;
                    // double P1_P2recMeter = ionoDcbService.GetDcbMeterForP1(time, Path.GetFileName(ObsPath).Substring(0, 4).ToLower());

                    var F1 = sat.FrequenceA.Frequence; // Frequence.GetFrequence(prn, 1, time);
                    var F2 = sat.FrequenceB.Frequence; //Frequence.GetFrequence(prn, 2, time);

                    var f1 = F1.Value * 1e6;           //恢复单位
                    var f2 = F2.Value * 1e6;

                    double f1f1 = f1 * f1;
                    double f2f2 = f2 * f2;

                    double a = -40.28 * (f2f2 - f1f1) / (f1f1 * f2f2);

                    //观测值,或组合值
                    var P1 = sat.FrequenceA.PseudoRange.Value;
                    var P2 = sat.FrequenceB.PseudoRange.Value;
                    var L1 = sat.FrequenceA.PhaseRange.Value;
                    var L2 = sat.FrequenceB.PhaseRange.Value;

                    double differP = P1 - P2;//raw Value
                    if (isUseSphaseSmoothP)
                    {
                        var smootherP1 = PhaseSmoothRangeBulider.GetOrCreate(prn + "_P1");
                        var smootherP2 = PhaseSmoothRangeBulider.GetOrCreate(prn + "_P2");

                        var P1s = smootherP1
                                  .SetReset(sat.IsUnstable)
                                  .SetRawValue(sat.ReceiverTime, P1, L1, sat.IonoLenOfL1ByDifferL1L2)
                                  .Build();
                        var P2s = smootherP2
                                  .SetReset(sat.IsUnstable)
                                  .SetRawValue(sat.ReceiverTime, P2, L2, sat.IonoLenOfL2ByDifferL1L2)
                                  .Build();

                        differP = P1s.Value - P2s.Value;
                    }

                    if (isUserPolyFitValue)
                    {
                        differP = sat.FrequenceA.PseudoRange.CorrectedValue - sat.FrequenceB.PseudoRange.CorrectedValue;
                    }

                    var    cTEC       = ionoService.GetSlope(time, siteXyz, satXyz);
                    double ionoRange  = a * cTEC.Value * 1e16; // 单位是1e16
                    double rawDifferP = P1 - P2;

                    double ionoP1         = ionoService.GetSlopeDelayRange(time, siteXyz, satXyz, F1.Value);
                    double ionoP2         = ionoService.GetSlopeDelayRange(time, siteXyz, satXyz, F2.Value);
                    double rawDifferIonoP = ionoP1 - ionoP2;

                    var recDcb = differP - P1_P2sat - rawDifferIonoP;


                    //table.AddItem("L1", L1);
                    //table.AddItem("L2", L2);
                    //table.AddItem("P1", P1);
                    //table.AddItem("P2", P2);
                    //table.AddItem("P1S", P1s);
                    //table.AddItem("P2S", P2s);
                    //table.AddItem("P1-P2", rawDifferP);
                    //table.AddItem("IonoDiffer", rawDifferIonoP);
                    //table.AddItem("SatDcb", P1_P2sat);
                    //table.AddItem("P1-P2_rec", P1_P2recMeter);
                    table.AddItem(prn + "", recDcb);
                    //table.AddItem("SmRecDcb", smRecDcb);
                    //table.AddItem(sat.Prn + "_Raw", rangeVal + "");
                    //table.AddItem(sat.Prn + "_Smooth", smoothRangeVal + "");
                }

                i++;
            }
            progressBarComponent1.Full();

            table.EndRow();
            this.BindDataSource(table);
        }
Esempio n. 9
0
        /// <summary>
        /// 具体的执行
        /// </summary>
        /// <param name="inPath"></param>
        /// <param name="outPath"></param>
        protected override void Execute(string inPath, string outPath)
        {
            this.EphemerisDataSource = EphemerisDataSourceFactory.Create(CurrentParam.EphemerisPath);
            if (File.Exists(CurrentParam.ClockPath))
            {
                this.ClockFile = new Data.SimpleClockService(CurrentParam.ClockPath);
            }

            RinexFileObsDataSource obsDataSource = new RinexFileObsDataSource(inPath, true);
            GnssProcessOption      option        = GnssProcessOption.GetDefault(GnsserConfig, obsDataSource.ObsInfo);

            DataSourceContext      DataSourceContext = DataSourceContext.LoadDefault(option, obsDataSource, this.EphemerisDataSource, ClockFile);
            EpochInfoReviseManager reviser           = new EpochInfoReviseManager(DataSourceContext, option);

            //写入到流
            Gnsser.Data.Rinex.RinexObsFileWriter writer = new Data.Rinex.RinexObsFileWriter(outPath, CurrentParam.OutputVersion);
            EpochInfoToRinex EpochInfoToRinex           = new Domain.EpochInfoToRinex(this.CurrentParam.OutputVersion, true);

            //直接写入数据流,并不存储,以节约空间。
            Gnsser.Data.Rinex.RinexObsFileHeader newHeader = null;
            int maxBufferEpoch = 200;
            int i = 0;

            foreach (var item in obsDataSource)
            {
                //预处理在此进行!!!
                var processed = item;
                reviser.Revise(ref processed);

                if (processed != null)
                {
                    var epochObs = EpochInfoToRinex.Build(processed);
                    if (newHeader == null)
                    {
                        newHeader = epochObs.Header;
                        writer.WriteHeader(newHeader);
                    }

                    writer.WriteEpochObservation(epochObs);

                    if (i > maxBufferEpoch)
                    {
                        writer.Writer.Flush();
                    }
                }
                i++;
            }
            writer.Writer.Close();

            TimeSpan      span = DateTime.Now - startTime;
            StringBuilder sb   = new StringBuilder();

            sb.Append("耗时:" + DateTimeUtil.GetFloatString(span));
            sb.AppendLine(",输出到 " + outPath);

            //信息汇总
            lock (locker)
            {
                var path = Path.Combine(Path.GetDirectoryName(outPath), "PositionPreprocess.summery");

                Geo.Utils.FileUtil.CheckOrCreateDirectory(Path.GetDirectoryName(path));
                File.AppendAllText(path, sb.ToString());
            }
        }