/// <summary>
        /// 三频无电离层组合系数
        /// </summary>
        /// <param name="sat"></param>
        /// <returns></returns>
        public static double[] GetIonoFreeCombFactorsThreeFrequency(EpochSatellite sat)
        {
            double f1 = sat.FrequenceA.Frequence.Value; // Frequence.GetFrequence(gnssType, 1).Value;
            double f2 = sat.FrequenceB.Frequence.Value; // Frequence.GetFrequence(gnssType, 2).Value;
            double f3 = sat.FrequenceC.Frequence.Value; // Frequence.GetFrequence(gnssType, 3).Value;


            double f1_2 = f1 * f1;
            double f2_2 = f2 * f2;
            double f3_2 = f3 * f3;

            double f1_3 = f1 * f1 * f1;
            double f2_3 = f2 * f2 * f2;
            double f3_3 = f3 * f3 * f3;

            double factor4 = f1_3 * (f3 - f2) - f2_3 * (f3 - f1) + f3_3 * (f2 - f1);

            double factor1 = f1_3 * (f3 - f2) / factor4;
            double factor2 = -f2_3 * (f3 - f1) / factor4;
            double factor3 = f3_3 * (f2 - f1) / factor4;

            //波长 = c / factor4;
            //N = C4 * ( C1 * N1 + C2 * N2 + C3 * N3 );

            return(new double[] { factor1, factor2, factor3 });
        }
        /// <summary>
        /// 三频无电离层组合
        /// </summary>
        /// <param name="sat"></param>
        /// <returns></returns>
        public static double[] GetIonoFreeCombFactorsThreeFrequency2(EpochSatellite sat)
        {
            double f1 = sat.FrequenceA.Frequence.Value; // Frequence.GetFrequence(sat, 1).Value;
            double f2 = sat.FrequenceB.Frequence.Value; // Frequence.GetFrequence(sat, 2).Value;
            double f3 = sat.FrequenceC.Frequence.Value; // Frequence.GetFrequence(sat, 3).Value;

            double f1_2 = f1 * f1;
            double f2_2 = f2 * f2;
            double f3_2 = f3 * f3;

            double f1_3 = f1 * f1 * f1;
            double f2_3 = f2 * f2 * f2;
            double f3_3 = f3 * f3 * f3;

            double factorUp1 = (f1_3 * f1) * (f3 - f2) / (f3 - f1) / (f2 - f1);
            double factorUp2 = -(f2_3 * f1) / (f2 - f1);
            double factorUp3 = (f3_3 * f1) / (f3 - f1);

            double down = factorUp1 + factorUp2 + factorUp3;

            double factor1 = factorUp1 / down;
            double factor2 = factorUp2 / down;
            double factor3 = factorUp3 / down;

            //double frequence = factor1 * FreqenceBand.GpsL1.Freqence + factor2 * FreqenceBand.GpsL2.Freqence;
            //double waveLen = GnssConst.LIGHT_SPEED / frequence / 1e6;

            return(new double[] { factor1, factor2, factor3 });
        }
        /// <summary>
        /// 指定系统的无电离层组合
        /// </summary>
        /// <param name="type">系统类型</param>
        /// <param name="name"></param>
        /// <returns></returns>
        public static Frequence GetIonoFreeCompositBandThreeFrequency(EpochSatellite sat, string name = null)
        {
            double[] facs = GetIonoFreeCombFactorsThreeFrequency(sat);

            Frequence bandA = sat.FrequenceA.Frequence; // Frequence.GetFrequenceA(sat.Prn, sat.ReceiverTime);
            Frequence bandB = sat.FrequenceA.Frequence; // Frequence.GetFrequenceB(sat.Prn, sat.ReceiverTime);
            Frequence bandC = sat.FrequenceA.Frequence; // Frequence.GetFrequenceC(sat.Prn, sat.ReceiverTime);

            name = name ?? sat + "_" + bandA.Name + bandB.Name + bandC.Name + "_IonoFree";

            return(GetCompositFreqenceBandThreeFrequency(facs[0], bandA, facs[1], bandB, facs[2], bandC, name));
        }
