示例#1
0
        /// <summary>
        /// 初探
        /// </summary>
        /// <param name="info"></param>
        public override void RawRevise(RinexEpochObservation info)
        {
            if (Option.IsAmendBigCs)
            {
                foreach (var sat in info)
                {
                    var  wlen     = Frequence.GetFrequence(sat.Prn, 1, info.ReceiverTime).WaveLength;
                    var  window   = this.PhaseACycleSlipAmender.GetOrCreate(sat.Prn);
                    var  referVal = sat.RangeA.Value / wlen;
                    bool isRested = false;
                    sat.PhaseA.Value = window.FitCheckAddAndAlignWithStep(info.ReceiverTime, sat.PhaseA.Value, out isRested, referVal, 2, 50, 100);
                    //若重置,则应该标记周跳或失锁
                    if (isRested)
                    {
                        sat.PhaseA.LossLockIndicator = LossLockIndicator.Bad;
                    }
                }
            }

            if (Option.IsEnableAlignPhase)
            {
                foreach (var sat in info)
                {
                    var NumericalAligner = NumericalAlignerManagerPhaseA.GetOrCreate(sat.Prn);
                    var phaseA           = sat.PhaseA;
                    var rangeA           = sat.RangeA.Value / Frequence.GetFrequence(sat.Prn, 1, info.ReceiverTime).WaveLength;

                    phaseA.Value = NumericalAligner.GetAlignedValue(info.ReceiverTime, phaseA.Value, rangeA);
                }
            }

            base.RawRevise(info);
            CheckAndFiltSmallSpan(info);
        }
        /// <summary>
        /// 处理过程
        /// </summary>
        /// <param name="current"></param>
        public override void Process(RinexEpochObservation current)
        {
            if (current.Count == 0)
            {
                return;
            }

            //需要缓存支持,建立头文件
            if (this.CurrentIndex == 0 || CurrentHeader == null)
            {
                //首次建立头文件,需要缓存支持
                this.CurrentHeader = BuildOutputHeader(OldHeader);
            }


            //移除观测值为 0 的载波相位
            if (Option.IsRemoveZeroPhaseSat)
            {
                List <SatelliteNumber> tobeDeletes = new List <SatelliteNumber>();
                foreach (var sat in current)
                {
                    foreach (var item in CurrentHeader.ObsCodes)
                    {
                        if (sat.Prn.SatelliteType == item.Key)
                        {
                            foreach (var code in item.Value)
                            {
                                if (code.StartsWith("L") && sat.TryGetValue(code) == 0)
                                {
                                    tobeDeletes.Add(sat.Prn);
                                }
                            }
                        }
                    }
                }
                current.Remove(tobeDeletes);
            }


            //移除观测值为 0 的伪距
            if (Option.IsRemoveZeroRangeSat)
            {
                List <SatelliteNumber> tobeDeletes = new List <SatelliteNumber>();
                foreach (var sat in current)
                {
                    foreach (var item in CurrentHeader.ObsCodes)
                    {
                        if (sat.Prn.SatelliteType == item.Key)
                        {
                            foreach (var code in item.Value)
                            {
                                if ((code.StartsWith("C") || code.StartsWith("P")) && sat.TryGetValue(code) == 0)
                                {
                                    tobeDeletes.Add(sat.Prn);
                                }
                            }
                        }
                    }
                }
                current.Remove(tobeDeletes);
            }

            //修复大周跳
            if (Option.IsAmendBigCs)
            {
                foreach (var sat in current)
                {
                    //第一频率
                    var  wlenA    = Frequence.GetFrequence(sat.Prn, 1, current.ReceiverTime).WaveLength;
                    var  window   = this.PhaseACycleSlipAmender.GetOrCreate(sat.Prn);
                    var  referVal = sat.RangeA.Value / wlenA;
                    bool isRested = false;
                    sat.PhaseA.Value = window.FitCheckAddAndAlignWithStep(current.ReceiverTime, sat.PhaseA.Value, out isRested, referVal, 2, 50, 100);
                    //若重置,则应该标记周跳或失锁
                    if (isRested)
                    {
                        sat.PhaseA.LossLockIndicator = LossLockIndicator.Bad;
                    }
                    //第二频率
                    var phaseB = sat.PhaseB;
                    if (phaseB != null)
                    {
                        var  wlenB     = Frequence.GetFrequence(sat.Prn, 2, current.ReceiverTime).WaveLength;
                        var  windowB   = this.PhaseBCycleSlipAmender.GetOrCreate(sat.Prn);
                        var  referValB = sat.RangeB.Value / wlenB;
                        bool isRestedB = false;
                        sat.PhaseB.Value = windowB.FitCheckAddAndAlignWithStep(current.ReceiverTime, sat.PhaseB.Value, out isRested, referValB, 2, 50, 100);
                        //若重置,则应该标记周跳或失锁
                        if (isRestedB)
                        {
                            sat.PhaseB.LossLockIndicator = LossLockIndicator.Bad;
                        }
                    }
                }
            }

            //是否启用A B 相位对齐
            if (Option.IsEnableAlignPhase)
            {
                foreach (var sat in current)
                {
                    var NumericalAligner = NumericalAlignerManagerPhaseA.GetOrCreate(sat.Prn);
                    var phaseA           = sat.PhaseA;
                    var rangeA           = sat.RangeA.Value / Frequence.GetFrequence(sat.Prn, 1, current.ReceiverTime).WaveLength;

                    phaseA.Value = NumericalAligner.GetAlignedValue(current.ReceiverTime, phaseA.Value, rangeA);


                    var phaseB = sat.PhaseB;
                    if (phaseB != null)
                    {
                        var NumericalAlignerB = NumericalAlignerManagerPhaseB.GetOrCreate(sat.Prn);
                        var rangeB            = sat.RangeB.Value / Frequence.GetFrequence(sat.Prn, 2, current.ReceiverTime).WaveLength;

                        phaseB.Value = NumericalAlignerB.GetAlignedValue(current.ReceiverTime, phaseB.Value, rangeB);
                    }
                }
            }
            //载波相位相位转换为距离
            if (Option.IsConvertPhaseToLength)
            {
                foreach (var item in current)
                {
                    if (item.Prn.SatelliteType == SatelliteType.G)
                    {
                        foreach (var val in item)
                        {
                            if (val.Key.Contains("L1"))
                            {
                                val.Value.Value = val.Value.Value * Frequence.GpsL1.WaveLength;
                            }
                            if (val.Key.Contains("L2"))
                            {
                                val.Value.Value = val.Value.Value * Frequence.GpsL2.WaveLength;
                            }
                        }
                    }
                }
            }

            //update
            PrevOkEpoch    = current.ReceiverTime;
            current.Header = this.CurrentHeader;

            //判断并写入文件
            WriteToFile(current);
        }