Пример #1
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);
        }
Пример #2
0
        /// <summary>
        /// 矫正器,此处只需进行模型改正了。
        /// </summary>
        /// <returns></returns>
        protected override IReviser <EpochInformation> BuildProducingReviser()
        {
            SatTimeInfoManager = new SatTimeInfoManager(DataSource.ObsInfo.Interval);

            return(EpochInfoReviseManager.GetProducingReviser(Context, Option, SatTimeInfoManager));
        }
Пример #3
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);
        }
Пример #4
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);
        }
Пример #5
0
        /// <summary>
        /// 改正数,在即将执行 Producing 时触发。
        /// 包括周跳逆序探测,平滑伪距
        /// </summary>
        /// <param name="Context"></param>
        /// <param name="Option"></param>
        /// <param name="SatTimeInfoManager"></param>
        /// <returns></returns>
        public static EpochInfoReviseManager GetProducingReviser(DataSourceContext Context, GnssProcessOption Option, SatTimeInfoManager SatTimeInfoManager)
        {
            EpochInfoReviseManager processer = new EpochInfoReviseManager(Context, Option);

            //掐头去尾
            if (Option.IsBreakOffBothEnds)
            {
                processer.AddProcessor(new BreakOffBothEndsReviser(Context.SiteSatAppearenceService, Option.MinuteOfBreakOffBothEnds));
            }


            #region 周跳管理器,这个应该放在数据删除之后,以免有的数据漏标或错标,比如高度截止角出现后,会漏探

            if (Option.IsDetectClockJump)
            {
                processer.AddProcessor(new ClockJumpDetector(Option));
            }

            if (Option.IsCycleSlipDetectionRequired)
            {
                processer.AddProcessor(GetDefaultCycleSlipDetectReviser(Context, Option));
            }
            #endregion

            //周跳逆序探测,缓存探测,
            processer.AddProcessor(GetBufferedReviser(Context, Option, SatTimeInfoManager));



            var co = GetCorrectionRevisers(Context, Option);
            co.AddProcessor(processer);
            return(co);
        }
Пример #6
0
        /// <summary>
        /// 逆序探测与区段删除
        /// </summary>
        /// <param name="Context"></param>
        /// <param name="Option"></param>
        /// <param name="SatTimeInfoManager"></param>
        /// <returns></returns>
        public static EpochInfoReviseManager GetBufferedReviser(DataSourceContext Context, GnssProcessOption Option, SatTimeInfoManager SatTimeInfoManager)
        {
            EpochInfoReviseManager processer = new EpochInfoReviseManager(Context, Option);

            //这个方法被上面替代了,因此不再使用
            if (false && SatTimeInfoManager != null && Option.IsRemoveSmallPartSat)
            {
                if (Option.MinContinuouObsCount > Option.BufferSize)
                {
                    throw new ArgumentException("缓存小于最小连续卫星数,将剔除所有数据!");
                }
                processer.AddProcessor(new SatSpanFilterOld(SatTimeInfoManager, Option.MinContinuouObsCount));
            }

            if (Option.IsReverseCycleSlipeRevise)
            {
                processer.AddProcessor(new ReverseCycleSlipeReviser(Option));
            }
            if (Option.IsEnableBufferCs)
            {
                processer.AddProcessor(new BufferedCycleSlipDetector(Option));
            }

            return(processer);
        }
Пример #7
0
        /// <summary>
        /// 默认的,对原始观测数据源进行处理。这是最全的矫正器,
        /// 包含检核、星历赋予、改正数赋予等。
        /// </summary>
        /// <param name="Context"></param>
        /// <param name="Option"></param>
        /// <param name="SatTimeInfoManager"></param>
        /// <returns></returns>
        public static EpochInfoReviseManager GetDefaultEpochInfoReviser(DataSourceContext Context, GnssProcessOption Option, SatTimeInfoManager SatTimeInfoManager)
        {
            EpochInfoReviseManager processer = GetFirstStepEpochInfoReviser(Context, Option);

            processer.AddProcessor(GetProducingReviser(Context, Option, SatTimeInfoManager));

            return(processer);
        }