예제 #1
0
        public static double Prange(obs_s obs, dcb_t dcb, double[] azel, double[] var)
        {
            double PC, P1 = 0.0, P1_P2, P1_C1, gamma;
            int    prn;

            gamma = (FREQ1 * FREQ1) / (FREQ2 * FREQ2);//f1^2/f2^2
            foreach (var v in obs.type_value)
            {
                if (v.type == "C1")
                {
                    P1 = v.value; break;
                }
            }
            prn   = int.Parse(obs.sprn.Substring(1, 2));
            P1_C1 = dcb.dcbdata[prn - 1].P1_C1;
            P1_P2 = dcb.dcbdata[prn - 1].P1_P2;

            if (P1 == 0)
            {
                return(0.0);
            }
            P1    += P1_C1;
            PC     = P1 - P1_P2 / (1.0 - gamma);
            var[0] = ERR_CBIAS * ERR_CBIAS;
            return(PC);
        }
예제 #2
0
        public static int corrmens(obs_s obs, dcb_t dcb, double[] pos, double[] dantr, double[] dants,
                                   double[] phw, double[] meas, double[] var)
        {
            double c1, c2, L1 = 0.0, L2 = 0.0, P1 = 0.0, P2 = 0.0, P1_C1, gamma, lam1, lam2;
            int    i = 0, j = 1, k, sat;

            lam1  = CLIGHT / FREQ1; lam2 = CLIGHT / FREQ2;
            gamma = Math.Pow(FREQ1, 2) / Math.Pow(FREQ2, 2);
            c1    = gamma / (gamma - 1.0); /*  f1^2/(f1^2-f2^2) */
            c2    = -1.0 / (gamma - 1.0);  /* -f2^2/(f1^2-f2^2) */
            sat   = int.Parse(obs.sprn.Substring(1, 2));

            foreach (var v in obs.type_value)
            {
                if (v.type == "L1")
                {
                    L1 = v.value * lam1;
                }
                if (v.type == "L2")
                {
                    L2 = v.value * lam2;
                }
                if (v.type == "P2")
                {
                    P2 = v.value;
                }
                if (v.type == "C1")
                {
                    P1 = v.value;
                }
            }
            P1_C1 = dcb.dcbdata[sat - 1].P1_C1; //L1C/A

            if (L1 == 0.0 || L2 == 0.0 || P1 == 0.0 || P2 == 0.0)
            {
                return(0);
            }

            meas[0] = c1 * L1 + c2 * L2 - (c1 * lam1 + c2 * lam2) * phw[0];
            P1     += P1_C1;
            meas[1] = c1 * P1 + c2 * P2; //伪距IF组合
            var[1]  = Math.Pow(ERR_CBIAS, 2);

            for (k = 0; k < 2; k++)
            {
                if (dants != null)
                {
                    meas[k] -= c1 * dants[i] + c2 * dants[j];
                }
                if (dantr != null)
                {
                    meas[k] -= c1 * dantr[i] + c2 * dantr[j];
                }
            }
            return(1);
        }
예제 #3
0
        public static double gfmeas(obs_s obs)
        {
            double lam1 = CLIGHT / FREQ1, lam2 = CLIGHT / FREQ2;
            double L1 = 0.0, L2 = 0.0;

            foreach (var v in obs.type_value)
            {
                if (v.type == "L1")
                {
                    L1 = v.value;
                }
                if (v.type == "L2")
                {
                    L2 = v.value;
                }
            }
            if (L1 == 0.0 || L2 == 0.0)
            {
                return(0.0);
            }

            return(lam1 * L1 - lam2 * L2);
        }
예제 #4
0
        const double CLIGHT = 299792458.0;   /* speed of light (m/s) */

        /*读取观测值文件 支持ver 2.11*/
        public static int readobs(string path, obs_t obs, station sta)
        {
            using (StreamReader sr = new StreamReader(path))
            {
                if (readobsh(sr, obs, sta) == 1 && (sta.ver < 3 && sta.ver > 0))
                {
                    string line = "";
                    while (!sr.EndOfStream)
                    {
                        time    tcurrent = new time(); string[] sprn = new string[64];
                        rtktime rtktcur = new rtktime();
                        int     ns      = 0;                                 //每个历元观测到的卫星数
                        line = sr.ReadLine();
                        if (line != null)                                    //读取含历元时间信息和卫星数的一行
                        {
                            tcurrent = new time(line.Substring(0, 26), "o"); //读取时间信息
                            rtklibcmn.str2time(line.Substring(0, 26), rtktcur);
                            ns   = int.Parse(line.Substring(29, 3));         //读取当前历元观测到的卫星数
                            sprn = new string[ns];                           //卫星prn
                            for (int i = 0, j = 32; i < ns; i++, j += 3)
                            {
                                if (j >= 68)
                                {
                                    line = sr.ReadLine();
                                    j    = 32;
                                }
                                sprn[i] = line.Substring(j, 3);
                            }
                        }

                        for (int i = 0; i < ns; i++)//读取每个卫星相应的观测值
                        {
                            obs_s sat = new obs_s();
                            sat.t    = tcurrent;
                            sat.rtkt = rtktcur;
                            sat.sprn = sprn[i];
                            line     = sr.ReadLine();
                            for (int k = 0, j = 0; k < obs.ntype; k++, j += 16)//读取一颗卫星的所有观测值信息
                            {
                                obssat obsat = new obssat();
                                if (j >= 80)
                                {
                                    line = sr.ReadLine();
                                    j    = 0;
                                }
                                obsat.type = obs.obstype[k];
                                if (j >= line.Length)
                                {
                                    obsat.value = 0;
                                }
                                else
                                {
                                    if (line.Substring(j, 14).Trim() == "")
                                    {
                                        obsat.value = 0;
                                    }
                                    else
                                    {
                                        obsat.value = double.Parse(line.Substring(j, 14));
                                    }
                                }
                                sat.type_value.Add(obsat);
                            }
                            obs.obs_b.Add(sat);
                        }
                        obs.n += ns;
                    }
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
        }