예제 #1
0
        public bool Revise(ref EpochInformation info)
        {
            this.Correct(info);
            Dictionary <RinexSatFrequency, NEU> frequencyDicCorrection = this.Correction;

            foreach (var sat in info.EnabledSats)//分别对指定卫星指定频率进行改正
            {
                var satFreqs = sat.RinexSatFrequences;
                //分别执行改正
                foreach (var freqCorretion in frequencyDicCorrection)
                {
                    if (satFreqs.Contains(freqCorretion.Key))//指定类型的卫星,该卫星包含指定频率
                    {
                        //改正等效距离
                        //double rangeCorretion = CoordUtil.GetDirectionLength(freqCorretion.Value, info.ApproxXyz, sat.Ephemeris.XYZ);

                        double rangeCorretion = CoordUtil.GetDirectionLength(freqCorretion.Value, sat.Polar);

                        FrequenceType       freqType = ObsCodeConvert.GetFrequenceType(freqCorretion.Key);
                        FreqenceObservation freObs   = sat[freqType];

                        if (rangeCorretion == 0)
                        {
                            continue;
                        }
                        //  //    freObs.AddCommonCorrection(this.Name, -freqCorretion.Value.U);//若为正,其让站星观测值变小了,作为近似值改正数,应该减去

                        freObs.AddCommonCorrection(this.Name, -rangeCorretion);  //若为正,其让站星观测值变小了,作为近似值改正数,应该减去
                        //作为公共距离,还是只作为载波的改正?
                    }
                }
            }
            return(true);
        }
        /// <summary>
        /// 矫正
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public bool Revise(ref EpochInformation info)
        {
            foreach (var sat in info)
            {
                if (!sat.Enabled || !sat.HasEphemeris)
                {
                    continue;
                }

                this.Correct(sat);

                var satFreqs = sat.RinexSatFrequences;
                //分别执行改正
                foreach (var frequencyCorretor in this.Correction)
                {
                    if (satFreqs.Contains(frequencyCorretor.Key))//指定类型的卫星类型和频率 如 GPS L1, GPS L2
                    {
                        //只改正指定观测频率的等效距离
                        double rangeCorretion = frequencyCorretor.Value;
                        if (rangeCorretion == 0)
                        {
                            continue;
                        }

                        var freqType = ObsCodeConvert.GetFrequenceType(frequencyCorretor.Key);
                        FreqenceObservation freObs = sat[freqType];
                        if (freObs.CommonCorrection.ContainsCorrection(Name))
                        {
                            continue;
                        }
                        freObs.AddCommonCorrection(this.Name, rangeCorretion);
                    }
                }
            }
            return(true);
        }
예제 #3
0
        /// <summary>
        /// 构建,如果可以,默认支持3个频率
        /// </summary>
        /// <returns></returns>
        public override EpochSatellite Build(RinexSatObsData observtion)
        {
            EpochSatellite epochSat = new EpochSatellite(this.EpochInfo, prn);
            //需要重新修改,RINEX 3.0 有的对 BDS 是 C1,C7, C6,3.02 明确规定是 C2, C7, C6
            Dictionary <FrequenceType, List <int> > freqDic = ObsCodeConvert.GetRinexFreqIndexDic(observtion.Prn.SatelliteType);
            //新算法,2018.09.24,hmx
            var freqNums = observtion.GetFrequenceNums();

            foreach (var num in freqNums)
            {
                var           prn      = observtion.Prn;
                FrequenceType freqType = ObsCodeConvert.GetFrequenceType(freqDic, num);
                Frequence     band     = Frequence.GetFrequence(prn, freqType, Time);
                if (band == null)
                {
                    band = Frequence.Default;
                    log.Warn("系统并未设置 " + prn.SatelliteType + " 的第 " + freqType + " 频率, 以 " + band + " 代替 !");
                }

                FreqenceObservation freqObs1 = FreqObsBuilder
                                               .SetFrequenceType(freqType)
                                               .SetFrequence(band)
                                               .SetRinexFrequenceNumber(num)
                                               .Build(observtion);
                epochSat.Set(freqObs1.FrequenceType, freqObs1);
            }

            //次新算法,比较繁琐,2018
            //List<FrequenceType> builded = new List<FrequenceType>();
            //foreach (var item in observtion)
            //{
            //    var num = Geo.Utils.StringUtil.GetNumber(item.Key);
            //    FrequenceType freqType = ObsCodeConvert.GetFrequenceType(freqDic, num);//   (FrequenceType)(builedFreq.IndexOf(num) + 1);

            //    if (!builded.Contains(freqType)) { builded.Add(freqType); }
            //    else { continue; }

            //    FreqenceObservation freqObs1 = FreqObsBuilder
            //                        .SetFrequenceType(freqType)
            //                        .SetRinexFrequenceNumber(num)
            //                        .Build(observtion);
            //    epochSat.Set(freqObs1.FrequenceType, freqObs1);
            //}

            /** //老算法,只支持3个频率
             #region 转换观测值到频率A、频率B、频率C的基本观测值
             * //第一频率
             * FreqenceObservation freqObs = FreqObsBuilder
             *  .SetFrequenceType(FrequenceType.A).Build(observtion);
             * epochSat.Set(freqObs.FrequenceType, freqObs);
             *
             * //第二频率
             * freqObs = FreqObsBuilder
             *  .SetFrequenceType(FrequenceType.B).Build(observtion);
             * if (freqObs != null) epochSat.Set(freqObs.FrequenceType, freqObs);
             *
             * //第三频率
             * freqObs = FreqObsBuilder
             *  .SetFrequenceType(FrequenceType.C).Build(observtion);
             * if (freqObs != null) epochSat.Set(freqObs.FrequenceType, freqObs);
             #endregion
             */

            return(epochSat);
        }