/// <summary> /// 读取一颗卫星的数据 /// </summary> /// <param name="line"></param> /// <returns></returns> public SP3Sat DecodeSat(string line) { SP3Sat sat = SP3Sat.New(); //// 移除多余的空格,并且按空格分割 string[] segs = StringHelper.SplitFields(line); sat.Type = segs[0][0]; sat.Prn = segs[0].Substring(1); sat.X = double.Parse(segs[1]) * 1e3; sat.Y = double.Parse(segs[2]) * 1e3; sat.Z = double.Parse(segs[3]) * 1e3; sat.C = double.Parse(segs[4]); if (segs.Length >= 9) { sat.Std[0] = int.Parse(segs[5]); sat.Std[1] = int.Parse(segs[6]); sat.Std[2] = int.Parse(segs[7]); sat.Std[3] = int.Parse(segs[8]); } return(sat); }
/// <summary> /// 读取一个历元的数据 /// </summary> /// <param name="lines"></param> /// <param name="lineNum"></param> /// <returns></returns> public SP3Epoch DecodeEpoch(string[] lines, ref int lineNum) { SP3Epoch epoch = new SP3Epoch(); epoch.Epoch = GPST.Decode(lines[lineNum].Substring(1)); Dictionary <string, SP3Sat> allSat = new Dictionary <string, SP3Sat>(); int i = lineNum + 1; for (; i < lines.Length; i++) { if (lines[i].StartsWith("*")) { break; } else if (lines[i].StartsWith("EOF")) { break; } SP3Sat sat = DecodeSat(lines[i]); epoch.AllSat.Add(sat.Prn, sat); } lineNum = i; return(epoch); }
///// <summary> ///// /satellite position/clock (ecef) (m|s) 卫星位置 ///// </summary> //public double[] pos; ///// <summary> ///// satellite position/clock std (m|s) ///// </summary> //public double[] posStd; ///// <summary> ///// satellite position covariance (m^2) ///// </summary> //public double[] posCov; ///// <summary> ///// satellite velocity/clk-rate (m/s|s/s) ///// </summary> //public double[] vel; ///// <summary> ///// satellite velocity/clk-rate std (m/s|s/s) ///// </summary> //public double[] velStd; ///// <summary> ///// satellite velocity covariance (m^2) ///// </summary> //public double[] velCov; public static SP3Sat New() { SP3Sat sat = new SP3Sat(); sat.values = new double[] { 0d, 0d, 0d, 0d }; sat.std = new double[] { 0d, 0d, 0d, 0d }; sat.cov = new double[] { 0d, 0d, 0d }; return(sat); }