/// <summary> /// 获取模糊度参数估计结果。单位为周,权逆阵单位依然为米。 /// </summary> /// <returns></returns> public WeightedVector GetFixableVectorInUnit() { this.ResultMatrix.Estimated.ParamNames = this.ResultMatrix.ParamNames; //Lamdba方法计算模糊度 var ambiParamNames = new List <string>(); foreach (var name in ResultMatrix.ParamNames) { if (HasUnstablePrn(name)) { continue; } if (name.Contains(Gnsser.ParamNames.DoubleDifferAmbiguity)) { ambiParamNames.Add(name); } } var estVector = this.ResultMatrix.Estimated.GetWeightedVector(ambiParamNames); if (Option.IsPhaseInMetterOrCycle) { //更新模糊度。 Frequence Frequence = Gnsser.Frequence.GetFrequence(this.BasePrn, Option.ObsDataType, this.Material.ReceiverTime); var vectorInCycle = estVector * (1.0 / Frequence.WaveLength); return(vectorInCycle); } return(estVector); }
/// <summary> /// 针对某一个卫星绘制 /// </summary> /// <param name="prn"></param> /// <returns></returns> private ObjectTableStorage BuildObjectTable(SatelliteNumber prn) { bool isCarrierInLen = checkBox_carrrierInLen.Checked; bool isShowL1Only = checkBox_showL1Only.Checked; List <TimedRinexSatObsData> records = ObsFile.GetEpochTimedObservations(prn); ObjectTableStorage table = new ObjectTableStorage(); foreach (var record in records) { table.NewRow(); table.AddItem("Epoch", record.Time); foreach (var item in record.SatObsData) { if (isShowL1Only && !item.Key.Contains("1")) { continue; } if (isCarrierInLen && item.Key.Contains("L1")) { var freq = Frequence.GetFrequence(prn, FrequenceType.A, record.Time); table.AddItem(item.Key, item.Value.Value * freq.WaveLength); } else if (isCarrierInLen && item.Key.Contains("L2")) { var freq = Frequence.GetFrequence(prn, FrequenceType.B, record.Time); table.AddItem(item.Key, item.Value.Value * freq.WaveLength); } else { table.AddItem(item.Key, item.Value.Value); } } } return(table); }
public MultiPathSolver(SatelliteType SatelliteType) { this.SatelliteType = SatelliteType; FrequenceA = Frequence.GetFrequenceA(SatelliteType); FrequenceB = Frequence.GetFrequenceB(SatelliteType); CoeefOfIono = Math.Pow(FrequenceA.Value / FrequenceB.Value, 2.0); }
/// <summary> /// 观测量构造函数。 /// </summary> /// <param name="phaseValue">相位观测值</param> /// <param name="Frequence">频率</param> public PhaseRangeObservation(RinexObsValue phaseValue, Frequence Frequence) : base(phaseValue.Value * Frequence.WaveLength, phaseValue.ObservationCode) { this.Frequence = Frequence; this.RawPhaseValue = phaseValue.Value; this.LossLockIndicator = phaseValue.LossLockIndicator; this.SignalStrength = phaseValue.SignalStrength; }
public static Frequence KycGetIonoFreeComPhaseFrequence(Frequence bandA, Frequence bandB) { //频率采用相位组合 var factors = KycGetIonoFreeRangeCombFactors(bandA, bandB); string name = bandA.Name + bandB.Name + "_IonoFree"; return(GetCompositFreqence(factors[0], bandA, factors[1], bandB, name)); }
/// <summary> /// 通用构造函数 /// </summary> /// <param name="band">频率</param> /// <param name="FrequenceType">频率类型</param> public FreqenceObservation(Frequence band, FrequenceType FrequenceType) { this.FrequenceType = FrequenceType; this.Frequence = band; this.CommonCorrection = new NumerialCorrectionDic(); this.PhaseOnlyCorrection = new NumerialCorrectionDic(); this.RangeOnlyCorrection = new NumerialCorrectionDic(); this.Enabled = true; this.Message = ""; }
public void Init() { /// 第一频率 Frequence f1 = Frequence.GetFrequence(BasePrn.SatelliteType, 1); /// 第二频率 Frequence f2 = Frequence.GetFrequence(BasePrn.SatelliteType, 2); this.FloatAmbiguityL1CycleMultiFactor = (f1.Value + f2.Value) / f1.Value; this.FloatAmbiguityLenMultiFactor = (f1.Value + f2.Value) * 1e6 / GnssConst.LIGHT_SPEED; this.WideLaneMultiFactor = f2.Value / (f1.Value - f2.Value); }
/// <summary> /// 指定系统的无电离层组合 /// </summary> /// <param name="type">系统类型</param> /// <param name="name"></param> /// <returns></returns> public static Frequence GetIonoFreeCompositBandThreeFrequency(EpochSatellite sat, string name = null) { double[] facs = GetIonoFreeCombFactorsThreeFrequency(sat); Frequence bandA = sat.FrequenceA.Frequence; // Frequence.GetFrequenceA(sat.Prn, sat.ReceiverTime); Frequence bandB = sat.FrequenceA.Frequence; // Frequence.GetFrequenceB(sat.Prn, sat.ReceiverTime); Frequence bandC = sat.FrequenceA.Frequence; // Frequence.GetFrequenceC(sat.Prn, sat.ReceiverTime); name = name ?? sat + "_" + bandA.Name + bandB.Name + bandC.Name + "_IonoFree"; return(GetCompositFreqenceBandThreeFrequency(facs[0], bandA, facs[1], bandB, facs[2], bandC, name)); }
/// <summary> /// 提供便捷的AB频率无电离层组合。 /// </summary> /// <param name="rangeA">伪距或载波距离</param> /// <param name="rangeB">伪距或载波距离</param> /// <param name="prn"></param> /// <param name="receiverTime"></param> /// <returns></returns> public static double GetIonoFreeRangeValue(double rangeA, double rangeB, SatelliteNumber prn, Time receiverTime) { var A = Frequence.GetFrequenceA(prn, receiverTime); var B = Frequence.GetFrequenceB(prn, receiverTime); double[] facs = GetIonoFreeRangeCombFactors(A, B); double fac1 = facs[0]; double fac2 = facs[1]; double range = GetCombinationValue(fac1, rangeA, fac2, rangeB); return(range); }
/// <summary> /// 3个频率组成新的频率。 /// </summary> /// <param name="factorA"></param> /// <param name="bandA"></param> /// <param name="factorB"></param> /// <param name="bandB"></param> /// <param name="factorC"></param> /// <param name="bandC"></param> /// <param name="name"></param> /// <returns></returns> public static Frequence GetCompositFreqenceBandThreeFrequency(double factorA, Frequence bandA, double factorB, Frequence bandB, double factorC, Frequence bandC, string name = null) { double frequence = (factorA * bandA.Value + factorB * bandB.Value + factorC * bandC.Value);// / (factorA + factorB); // double frequence = bandA.Freqence + bandB.Freqence; name = name ?? bandA.Name + "(" + factorA.ToString("0.00") + ")" + "_" + bandB.Name + "(" + factorB.ToString("0.00") + ")" + "_" + bandC.Name + "(" + factorC.ToString("0.00") + ")"; Frequence band = new Frequence(name, frequence); return(band); }
/// <summary> /// 两个频率的无电离层组合参数。适用于距离组合计算。 /// 含伪距距离,也包含载波对应的距离。 /// 若是GPS L1 和 L2 ,数值为 2.54 和 -1.54 /// </summary> /// <param name="A">频率A</param> /// <param name="B">频率B</param> /// <returns></returns> public static double[] GetIonoFreeRangeCombFactors(Frequence A, Frequence B) { double f1 = A.Value; double f2 = B.Value; double f1_2 = f1 * f1; double f2_2 = f2 * f2; double down = (f1_2 - f2_2); double factor1 = f1_2 / down; double factor2 = 1 - factor1; //已标准化,相加为 1. return(new double[] { factor1, factor2 }); }
/// <summary> /// 获取无电离层组合量,双频无电离层距离组合,返回已改正后的值。s /// </summary> /// <param name="type1"></param> /// <param name="type2"></param> /// <param name="isPsuedoOrPhaseRange">是否伪距或相位距离</param> /// <returns></returns> public PhaseCombination GetIonoFreeRangeOf(FrequenceType type1, FrequenceType type2, bool isPsuedoOrPhaseRange) { var freA = EpochSat[type1]; var freB = EpochSat[type2]; Frequence A = freA.Frequence; Frequence B = freB.Frequence; Frequence freqence = GetIonoFreeComPhaseFrequence(A, B); double rangeA = 0; double rangeB = 0; if (isPsuedoOrPhaseRange) { rangeA = freA.PseudoRange.CorrectedValue; rangeB = freB.PseudoRange.CorrectedValue; } else { rangeA = freA.PhaseRange.CorrectedValue; rangeB = freB.PhaseRange.CorrectedValue; } if (rangeA == 0) { if (rangeB == 0) { log.Debug(this.EpochSat.Prn + ", " + this.EpochSat.ReceiverTime + ", 载波 “" + type1 + "”和载波 “" + type2 + "”的" + (isPsuedoOrPhaseRange?"伪距":"载波") + "都为 0 。"); return(new PhaseCombination(0, freqence)); throw new ArgumentNullException("载波 1 和载波 2 的伪距都为 0 。"); } else { return(new PhaseCombination(rangeB, freqence)); } } else if (rangeB == 0) { return(new PhaseCombination(rangeA, freqence)); } double[] facs = GetIonoFreeRangeCombFactors(A, B); double fac1 = facs[0]; double fac2 = facs[1]; double range = GetCombinationValue(fac1, rangeA, fac2, rangeB); //伪距也用组合 var val = new PhaseCombination(range, freqence); return(val); }
/// <summary> /// 2015.1.9 ,崔阳, 增加 以周为单位的无电离层组合的系数,只有以周为单位才能计算波长!!!! /// 载波线性组合法的两个参数。 m和n。 P = m * p1 + n * p2. /// 系统前两个频率的无电离层组合系数。对于北斗是 L1=E2,L2=E6的组合。 /// 相位组合(以周为单位). /// 备注:这是以轴为单位的组合。 /// 整周未知数的系数,组合值为加号。 /// 分解为:N1 和 delta N = N1 - N2。 /// 见李征航 GPS测量数据处理 P101。 /// 若是GPS L1 和 L2,数值为 2.54 和 -1.98 /// </summary> /// <param name="bandA">频率1</param> /// <param name="bandB">频率2</param> /// <returns></returns> public static double[] GetIonoFreePhaseCycleCombFactors(Frequence bandA, Frequence bandB) { double f1 = bandA.Value; double f2 = bandB.Value; double f1_2 = f1 * f1; double f2_2 = f2 * f2; double down = (f1_2 - f2_2); double factor1 = f1_2 / down; double factor2 = -f1 * f2 / down;//以周为单位的载波系数,只有以周为单位的观测值才存在波长。 //与距离组合存在着 f1/f2 的关系 // double factor2 = 1 - factor1; //已标准化,相加为 1. return(new double[] { factor1, factor2 }); }
/// <summary> /// 无电离层组合频率,参加许老师《GPS理论算法与应用》P85 /// </summary> /// <param name="A"></param> /// <param name="B"></param> /// <returns></returns> public static Frequence GetIonoFreeFrequence(Frequence A, Frequence B) { return(A); double f1 = A.Value * 1e6; double f2 = B.Value * 1e6; double f1_2 = f1 * f1; double f2_2 = f2 * f2; double newFreqValue = GnssConst.LIGHT_SPEED / (f1_2 - f2_2) / 1e6; var freq = new Frequence("IonoFreeOf" + A + "_" + B, newFreqValue); return(freq); }
private void BufferStream_MaterialInputted(TimedRinexSatObsData record) { SatelliteNumber prn = (SatelliteNumber)this.bindingSource_sat.Current; var smootherP1 = PhaseSmoothRangeBulider.GetOrCreate("P1"); var time = record.Time; var data = record.SatObsData; var waveLenL1 = Frequence.GetFrequence(prn.SatelliteType, 1).WaveLength; var waveLenL2 = Frequence.GetFrequence(prn.SatelliteType, 2).WaveLength; double L1 = data.PhaseA.Value * waveLenL1; double P1 = data.RangeA.Value; smootherP1.SetBufferValue(record.Time, P1, L1); }
/// <summary> /// 获取电离层格网模型延迟 /// </summary> /// <param name="sat"></param> /// <param name="frequenceType"></param> /// <param name="IonoService"></param> /// <returns></returns> public static double GetGridModelCorrection(EpochSatellite sat, FrequenceType frequenceType, IIonoService IonoService) { //计算穿刺点获取电离层浓度 var punctPoint = sat.GetIntersectionXyz(IonoService.HeightOfModel); var geocentricLonLat = Geo.Coordinates.CoordTransformer.XyzToSphere(punctPoint); var tec = IonoService.GetSlope(sat.ReceiverTime, geocentricLonLat, sat.SphereElevation); if (tec == null || tec.Value == 0) { return(0); } Frequence freq = sat[frequenceType].Frequence; double slopeDelayFreqA = 1.0 * GetIonoDelayRange(tec.Value, freq.Value);//斜方向延迟 return(slopeDelayFreqA); }
/// <summary> /// 双差差分定位结果。具有模糊度。 /// </summary> /// <param name="epochInfo">历元观测信息</param> /// <param name="PointPositionType">单点定位类型</param> public EpochDouFreDoubleDifferPositionResult( MultiSiteEpochInfo receiverInfo, AdjustResultMatrix Adjustment, GnssParamNameBuilder positioner, SatelliteNumber baseSatPrn, int baseParamCount = 5 ) : base(receiverInfo, Adjustment, positioner) { this.BasePrn = baseSatPrn; int index = Adjustment.GetIndexOf(Gnsser.ParamNames.WetTropZpd); if (index != -1) { this.WetTropoFactor = this.ResultMatrix.Corrected.CorrectedValue[Adjustment.GetIndexOf(Gnsser.ParamNames.WetTropZpd)]; } else { this.WetTropoFactor = 0.0; } //处理模糊度 this.AmbiguityDic = new Dictionary <SatNumberAndFrequence, double>(); Vector vector = Adjustment.Corrected.CorrectedValue; int satIndex = 0; foreach (var item in receiverInfo.EnabledPrns) { if (item != BasePrn) { Frequence FrequenceA = Frequence.GetFrequence(this.BasePrn, SatObsDataType.PhaseRangeA, receiverInfo.ReceiverTime); Frequence FrequenceB = Frequence.GetFrequence(this.BasePrn, SatObsDataType.PhaseRangeB, receiverInfo.ReceiverTime); SatNumberAndFrequence satA = new SatNumberAndFrequence(); satA.SatNumber = item; satA.Frequence = FrequenceA; SatNumberAndFrequence satB = new SatNumberAndFrequence(); satB.SatNumber = item; satB.Frequence = FrequenceB; double val = vector[satIndex]; AmbiguityDic.Add(satA, val); AmbiguityDic.Add(satB, val); satIndex++; } } }
/// <summary> /// 单频平滑伪距 /// </summary> /// <param name="prn"></param> /// <param name="PhaseSmoothRangeBulider"></param> /// <param name="records"></param> private void SingleFreqPhaseSmoothRange(SatelliteNumber prn, NamedCarrierSmoothedRangeBuilderManager PhaseSmoothRangeBulider, List <TimedRinexSatObsData> records) { ObjectTableStorage table = new ObjectTableStorage(); foreach (var record in records) { table.NewRow(); table.AddItem("Epoch", record.Time); var data = record.SatObsData; var waveLenL1 = Frequence.GetFrequence(prn.SatelliteType, 1).WaveLength; var waveLenL2 = Frequence.GetFrequence(prn.SatelliteType, 2).WaveLength; double L1 = data.PhaseA.Value * waveLenL1; double P1 = data.RangeA.Value; double L2 = data.PhaseB != null ? record.SatObsData.PhaseB.Value * waveLenL2 : 0; double P2 = data.RangeB != null ? record.SatObsData.RangeB.Value : 0; var smootherP1 = PhaseSmoothRangeBulider.GetOrCreate("P1"); var smootherP2 = PhaseSmoothRangeBulider.GetOrCreate("P2"); var P1s = smootherP1 .SetReset(data.PhaseA.IsLossLock) .SetRawValue(record.Time, P1, L1, 0) .Build().Value; table.AddItem("P1", P1); table.AddItem("P1S", P1s); if (data.PhaseB != null) { var P2s = smootherP2 .SetReset(data.PhaseB.IsLossLock) .SetRawValue(record.Time, P2, L2, 0) .Build().Value; table.AddItem("P2", P2); //table.AddItem("P1S_old", P1s); table.AddItem("P2S", P2s); } } BindDataSource(table); }
/// <summary> /// 获取模糊度参数估计结果。单位为周,权逆阵单位依然为米。 /// </summary> /// <returns></returns> public WeightedVector GetFixableVectorInUnit22() { this.ResultMatrix.Estimated.ParamNames = this.ResultMatrix.ParamNames; //Lamdba方法计算模糊度 var ambiParamNames = new List <string>(); foreach (var name in ResultMatrix.ParamNames) { if (HasUnstablePrn(name)) { continue; } if (name.Contains(Gnsser.ParamNames.DoubleDifferAmbiguity)) { ambiParamNames.Add(name); } } var estVector = this.ResultMatrix.Estimated.GetWeightedVector(ambiParamNames); if (Option.IsPhaseInMetterOrCycle) { //更新模糊度单位,前一半为L1,后一半为L2 Frequence Frequence1 = Gnsser.Frequence.GetFrequence(this.BasePrn, FrequenceType.A, this.Material.ReceiverTime); Frequence Frequence2 = Gnsser.Frequence.GetFrequence(this.BasePrn, FrequenceType.B, this.Material.ReceiverTime); int i = 0; int half = estVector.Count / 2; foreach (var item in estVector) { double len = Frequence1.WaveLength; if (i >= half) { len = Frequence2.WaveLength; } estVector[i] = estVector[i] * (1.0 / len); i++; } //log.Warn("此处前一半和后一半频率应该分开计算。"); return(estVector); } return(estVector); }
/// <summary> /// Foramt frequence /// </summary> /// <param name="frequence"></param> /// <returns></returns> private static String GetFrequence(Frequence frequence) { switch (frequence) { case Frequence.Always: { return("always"); } case Frequence.Daily: { return("daily"); } case Frequence.Hourly: { return("hourly"); } case Frequence.Monthly: { return("monthly"); } case Frequence.Never: { return("never"); } case Frequence.Weekly: { return("weekly"); } case Frequence.Yearly: { return("yearly"); } default: { return("always"); } } }
/// <summary> /// kyc:双频载波相位平滑伪距中两个频率的无电离层组合参数。适用于距离组合计算。 /// 含伪距距离,也包含载波对应的距离。 /// </summary> /// <param name="A"></param> /// <param name="B"></param> /// <returns></returns> public static double[] KycGetIonoFreeRangeCombFactors(Frequence A, Frequence B) { double f1 = A.Value; double f2 = B.Value; double f1_2 = f1 * f1; double f2_2 = f2 * f2; double down = (f1_2 - f2_2); //kyc :双频载波相位平滑伪距 double factor1 = 1 + 2 * f2_2 / down; double factor2 = -2 * f2_2 / down;//P1 //double factor1 = 2 + 2 * f2_2 / down; //double factor2 = -1-2 * f2_2 / down;//P2 return(new double[] { factor1, factor2 }); }
public ChartOption() { Fq = Frequence.High; Side = ShowSide.Both; AutoTVG = true; FreezeTVG =true; TVG = 1; Gain = 9; Gamma = 1; PortA =50; PortB = 50; PortC = 50; StarboardA = 50; StarboardB = 50; StarboardC = 50; StartColor = Color.Black; EndColor = Color.Gold; RawMax = 8192; bShowRangeLine = true; }
public ChartOption() { Fq = Frequence.High; Side = ShowSide.Both; AutoTVG = true; FreezeTVG = true; TVG = 1; Gain = 9; Gamma = 1; PortA = 50; PortB = 50; PortC = 50; StarboardA = 50; StarboardB = 50; StarboardC = 50; StartColor = Color.Black; EndColor = Color.Gold; RawMax = 8192; bShowRangeLine = true; }
/// <summary> /// 以制表位为分隔符的元素标题。 /// </summary> /// <returns></returns> public string GetTabTitles() { StringBuilder sb = new StringBuilder(); sb.Append(Frequence.ToString() + "伪距"); sb.Append(PseudoRange.GetTabTitles()); sb.Append("\t"); sb.Append(Frequence.ToString() + "载波"); sb.Append(PhaseRange.GetTabTitles()); if (CommonCorrection.Count > 1) { sb.Append("\t"); sb.Append(this.CommonCorrection.GetTabTitles()); } if (PhaseOnlyCorrection.Count > 1) { sb.Append("\t"); sb.Append(this.PhaseOnlyCorrection.GetTabTitles()); } return(sb.ToString()); }
/// <summary> /// 双频载波距离组合生成,返回相位组合,单位为米,如LI组合等。 /// </summary> /// <param name="epochSat">卫星</param> /// <param name="factor1">系数</param> /// <param name="factor2">系数</param> /// <param name="name">名称</param> /// <returns></returns> public static PhaseCombination GetDoublePhaseRangeCombination(EpochSatellite epochSat, double factor1, double factor2, string name = "") { if (epochSat.FrequencyCount < 2) { throw new Exception("频率数量必须大于等于2!" + epochSat.SiteInfo.SiteName + ", " + epochSat); } if (name == "") { name = epochSat.Prn.SatelliteType + "_" + factor1 + "_" + factor2; } //距离系数和载波相位系数能不能一样??????????是一个问题。2018.09.01,czs, hmx, Frequence freqence = GetDoubleCompositFreqence(epochSat, factor1, factor2, name); double valA = epochSat.FrequenceA.PhaseRange.Value; double valB = epochSat.FrequenceB.PhaseRange.Value; double value = GetCombinationValue(factor1, valA, factor2, valB); return(new PhaseCombination(value, freqence)); }
/// <summary> /// 检查并初始化 /// </summary> /// <param name="prn"></param> /// <param name="time">用于计算频率,非GLO可以忽略</param> /// <param name="isCycleAmbi">模糊度单位是否为周</param> /// <param name="forceToInit">强制初始化,GLO系统适用,也可以手动指定</param> public void CheckOrInit(SatelliteNumber prn, Time time, bool isCycleAmbi, bool forceToInit = false) { if (prn.SatelliteType == SatelliteType.R) { forceToInit = true; } if (!IsInited || forceToInit) { this.Time = time; this.IsCycleOrMeterOfAmbiUnit = isCycleAmbi; var freq1 = Frequence.GetFrequenceA(prn, time); FreqA = freq1.Value; WaveLengthOfL1 = freq1.WaveLength; FreqB = Frequence.GetFrequenceB(prn, time).Value; WaveLenOfWideLane = Frequence.GetMwFrequence(prn, time).WaveLength; WaveLenOfNarrowLane = Frequence.GetNarrowLaneFrequence(prn, time).WaveLength; tempCoeef = FreqB / (FreqA + FreqB); //算法1 tempCoeef2 = (FreqA + FreqB) * 1e6 / GnssConst.LIGHT_SPEED; //算法2:单位转换,窄巷波长的倒数 tempCoeef3 = FreqB / (FreqA - FreqB); //算法2 IsInited = true; } }
/// <summary> /// 观测量构造函数。 /// </summary> /// <param name="rawPhaseValue">相位观测值</param> /// <param name="Frequence">频率</param> /// <param name="ObservationCode"></param> /// <param name="LossLockIndicator"></param> /// <param name="SignalStrength"></param> public PhaseRangeObservation(double rawPhaseValue, ObservationCode ObservationCode, Frequence Frequence, int SignalStrength = 50, LossLockIndicator LossLockIndicator = LossLockIndicator.OK) : base(rawPhaseValue * Frequence.WaveLength, ObservationCode) { this.Frequence = Frequence; this.RawPhaseValue = rawPhaseValue; this.LossLockIndicator = LossLockIndicator; this.SignalStrength = SignalStrength; }
/// <summary> /// 设置Frequence /// </summary> /// <param name="Frequence"></param> /// <returns></returns> public RinexFreqObsBuilder SetFrequence(Frequence Frequence) { this.Frequence = Frequence; return(this); }
private void button_smoothCurrent_Click(object sender, EventArgs e) { EnableRunButton(false); CheckAndReadObsFile(); ObjectTableManager tableObjectStorages; ObjectTableStorage IonoFitTable; tableObjectStorages = new ObjectTableManager(Setting.TempDirectory); IonoFitTable = tableObjectStorages.AddTable("IonoFit"); DateTime start = DateTime.Now; int bufferSize = namedIntControl_bufferCount.GetValue(); bool isShowPoly = checkBox_showPoly.Checked; PhaseSmoothRangeBulider = BuildPhaseSmoothRangeBulider(); int smoothWindow = this.namedIntControl_smoothWindow.GetValue(); double cutOff = namedFloatControl_satCutoff.GetValue(); bool isShowL1Only = checkBox_isShowL1Only.Checked; SatelliteNumber prn = (SatelliteNumber)this.bindingSource_sat.Current; GlobalIgsGridIonoService ionoService = GlobalIgsGridIonoService.Instance; GlobalIgsGridIonoDcbService ionoDcbService = GlobalIgsGridIonoDcbService.Instance; GlobalIgsEphemerisService ephemerisService = GlobalIgsEphemerisService.Instance; var TimedSmoothValueBuilderManager = new TimedSmoothValueBuilderManager(smoothWindow); List <TimedRinexSatObsData> records = ObsFile.GetEpochTimedObservations(prn); ObjectTableStorage table = new ObjectTableStorage(prn + "_平滑伪距"); var firtTime = records[0].Time; double P1_P2sat = ionoDcbService.GetDcb(firtTime, prn).Value *GnssConst.MeterPerNano; double P1_P2recMeter = ionoDcbService.GetDcbMeterForP1(firtTime, Path.GetFileName(ObsPath).Substring(0, 4).ToLower()); var siteXyz = ObsFile.Header.ApproxXyz; double prevIonoAmbiDcb = 0; double prevIonoAmbiDcbL2 = 0; RinexFreqObsBuilder FreqObsBuilder = new RinexFreqObsBuilder(); var epochSatBuilder = new RinexEpochSatBuilder(FreqObsBuilder); progressBarComponent1.InitProcess(records.Count); BufferedStreamService <TimedRinexSatObsData> bufferStream = new BufferedStreamService <TimedRinexSatObsData>(records, bufferSize); bufferStream.MaterialInputted += BufferStream_MaterialInputted; foreach (var record in bufferStream) { if (record == null) { continue; } progressBarComponent1.PerformProcessStep(); var time = record.Time; var data = record.SatObsData; var eph = ephemerisService.Get(prn, time); if (eph == null) { continue; } var satXyz = eph.XYZ; var polar = Geo.Coordinates.CoordTransformer.XyzToGeoPolar(satXyz, siteXyz, AngleUnit.Degree); if (polar.Elevation < cutOff) { continue; } var waveLenL1 = Frequence.GetFrequence(prn, FrequenceType.A, time).WaveLength; var waveLenL2 = Frequence.GetFrequence(prn, FrequenceType.B, time).WaveLength; double L1 = data.PhaseA.Value * waveLenL1; double P1 = data.RangeA.Value; double L2 = data.PhaseB != null ? record.SatObsData.PhaseB.Value * waveLenL2 : 0; double P2 = data.RangeB != null ? record.SatObsData.RangeB.Value : 0; //扩展 var sat = epochSatBuilder.SetPrn(record.SatObsData.Prn).Build(record.SatObsData); // get => (this.FrequenceA.PhaseRange.Value - this.FrequenceB.PhaseRange.Value) * Frequence.GetIonoAndDcbCoeffL1L2(this.Prn.SatelliteType); //double differIonoL1 = 0; //double differIonoL2 = 0; //if (prevIonoAmbiDcb == 0) //{ // prevIonoAmbiDcb = sat.IonoLenOfL1ByDifferL1L2; // prevIonoAmbiDcbL2 = sat.IonoLenOfL2ByDifferL1L2; //} //differIonoL1 = sat.IonoLenOfL1ByDifferL1L2 - prevIonoAmbiDcb; //differIonoL1 = sat.IonoLenOfL1ByDifferL1L2 - prevIonoAmbiDcb; // L1 = L1 + 2 * differIono; #region 载波相位平滑伪距 var smootherP1 = PhaseSmoothRangeBulider.GetOrCreate("P1"); var smootherP2 = PhaseSmoothRangeBulider.GetOrCreate("P2"); var P1s = smootherP1 .SetReset(data.PhaseA.IsLossLock) .SetRawValue(record.Time, P1, L1, sat.IonoLenOfL1ByDifferL1L2) .Build().Value; IonoFitTable.NewRow(); IonoFitTable.AddItem("Epoch", time); IonoFitTable.AddItem("FittedIonoAndAmbiValue", smootherP1.CurrentRaw.FittedIonoAndAmbiValue); //var test = TestSmoothRangeBuilder.GetOrCreate("Test") // .SetReset(data.PhaseA.IsLossLock) // .SetRawValue(record.Time, P1, L1) // .Build().Value; //var differ = test - P1s; //int iii = 0; var P2s = 0.0; if (!isShowL1Only) { P2s = smootherP2 .SetReset(data.PhaseB.IsLossLock) .SetRawValue(record.Time, P2, L2, sat.IonoLenOfL2ByDifferL1L2) .Build().Value; } #endregion //二次多项式平滑比较 var lsSP1Smoother = TimedSmoothValueBuilderManager.GetOrCreate("P1"); var lsSP2Smoother = TimedSmoothValueBuilderManager.GetOrCreate("P2"); double lsSP1 = 0, lsSP2 = 0; if (isShowPoly) { foreach (var item in bufferStream.MaterialBuffers) { lsSP1Smoother.SetRawValue(item.Time, item.SatObsData.RangeA.Value); lsSP2Smoother.SetRawValue(item.Time, item.SatObsData.RangeB.Value); } if (data.PhaseA.IsLossLock) { lsSP1 = P1; lsSP1Smoother.SetReset(data.PhaseA.IsLossLock); } else { lsSP1 = lsSP1Smoother.SetReset(data.PhaseA.IsLossLock) .SetRawValue(time, P1) .SetSmoothTime(time) .Build(); } if (data.PhaseB.IsLossLock) { lsSP2 = P2; lsSP2Smoother.SetReset(data.PhaseB.IsLossLock); } else { lsSP2 = lsSP2Smoother.SetReset(data.PhaseB.IsLossLock) .SetRawValue(time, P2) .SetSmoothTime(time) .Build(); } } table.NewRow(); table.AddItem("Epoch", record.Time); //table.AddItem("L1", L1); //table.AddItem("L2", L2); table.AddItem("P1", P1); if (!isShowL1Only) { table.AddItem("P2", P2); } table.AddItem("P1S", P1s); if (!isShowL1Only && isShowPoly) { table.AddItem("P2S", P2s); } if (isShowPoly) { table.AddItem("LsP1S", lsSP1); } if (!isShowL1Only) { table.AddItem("LsP2S", lsSP2); } } progressBarComponent1.Full(); BindDataSource(table); EnableRunButton(true); Geo.Winform.TableObjectViewForm form = new Geo.Winform.TableObjectViewForm(IonoFitTable); form.Show(); // tableObjectStorages.WriteAllToFileAndClearBuffer(); var span = DateTime.Now - start;// = DateTime.Now; log.Info("计算完毕,耗时 : " + span); }
/// <summary> /// 两个频率组成新的频率。简单的线性组合 /// 频率和载波相位都可以直接相加,而距离需要转换。 /// </summary> /// <param name="factorA">系数A</param> /// <param name="bandA">频率A</param> /// <param name="factorB">系数B</param> /// <param name="bandB">频率B</param> /// <param name="name">名称</param> /// <returns></returns> public static Frequence GetCompositFreqence(double factorA, Frequence bandA, double factorB, Frequence bandB, string name = null) { return(Frequence.GetCompositFreqence(factorA, bandA, factorB, bandB, name)); }
/// <summary> /// 无电离层相位组合,单位:周。 /// </summary> /// <param name="phaseA"></param> /// <param name="phaseB"></param> /// <param name="A"></param> /// <param name="B"></param> /// <returns></returns> public static PhaseCombination GetIonoFreePhaseCycleCombination(double phaseA, double phaseB, Frequence A, Frequence B) { double[] facs = GetIonoFreePhaseCycleCombFactors(A, B); double fac1 = facs[0]; double fac2 = facs[1]; double val = GetCombinationValue(fac1, phaseA, fac2, phaseB); var freq = GetIonoFreeComPhaseFrequence(A, B); return(new PhaseCombination(val, freq)); }