/// <summary> /// 将所有产品归算到一个卫星上面。取平均。 /// </summary> /// <param name="basePrn"></param> /// <returns></returns> public FcbOfUpd GetWideLaneFcb(SatelliteNumber basePrn) { Dictionary <SatelliteNumber, RmsedNumeral> result = GetFinalFcbOfBsd(basePrn); result[basePrn] = new RmsedNumeral(0, 0); var prns = result.Keys.ToList(); prns.Sort(); //生成产品 FcbOfUpd fcb = new FcbOfUpd(); fcb.BasePrn = basePrn; fcb.WnMarker = FcbOfUpd.WideLaneMaker; fcb.Count = 32;// result.Count; fcb.Epoch = this.First.First.FirstKey.Start; //fcb.Prns = prns; int i = 0; foreach (var prn in prns) { i++; if (i > 32) { break; } fcb.Add(prn, result[prn]); } return(fcb); }
/// <summary> /// 将所有卫星产品归算到一颗卫星上面 /// </summary> /// <param name="basePrn"></param> /// <param name="maxRms"></param> /// <param name="epoch"></param> /// <returns></returns> public FcbOfUpd GetWideLaneFcbOfAllSat(SatelliteNumber basePrn, Time epoch, double maxRms) { //首先,所有的都计算一次 var prns = this.GetAllPrns(); var data = new BaseDictionary <SatelliteNumber, List <RmsedNumeral> >("数据集合", (prn) => new List <RmsedNumeral>()); foreach (var prn in prns) { //计算以当前卫星为基准的差分数据 Dictionary <SatelliteNumber, RmsedNumeral> fcbDic = GetWideLaneFcbDic(prn, epoch, maxRms); if (!fcbDic.ContainsKey(basePrn)) { continue; } // 没有基准星,则不考虑 var baseVal = fcbDic[basePrn]; //其次,归算到指定的卫星 foreach (var item in fcbDic) { var currentPrn = item.Key; var newVal = item.Value - baseVal; newVal.Value = Geo.Utils.DoubleUtil.GetRoundFraction(newVal.Value); data.GetOrCreate(currentPrn).Add(newVal); } } //加权平均 var ave = Geo.Utils.DoubleUtil.GetRoundFractionAverageValues(data); FcbOfUpd fcb = new FcbOfUpd(basePrn, epoch, ave, true); return(fcb); }
private void button_saveWLToGNSSer_Click(object sender, EventArgs e) { var service = GetFcbDataService(); var timeperiod = this.timePeriodControl1.TimePeriod; SatelliteNumber basePrn = (SatelliteNumber)this.bindingSource_basePrn.Current; var toPath = Path.Combine(Setting.TempDirectory, "WhuWLFcbToGNSSer" + Gnsser.Setting.FcbExtension); using (FcbOfUpdWriter writer = new FcbOfUpdWriter(toPath)) { var Interval = TimeSpan.FromDays(1); for (var time = timeperiod.Start.Date; time <= timeperiod.End; time += Interval) { var bsdFrac = service.GetWLFcbOfBsd(time, basePrn); if (bsdFrac != null && bsdFrac.Count > 0) { FcbOfUpd fcbOfUpd = new FcbOfUpd(basePrn, time, true); foreach (var kv in bsdFrac.KeyValues) { fcbOfUpd.Add(kv.Key, kv.Value); } if (fcbOfUpd.DataCount > 0) { writer.Write(fcbOfUpd); } } } } Geo.Utils.FormUtil.ShowOkAndOpenDirectory(Setting.TempDirectory); }
private void button_saveToGnsserFcb_Click(object sender, EventArgs e) { var service = GetFcbDataService(); var timeperiod = this.timePeriodControl1.TimePeriod; SatelliteNumber basePrn = (SatelliteNumber)this.bindingSource_basePrn.Current; var Interval = TimeSpan.FromMinutes(15); var toPath = Path.Combine(Setting.TempDirectory, "WhuNLFcbToGNSSer" + Gnsser.Setting.FcbExtension); using (FcbOfUpdWriter writer = new FcbOfUpdWriter(toPath)) { for (var time = timeperiod.Start; time <= timeperiod.End; time += Interval) { FcbOfUpd fcbOfUpd = new FcbOfUpd(basePrn, time, false); foreach (var prn in SatelliteNumber.DefaultGpsPrns) { var bsdFrac = service.GetNLFcbOfBsdValue(time, prn, basePrn); if (bsdFrac != null) { fcbOfUpd.Add(prn, bsdFrac); } } if (fcbOfUpd.DataCount > 0) { writer.Write(fcbOfUpd); } } } Geo.Utils.FormUtil.ShowOkAndOpenDirectory(Setting.TempDirectory); }
private void button_convertToGnsserFcb_Click(object sender, EventArgs e) { var basePrn = baseSatSelectingControl1.SelectedPrn; if (basePrn.SatelliteType != SatelliteType.G) { MessageBox.Show("请选择GPS系统!目前似乎还不支持其它系统,如果支持了请尝试高版本先,若还没有请 Email To: [email protected]"); return; } var toPath = Path.Combine(Setting.TempDirectory, "FcbOfDcb" + Gnsser.Setting.FcbExtension); FcbOfUpdWriter writer = new FcbOfUpdWriter(toPath); var period = this.timePeriodControl1.TimePeriod; var path = this.fileOpenControlOpath.FilePath; WideLaneBiasService = new WideLaneBiasService(path); for (var time = period.Start.Date; time <= period.End; time += TimeSpan.FromDays(1)) { var data = WideLaneBiasService.Get(time); if (data == null) { continue; } FcbOfUpd fcb = new FcbOfUpd(basePrn, data); writer.Write(fcb); } writer.Dispose(); Geo.Utils.FormUtil.ShowOkAndOpenDirectory(Setting.TempDirectory); }
private FcbOfUpdWriter WriteFinal(FcbOfUpd bsdProduct) { //写最终FCB 产品 var fcbPath = Path.Combine(this.OutputDirectory, "FcbProduct" + Setting.FcbExtension); FcbOfUpdWriter writer = new FcbOfUpdWriter(fcbPath); writer.Write(bsdProduct); writer.Dispose(); return(writer); }
/// <summary> /// 当前历元产品,为所在时段的平均。 /// </summary> /// <param name="basePrn">基准星</param> /// <param name="epoch">历元</param> /// <returns></returns> public FcbOfUpd GetWideLaneFcb(SatelliteNumber basePrn, Time epoch, double maxRms = 0.6) { //获取各测站内部差值。 Dictionary <SatelliteNumber, RmsedNumeral> result = GetWideLaneFcbDic(basePrn, epoch, maxRms); if (result.Count == 0) { return(null); } FcbOfUpd fcb = new FcbOfUpd(basePrn, epoch, result); return(fcb); }
/// <summary> /// 将所有卫星产品归算到一颗卫星上面。 /// </summary> /// <param name="basePrn"></param> /// <param name="intervalSeconds"></param> /// <param name="maxRms"></param> /// <returns></returns> public List <FcbOfUpd> GetWideLaneFcbOfAllSatAverage(SatelliteNumber basePrn, double intervalSeconds = 30, double maxRms = 0.6) { var timePeriod = this.TimePeriod; var list = new List <FcbOfUpd>(); for (Time epoch = timePeriod.Start; epoch <= timePeriod.End; epoch += intervalSeconds) { FcbOfUpd fcb = GetWideLaneFcbOfAllSat(basePrn, epoch, maxRms); list.Add(fcb); } return(list); }
/// <summary> /// 获取产品 /// </summary> /// <param name="basePrn">基准卫星,并不做计算,只是赋值</param> /// <returns></returns> public List <FcbOfUpd> GetFcbProduct(SatelliteNumber basePrn, double maxRms = 0.6) { List <FcbOfUpd> result = new List <FcbOfUpd>(); foreach (var epcochRow in this.Data) { var resultItem = new FcbOfUpd(basePrn, epcochRow.Key, false); result.Add(resultItem); foreach (var item in epcochRow.Value.KeyValues) { if (item.Value.Rms > maxRms) { continue; } resultItem.Add(item.Key, item.Value); } } return(result); }