Esempio n. 1
0
        /// <summary>
        /// fix wide-lane ambiguity
        /// </summary>
        /// <param name="receiverInfo"></param>
        /// <param name="satN1"></param>
        /// <param name="satN2"></param>
        /// <param name="NW"></param>
        /// <returns></returns>
        private int fix_amb_WL(EpochInformation receiverInfo, int satN1, int satN2, ref int NW)
        {
            double BW, vW, lam_WL = lam_LC(1, -1, 0);

            SatelliteNumber sat1 = new SatelliteNumber();
            SatelliteNumber sat2 = new SatelliteNumber();

            sat1.PRN           = satN1;
            sat1.SatelliteType = SatelliteType.G;
            sat2.PRN           = satN2;
            sat2.SatelliteType = SatelliteType.G;


            ambc_t amb1 = ambc[sat1];
            ambc_t amb2 = ambc[sat2];

            //根据Ge的论文,为避免估计偏差,不采纳观测时间小于20分钟的
            if (amb1.n[0] <= 40 || amb2.n[0] <= 40)
            {
                return(0);
            }



            //wide-lane ambiguity(以周为单位)
            BW = (amb1.LC[0] - amb2.LC[0]) / lam_WL + wlbias[sat1.PRN - 1] - wlbias[sat2.PRN - 1];



            //就近取整
            NW = (int)Math.Floor(BW + 0.5);

            double NW0 = Math.Round(BW);

            if (NW0 != NW)
            {
                //
            }


            //variance of wide-lane ambiguity
            vW = (amb1.LCv[0] / amb1.n[0] + amb2.LCv[0] / amb2.n[0]) / (lam_WL * lam_WL);



            //validation of integer wide-lane ambiguity
            if (Math.Abs(NW - BW) <= thresar2 && conffunc(NW, BW, Math.Sqrt(vW)) >= thresar1)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// average LC
        /// </summary>
        /// <param name="receiverInfo"></param>
        private void ComputeAverage_LC(EpochInformation receiverInfo)
        {
            //average LC
            ambc_t amb = new ambc_t();

            double LC1, LC2, LC3, var1, var2, var3, sig;


            foreach (var sat in receiverInfo)//分别对指定卫星进行改正
            {
                SatelliteNumber prn = sat.Prn;
                if (sat.Prn.SatelliteType != SatelliteType.G)
                {
                    continue;
                }

                LC1 = sat.Combinations.MwRangeCombination.Value; //双频

                //if (sat.FrequenceC != null)
                //{
                //    double LC11 = sat.CombinationBuilder.WideBandL1L2PhaseComb.Value - sat.CombinationBuilder.WideBandP1P2PhaseComb.Value;

                //    LC2 = sat.CombinationBuilder.WideBandL2L5PhaseComb.Value - sat.CombinationBuilder.WideBandP2P5PhaseComb.Value;

                //    LC3 = sat.CombinationBuilder.WideBandL1L2L5PhaseComb.Value - sat.CombinationBuilder.WideBandP1P2PhaseComb.Value;

                //}
                //else
                //{
                double freqA = sat.FrequenceA.Frequence.Value;
                double freqB = sat.FrequenceB.Frequence.Value;



                double valA = sat.FrequenceA.PhaseRange.CorrectedValue;
                double valB = sat.FrequenceB.PhaseRange.CorrectedValue;


                double value_lc = (freqA * valA - freqB * valB) / (freqA - freqB);


                valA = sat.FrequenceA.PseudoRange.CorrectedValue;
                valB = sat.FrequenceB.PseudoRange.CorrectedValue;
                double value_pc = (freqA * valA + freqB * valB) / (freqA + freqB);

                double LC11 = value_lc - value_pc;

                //    LC2 = 0;
                //    LC3 = 0;
                //}

                double elev    = sat.Polar.Elevation * 0.0174532925199432957692369; //  (PI/180)  AstronomicalFunctions.D2R;
                double sinElev = Math.Sin(elev);
                sig = Math.Sqrt(err1 * err1 + (err2 * err2) / (sinElev * sinElev));

                //measurement noise variance(m)
                var1 = var_LC(1, 1, 0, sig * eratio0);
                //var2 = var_LC(0, 1, 1, sig * eratio0);
                //var3 = var_LC(1, 1, 0, sig * eratio0);



                if (!ambc.ContainsKey(prn))
                {
                    ambc.Add(prn, new ambc_t());
                }

                amb = ambc[prn]; amb.prn = prn;

                if (sat.IsUnstable || amb.n[0] == 0.0 || Math.Abs(amb.epoch[0] - sat.RecevingTime) > MIN_ARC_GAP)
                {
                    amb.n[0]   = amb.n[1] = amb.n[2] = 0.0;
                    amb.LC[0]  = amb.LC[1] = amb.LC[2] = 0.0;
                    amb.LCv[0] = amb.LCv[1] = amb.LCv[2] = 0.0;
                    amb.fixcnt = 0;
                    // for (int j = 0; j < GnssConst.MaxSat; j++) amb.flags[j] = 0;
                    foreach (var sat0 in receiverInfo)//分别对指定卫星进行改正
                    {
                        if (sat0 != sat && !amb.flags.ContainsKey(sat0.Prn))
                        {
                            amb.flags.Add(sat0.Prn, 0);
                        }
                        if (sat0 != sat && amb.flags.ContainsKey(sat0.Prn))
                        {
                            amb.flags[sat0.Prn] = 0;
                        }
                    }
                }

                // for (int j = 0; j < GnssConst.MaxSat; j++) amb.flags[j] = 0;
                foreach (var sat0 in receiverInfo)//分别对指定卫星进行改正
                {
                    if (sat0 != sat && !amb.flags.ContainsKey(sat0.Prn))
                    {
                        amb.flags.Add(sat0.Prn, 0);
                    }
                }

                //averaging
                if (LC11 != null)
                {
                    amb.n[0]   += 1.0;
                    amb.LC[0]  += (LC11 - amb.LC[0]) / amb.n[0];
                    amb.LCv[0] += (var1 - amb.LCv[0]) / amb.n[0];
                }

                //if (LC2 != null)
                //{
                //    amb.n[1] += 1.0;
                //    amb.LC[1] += (LC2 - amb.LC[1]) / amb.n[1];
                //    amb.LCv[1] += (var2 - amb.LCv[1]) / amb.n[1];

                //}

                //if (LC3 != null)
                //{
                //    amb.n[2] += 1.0;
                //    amb.LC[2] += (LC3 - amb.LC[2]) / amb.n[2];
                //    amb.LCv[2] += (var3 - amb.LCv[2]) / amb.n[2];

                //}


                amb.epoch[0] = sat.RecevingTime;

                ambc[prn] = amb;
            }
        }