/// <summary> /// 直接以Time作为X,若数据数量太少,返回null /// </summary> /// <param name="order"></param> /// <returns></returns> public virtual TimedLsPolyFit GetTimedLsPolyFit(int order) { if (order >= this.Count) { return(null); } var fit = new TimedLsPolyFit(this.Data, order); fit.Init(); return(fit); }
/// <summary> /// 多项式拟合值,将尽量查找接近指定时刻的拟合,若数据数量太少,返回null /// </summary> /// <param name="time">时间,历元</param> /// <param name="order">拟合阶次</param> /// <param name="dataCount">参与计算的数量</param> /// <returns></returns> //public virtual RmsedNumeral GetPolyFitValue(Time time, int order, int dataCount) //{ // base.GetPolyFitValue() // if (order >= this.Count) // { // return null; // } // TimedLsPolyFit fit = GetPolyFit(time, order, dataCount); // return fit.GetRmsedY(time); //} public TimedLsPolyFit GetPolyFit(Time time, int order, int dataCount) { if (order >= this.Count) { return(null); } var window = GetNearstWindowData(time, dataCount); var fit = new TimedLsPolyFit(window.Data, order); fit.Init(); return(fit); }
private double GetAk(out double deltaIono) { deltaIono = 0; TimedLsPolyFit ionoFit = null; //var IonoWindow = new TimeNumeralWindowData(12); var keys = this.OrderedKeys; double firstIonoAndHalfLambdaLen = this[keys[0]].FittedIonoAndAmbiValue; //IonoWindow.GetPolyFitValue(keys[0], OrderOfDeltaIonoPolyFit, IonoFitDataCount).Value; //if (IsDeltaIonoCorrect) //{ // ionoFit = GetDeltaIonoPolyFit(); // if(ionoFit != null) // { // firstIonoAndHalfLambdaLen = ionoFit.GetY(keys[0]); // } //} //采用窗口内的数据进行平滑 double sum = 0; foreach (var key in keys) { var PL = this[key]; if (IsDeltaIonoCorrect && ionoFit != null) { //IonoWindow.Add(key, PL.GetRawIonoAndHalfAmbiValue()); //var fiter = IonoWindow.GetTimedLsPolyFit(this.OrderOfDeltaIonoPolyFit); //if (fiter != null) //{ // var ionoVal = fiter.GetY(key); // this.CurrentIonoAndHalfLambdaLen = ionoVal; //y = I0 + bt + λN /2 //} //else //{ // this.CurrentIonoAndHalfLambdaLen = ionoFit.GetY(key); //y = I0 + bt + λN /2 //} CurrentIonoAndHalfLambdaLen = PL.FittedIonoAndAmbiValue; deltaIono = (CurrentIonoAndHalfLambdaLen - firstIonoAndHalfLambdaLen); } sum += PL.RangeMinusPhase - 2 * deltaIono; } double Ak = sum / this.Count; return(Ak); }
/// <summary> /// 电离层拟合器,第一个历元为0开始 /// y = I0 + bt + λN /2。 Y 包含了当前历元的电离层和一半的模糊度距离 /// </summary> /// <returns></returns> public TimedLsPolyFit GetDeltaIonoPolyFit() { if (OrderOfDeltaIonoPolyFit > this.Count - 1) { return(null); } Dictionary <Time, double> dic = new Dictionary <Time, double>(); var keys = this.OrderedKeys; var first = keys[0]; foreach (var item in keys) { var data = this[item]; double y = 0.5 * data.RangeMinusPhase; dic.Add(item, y); } TimedLsPolyFit fit = new TimedLsPolyFit(dic, OrderOfDeltaIonoPolyFit); fit.Init(); //fit.InitAndFitParams<Time>(dic, m => m.SecondsOfWeek); return(fit); }