Beispiel #4
0
        /// <summary>
        /// 创建观测信息对象
        /// </summary>
        /// <returns></returns>
        public override EpochInformation Build(RinexEpochObservation obsSection)
        {
            if (obsSection == null)
            {
                return(null);
            }

            EpochInformation EpochInformation = new Domain.EpochInformation();

            EpochInformation.Name       = obsSection.Name;
            EpochInformation.SiteInfo   = obsSection.Header.SiteInfo;
            EpochInformation.ObsInfo    = obsSection.Header.ObsInfo;
            EpochInformation.EpochState = (EpochState)obsSection.EpochFlag; //历元标志,周跳探测用

            var time = new CorrectableTime(obsSection.ReceiverTime);

            EpochInformation.Time = time;

            //扩展
            RinexFreqObsBuilder FreqObsBuilder = new RinexFreqObsBuilder();
            var epochSatBuilder = new RinexEpochSatBuilder(FreqObsBuilder);
            //添加原始观测量。
            var prns = obsSection.Prns;

            prns.Sort();
            foreach (var prn in prns)
            {
                //过滤掉不需要处理的卫星类型
                if (!SatelliteTypes.Contains(SatelliteType.M) && !SatelliteTypes.Contains(prn.SatelliteType))
                {
                    continue;
                }
                EpochSatellite epochSat   = null;
                var            observtion = obsSection[prn];
                if (observtion != null)
                {
                    epochSatBuilder
                    .SetEpochInfo(EpochInformation)
                    .SetPrn(prn);
                    epochSat = epochSatBuilder.Build(observtion);
                }
                if (epochSat != null)
                {
                    EpochInformation.Add(prn, epochSat);
                }
            }
            return(EpochInformation);
        }
        /// <summary>
        /// 双频载波距离组合生成,返回相位组合,单位为米,如LI组合等。
        /// </summary>
        /// <param name="epochSat">卫星</param>
        /// <param name="factor1">系数</param>
        /// <param name="factor2">系数</param>
        /// <param name="name">名称</param>
        /// <returns></returns>
        public static PhaseCombination GetDoublePhaseRangeCombination(EpochSatellite epochSat, double factor1, double factor2, string name = "")
        {
            if (epochSat.FrequencyCount < 2)
            {
                throw new Exception("频率数量必须大于等于2!" + epochSat.SiteInfo.SiteName + ", " + epochSat);
            }
            if (name == "")
            {
                name = epochSat.Prn.SatelliteType + "_" + factor1 + "_" + factor2;
            }
            //距离系数和载波相位系数能不能一样??????????是一个问题。2018.09.01,czs, hmx,
            Frequence freqence = GetDoubleCompositFreqence(epochSat, factor1, factor2, name);

            double valA = epochSat.FrequenceA.PhaseRange.Value;
            double valB = epochSat.FrequenceB.PhaseRange.Value;


            double value = GetCombinationValue(factor1, valA, factor2, valB);

            return(new PhaseCombination(value, freqence));
        }
Beispiel #6
0
        private void SetAmbiguityOfIonoFreePhase(EpochSatellite sat)
        {
            long cycle = 0;

            if (sat.IsUnstable)  //|| csflag
            {
                sat.IsUnstable = true;

                //不用采用改正数。两者相减去可抵消。
                double diffDistance = sat.Combinations.IonoFreeRange.CorrectedValue
                                      - sat.Combinations.IonoFreePhaseRange.CorrectedValue;

                cycle = sat.Combinations.IonoFreePhaseRange.Frequence.GetCycle(diffDistance);

                SatIonoFreeAmbiguityManager.SetInitCyle(sat, cycle);
            }
            else//直接赋值
            {
                cycle = SatIonoFreeAmbiguityManager.GetCycle(sat);
            }
            sat.AmbiguityOfIonoFreePhase = cycle;
        }
Beispiel #7
0
 /// <summary>
 /// 历元卫星组合值
 /// </summary>
 /// <param name="EpochSat">历元卫星</param>
 public EpochSatCombination(EpochSatellite EpochSat)
 {
     this.EpochSat = EpochSat;
 }
 /// <summary>
 /// 双频组合后的频率
 /// </summary>
 /// <param name="epochSat"></param>
 /// <param name="factorA">载波相位系数</param>
 /// <param name="factorB">载波相位系数</param>
 /// <param name="name"></param>
 /// <returns></returns>
 public static Frequence GetDoubleCompositFreqence(EpochSatellite epochSat, double factorA, double factorB, string name = null)
 {
     return(GetCompositFreqence(factorA, epochSat.FrequenceA.Frequence, factorB, epochSat.FrequenceB.Frequence, name));
 }
        /// <summary>
        /// 3频无电离层组合,返回已改正后的值。
        /// </summary>
        /// <param name="range1">载波或伪距1</param>
        /// <param name="range2">载波或伪距2</param>
        /// <param name="range3">载波或伪距3</param>
        /// <returns></returns>
        public static double GetIonoFreeComValue(double range1, double range2, double range3, EpochSatellite sat)
        {
            double range;

            double[] facs = GetIonoFreeCombFactorsThreeFrequency(sat);
            double   fac1 = facs[0];
            double   fac2 = facs[1];
            double   fac3 = facs[2];

            range = fac1 * range1 + fac2 * range2 + fac3 * range3;

            return(range);
        }
 /// <summary>
 /// 构造函数。
 /// </summary>
 /// <param name="epochSatellite">站星线段</param>
 public PhaseCombinationBuilder(EpochSatellite epochSatellite)
 {
     this.EpochSat = epochSatellite;
 }