public override BaseGnssResult BuildResult() { var result = new RangeOrbitResult(this.CurrentMaterial, Adjustment, (RangeOrbitParamNameBuilder)this.MatrixBuilder.GnssParamNameBuilder); // result.PreviousResult = this.CurrentProduct; result.BasePrn = this.CurrentBasePrn; return(result); }
public override BaseGnssResult Produce(MultiSiteEpochInfo material) { //采用导航星历计算卫星初始坐标 var ephService = GlobalNavEphemerisService.Instance; RangeOrbitResult result = null; RangeOrbitResult prevResult = null; double timeDiffer = 1; int loopCount = 0; double loopThreshold = 100 / GnssConst.LIGHT_SPEED; do { prevResult = result; foreach (var site in material) { foreach (var sat in site) { if (prevResult == null) { var emissionTime = sat.RecevingTime - sat.GetTransitTime(); var eph = ephService.Get(sat.Prn, emissionTime);//不改正相对论、钟差等 sat.Ephemeris = eph; } else { var ephResult = prevResult.EphemerisResults.Get(sat.Prn); sat.Ephemeris = ephResult.Corrected; } //卫星钟差改正,根据计算的卫星钟差改正距离 new Gnsser.Correction.SatClockBiasCorrector().Correct(sat); } //直接计算,不用改正 //EpochEphemerisSetter.ReviseEphemerisOnly(site); } double old = 0d; if (prevResult != null) { old = prevResult.MaterialObj.BaseEpochInfo.Time.Correction; } result = (RangeOrbitResult)base.Produce(material); if (prevResult != null) { timeDiffer = old - result.MaterialObj.BaseEpochInfo.Time.Correction; int ii = 0; } if (loopCount > 6) { log.Error("迭代次数达到 " + loopCount + " 次,似乎不收敛!" + timeDiffer); } loopCount++; } while (loopCount < 10 && (prevResult == null || Math.Abs(timeDiffer) > loopThreshold)); //|| prevResult. return(result); }
/// <summary> /// 非差轨道确定 /// </summary> /// <param name="Material">历元信息</param> /// <param name="ResultMatrix">平差信息</param> /// <param name="ParamNameBuilder">钟差估计器</param> /// <param name="previousResult">上一历元结果</param> public RangeOrbitResult( MultiSiteEpochInfo Material, AdjustResultMatrix ResultMatrix, RangeOrbitParamNameBuilder ParamNameBuilder, RangeOrbitResult previousResult = null) : base(Material, ResultMatrix, ParamNameBuilder) { //测站接收机钟差改正 foreach (var site in Material) { var clkName = ParamNameBuilder.GetReceiverClockParamName(site.SiteName); var val = ResultMatrix.Estimated.Get(clkName); site.Time.Correction = GetTimeCorrectionSeconds(val.Value); } //提取星历参数,可以用于改正卫星位置,进行迭代计算 EphemerisResults = new BaseDictionary <SatelliteNumber, EphemerisResult>(); foreach (var site in Material) { foreach (var sat in site) { var prn = sat.Prn; Ephemeris estimated = new Ephemeris(sat.Ephemeris.Prn, sat.Ephemeris.Time) { XyzDotRms = new XYZ() }; var clkName = ParamNameBuilder.GetSatClockParamName(prn); var val = ResultMatrix.Estimated.Get(clkName); estimated.ClockBias = GetTimeCorrectionSeconds(val.Value); estimated.ClockBiasRms = val.Rms / GnssConst.LIGHT_SPEED; var names = ParamNameBuilder.GetSatDxyz(prn); foreach (var item in names) { val = ResultMatrix.Estimated.Get(item); if (item.Contains(Gnsser.ParamNames.Dx)) { estimated.XYZ.X = val.Value; estimated.XyzDotRms.X = val.Rms; } if (item.Contains(Gnsser.ParamNames.Dy)) { estimated.XYZ.Y = val.Value; estimated.XyzDotRms.Y = val.Rms; } if (item.Contains(Gnsser.ParamNames.Dz)) { estimated.XYZ.Z = val.Value; estimated.XyzDotRms.Z = val.Rms; } } EphemerisResults[prn] = new EphemerisResult((Ephemeris)sat.Ephemeris, estimated); } } }