예제 #1
0
        /// <summary>
        /// 模糊度固定解,条件平差。
        /// </summary>
        /// <param name="result"></param>
        /// <param name="fixedPppAmbi"></param>
        private PppResult FixPppResult(PppResult result, Dictionary <SatelliteNumber, double> fixedPppAmbi)
        {
            if (fixedPppAmbi.Count < 2)
            {
                return(result);
            }

            var    floadParams = result.ResultMatrix.Estimated;
            var    paramCount  = floadParams.Count;
            int    fixedCount  = fixedPppAmbi.Count;
            Vector fixedVector = new Vector();//fixedCount + 1

            foreach (var item in fixedPppAmbi)
            {
                fixedVector.Add(item.Value, item.Key.ToString());
            }
            //构建控制阵
            Matrix constraintMatrix = new Matrix(fixedCount, paramCount);
            int    baseColIndex     = -1;// floadParams.ParamNames.IndexOf(this.CurrentBasePrn.ToString());

            for (int i = 5; i < paramCount; i++)
            {
                var sat = SatelliteNumber.Parse(floadParams.ParamNames[i]);
                if (sat == CurrentBasePrn)
                {
                    baseColIndex = i;
                    break;
                }
            }
            for (int colIndex = 5; colIndex < paramCount; colIndex++)
            {
                var sat      = SatelliteNumber.Parse(floadParams.ParamNames[colIndex]);
                int rowIndex = fixedVector.ParamNames.IndexOf(sat.ToString());//列编号与固定值对应
                if (rowIndex == -1)
                {
                    continue;//没有,略过
                }
                constraintMatrix[rowIndex, baseColIndex] = -1;
                constraintMatrix[rowIndex, colIndex]     = 1;
            }
            //条件平差
            AdjustObsMatrix obsMatrix = new AdjustObsMatrix();

            obsMatrix.SetCoefficient(constraintMatrix).SetObservation(floadParams).SetFreeVector(fixedVector);
            ConditionalAdjuster adjuster = new ConditionalAdjuster();
            var resultMatrix             = adjuster.Run(obsMatrix);

            result.ResultMatrix.Estimated = resultMatrix.CorrectedObs;
            return(result);
        }
예제 #2
0
        /// <summary>
        /// 提取浮点解星间单差
        /// </summary>
        /// <param name="result"></param>
        /// <param name="wideNarrowValues"></param>
        private void SetPppFloatAmbiguityLen(PppResult result, SatWideNarrowValueManager wideNarrowValues)
        {
            var floatAmbLen   = new Dictionary <SatelliteNumber, double>(); //存储星间单差无电离层浮点模糊度,略过参考星,单位:米
            var baseFloatAmbi = result.GetAmbiguityDistance(CurrentBasePrn);

            foreach (var prn in result.EnabledPrns)
            {
                if (prn == CurrentBasePrn)
                {
                    continue;
                }
                var floatAmbi = result.GetAmbiguityDistance(prn);  //浮点解,单位:米,是否应该需要周? no need
                var differ    = floatAmbi - baseFloatAmbi;
                wideNarrowValues.GetOrCreate(prn).FloatAmbiguityLength = differ;
            }
        }
예제 #3
0
        /// <summary>
        /// PPP 计算核心方法。 Kalmam滤波。
        /// 观测量的顺序是先伪距观测量,后载波观测量,观测量的总数为卫星数量的两倍。
        /// 参数数量为卫星数量加5,卫星数量对应各个模糊度,5为3个位置量xyz,1个接收机钟差量,1个对流程湿分量。
        /// </summary>
        /// <param name="recInfo">接收信息</param>
        /// <param name="option">解算选项</param>
        /// <param name="lastPppResult">上次解算结果(用于 Kalman 滤波),若为null则使用初始值计算</param>
        /// <returns></returns>
        public override SingleSiteGnssResult CaculateKalmanFilter(EpochInformation recInfo, SingleSiteGnssResult lastPppResult = null)
        {
            PppResult last = null;

            if (lastPppResult != null)
            {
                last = (PppResult)lastPppResult;
            }
            //  ISatWeightProvider SatWeightProvider = new SatElevateAndRangeWeightProvider();
            //ISatWeightProvider SatWeightProvider = new SatElevateWeightProvider();


            MatrixBuilder.SetMaterial(recInfo).SetPreviousProduct(lastPppResult);
            MatrixBuilder.Build();

            if (this.MatrixBuilder.ObsCount > 0)
            {
                //  this.Adjustment = new KalmanFilter( this.MatrixBuilder);
                this.Adjustment = this.RunAdjuster(BuildAdjustObsMatrix(this.CurrentMaterial));


                ////尝试固定模糊度  cuiyang 2015.07
                //int fixFlag = Ppp_AR.Process(recInfo, Adjustment);

                #region 具有条件的参数平差
                // this.Adjustment.restrictadjust();
                #endregion

                #region PPP模糊度固定
                foreach (var sat in recInfo.EnabledPrns)
                {
                    if (recInfo.SlipedPrns.Contains(sat))    //主要是针对 1.首次观测到某颗卫星 2.某颗卫星出现在第二个弧段,两个弧段的MW不相等
                    {
                        if (MwInfoDic.ContainsKey(sat))
                        {
                            MwInfoDic.Remove(sat);
                        }
                        continue;
                    }

                    if (!MwInfoDic.ContainsKey(sat))        //第一个没有周跳的历元
                    {
                        MwInfoDic[sat] = new SmoothValue(100, true)
                        {
                            Name = sat.ToString()
                        };
                    }

                    MwInfoDic[sat].Regist(recInfo[sat].Combinations.MwRangeCombination.Value);
                }

                List <int> cyclesat = new List <int>();   //将有周跳的卫星挑出来
                foreach (var sat in recInfo.SlipedPrns)
                {
                    cyclesat.Add(sat.PRN);
                }
                if (MwInfoDic.Count > 0)
                {
                    Dictionary <int, double> MWs = new Dictionary <int, double>();
                    foreach (var sat in recInfo.EnabledPrns)
                    {
                        if (!recInfo.SlipedPrns.Contains(sat))
                        {
                            int num = sat.PRN;
                            MWs.Add(num, MwInfoDic[sat].Value);    //宽巷模糊度的历元平滑值
                        }
                    }
                    IMatrix new_estimated = this.Adjustment.PppArmbiResolve(MWs, cyclesat);
                }
                #endregion



                PppResult result = new PppResult(recInfo, Adjustment, this.MatrixBuilder.GnssParamNameBuilder);
                //  result.PreviousResult = lastPppResult;

                //模糊度设置
                IonoFreeAmbiguityMgr.SetIonoFreeCombination(result);


                return(result);
            }
            else
            {
                return(null);
            }
        }