/// <summary> /// 获取GNSS类型 /// </summary> /// <param name="obsCode"></param> /// <returns></returns> public static GnssCodeType GetGnssCodeType(ObservationCode obsCode) { switch (obsCode.ObservationType) { case ObservationType.C: if (obsCode.Attribute == "C") { return(GnssCodeType.CA); } return(GnssCodeType.P); break; case ObservationType.L: return(GnssCodeType.L); break; case ObservationType.D: return(GnssCodeType.D); break; default: break; } return(GnssCodeType.CA); }
/// <summary> /// RINEX 2.x 的所有观测码相同。 /// </summary> /// <returns></returns> public List <string> GetObsCodesV2() { //如果没有Mix,则可能是rinex 2.0版本,直接赋予其它观测值给它。 var list = new List <string>(); if (ObsCodes.Count != 0) { //直接获取 foreach (var item in ObsCodes) { if (item.Value[0].Length == 2) { return(new List <string>(item.Value)); } } //其它情况 foreach (var item in ObsCodes) { foreach (var type in item.Value) { var ty = new ObservationCode(type).GetRinexCode(2); if (!list.Contains(ty)) { list.Add(ty); } } } } return(list); }
/// <summary> /// 移除对于双频无电离层组合多余的观测值 /// </summary> public void IsRemoveRedundantObsForIonoFree() { Dictionary <SatelliteType, List <string> > tobeRemoeved = new Dictionary <SatelliteType, List <string> >(); foreach (var item in ObsCodes) { var SatelliteType = item.Key; List <int> freqA = ObsCodeConvert.GetRinexFrequenceNumber(SatelliteType, FrequenceType.A); List <int> freqB = ObsCodeConvert.GetRinexFrequenceNumber(SatelliteType, FrequenceType.B); List <int> total = new List <int>(freqA); total.AddRange(freqB); var tobeRemoeved2 = new List <string>(); foreach (var kv2 in item.Value) { ObservationCode code = ObservationCode.Parse(kv2); if (!total.Contains(code.BandOrFrequency) || code.ObservationType == ObservationType.D || code.ObservationType == ObservationType.S) { tobeRemoeved2.Add(kv2); } } tobeRemoeved[SatelliteType] = tobeRemoeved2; } foreach (var toremove in tobeRemoeved) { var SatelliteType = toremove.Key; var old = ObsCodes[SatelliteType]; old.RemoveAll(item => toremove.Value.Contains(item));// = Geo.Utils.ListUtil.GetExcept(old, item.Value); } }
/// <summary> /// 相等 /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { if (!(obj is ObservationCode)) { return(false); } ObservationCode o = (ObservationCode)obj; return(BandOrFrequency == o.BandOrFrequency && Attribute == o.Attribute && ObservationType == o.ObservationType); }
/// <summary> /// CA 码修改为P码 /// </summary> /// <param name="rinexCode"></param> /// <returns></returns> internal static void ChagngeCaToP(ref ObservationCode rinexCode) { rinexCode.Attribute = DefaultAttributeOfP; }