示例#1
0
        /// <summary>
        /// 增加参数到存储表
        /// </summary>
        /// <param name="epoch"></param>
        /// <param name="result"></param>
        private void AddSecondParam(ISiteSatObsInfo epoch, SimpleGnssResult result)
        {
            var table = TableTextManager.GetOrCreate(epoch.Name + Setting.EpochSecondParamFileExtension);

            table.NewRow();
            table.AddItem("Epoch", epoch.ReceiverTime);//ToShortTimeString());

            //table.AddItem((IVector)result.Adjustment.Estimated);
            foreach (var item in result.ResultMatrix.SecondParamNames)
            {
                table.AddItem(item, result.ResultMatrix.SecondEstimated[item]);
            }
            if (epoch.UnstablePrns.Count > 0 || epoch.RemovedPrns.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                if (epoch.UnstablePrns.Count > 0)
                {
                    sb.Append(String.Format(new EnumerableFormatProvider(), "{0}", epoch.UnstablePrns));
                }

                if (epoch.RemovedPrns.Count > 0)
                {
                    sb.Append(";" + String.Format(new EnumerableFormatProvider(), "{0}", epoch.RemovedPrns));
                }

                table.AddItem("CsOrRemoved", sb.ToString());
            }

            table.EndRow();
        }
示例#2
0
        /// <summary>
        /// 添加钟跳结果
        /// </summary>
        /// <param name="epoch"></param>
        /// <param name="result"></param>
        private void CheckOrAddClockJump(ISiteSatObsInfo epoch, SimpleGnssResult result)
        {
            if (this.PrevResult == null)
            {
                return;
            }

            if (result is SingleSiteGnssResult && PrevResult is SingleSiteGnssResult)
            {
                var    pre   = PrevResult as SingleSiteGnssResult;
                var    res   = result as SingleSiteGnssResult;
                double delta = res.RcvClkError - pre.RcvClkError;

                if (Math.Abs(delta) > 1e-4)
                {
                    log.Info(epoch.Name + "在 " + epoch.ReceiverTime + "捕获到一个钟跳!与上历元偏差:" + delta + ",改正数(s):" + res.RcvClkCorrection);

                    var table = TableTextManager.GetOrCreate(epoch.Name + "_ClockJump.cjump");
                    table.NewRow();
                    table.AddItem("Epoch", epoch.ReceiverTime);

                    table.AddItem("Value", delta.ToString("G9"));
                }
            }
        }
示例#3
0
        /// <summary>
        /// 模糊度固定解
        /// </summary>
        /// <param name="epoch"></param>
        /// <param name="result"></param>
        private void AddAmbFixed(ISiteSatObsInfo epoch, SimpleGnssResult result)
        {
            if (result.ResultMatrix.Estimated_PPPAR1 != null)
            {
                var tablenew = TableTextManager.GetOrCreate(epoch.Name + "PPPAR_Params");
                tablenew.NewRow();
                tablenew.AddItem("Epoch", epoch.ReceiverTime);//ToShortTimeString());
                tablenew.AddItem("dx", result.ResultMatrix.Estimated_PPPAR1[0]);
                tablenew.AddItem("dy", result.ResultMatrix.Estimated_PPPAR1[1]);
                tablenew.AddItem("dz", result.ResultMatrix.Estimated_PPPAR1[2]);
                tablenew.AddItem("clk", result.ResultMatrix.Estimated_PPPAR1[3]);
                tablenew.AddItem("trop", result.ResultMatrix.Estimated_PPPAR1[4]);
                tablenew.EndRow();

                var tablenew2 = TableTextManager.GetOrCreate(epoch.Name + "PPPAR_Params2");
                tablenew2.NewRow();
                tablenew2.AddItem("Epoch", epoch.ReceiverTime);//ToShortTimeString());
                tablenew2.AddItem("dx", result.ResultMatrix.Estimated_PPPAR2[0]);
                tablenew2.AddItem("dy", result.ResultMatrix.Estimated_PPPAR2[1]);
                tablenew2.AddItem("dz", result.ResultMatrix.Estimated_PPPAR2[2]);
                tablenew2.AddItem("clk", result.ResultMatrix.Estimated_PPPAR2[3]);
                tablenew2.AddItem("trop", result.ResultMatrix.Estimated_PPPAR2[4]);
                tablenew2.EndRow();
            }
        }   /// <summary>
示例#4
0
        }   /// <summary>

        /// 增加参数RMS到存储表
        /// </summary>
        /// <param name="epoch"></param>
        /// <param name="result"></param>
        private void AddSecondParamRms(ISiteSatObsInfo epoch, SimpleGnssResult result)
        {
            var tableRms = TableTextManager.GetOrCreate(epoch.Name + Setting.EpochSecondParamRmsFileExtension);

            tableRms.NewRow();
            tableRms.AddItem("Epoch", epoch.ReceiverTime);

            tableRms.AddItem(result.ResultMatrix.StdOfSecondEstimatedParam);

            if (epoch.UnstablePrns.Count > 0 || epoch.RemovedPrns.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                if (epoch.UnstablePrns.Count > 0)
                {
                    sb.Append(String.Format(new EnumerableFormatProvider(), "{0}", epoch.UnstablePrns));
                }

                if (epoch.RemovedPrns.Count > 0)
                {
                    sb.Append(";" + String.Format(new EnumerableFormatProvider(), "{0}", epoch.RemovedPrns));
                }

                tableRms.AddItem("CsOrRemoved", sb.ToString());
            }
            tableRms.EndRow();
        }
 /// <summary>
 /// 更新所有的转移模型
 /// </summary>
 /// <param name="entity"></param>
 public void Update(ISiteSatObsInfo entity)
 {
     foreach (var item in this)
     {
         item.Init(entity);
     }
 }
示例#6
0
 /// <summary>
 /// 增加DOP结果
 /// </summary>
 /// <param name="epoch"></param>
 /// <param name="result"></param>
 private void AddDop(ISiteSatObsInfo epoch, SimpleGnssResult result)
 {
     //无测站信息,或固定参考站,
     if ((result is SingleSiteGnssResult) && result.ParamNames.Contains(Gnsser.ParamNames.Dx))
     {
         var singleSiteResult = result as SingleSiteGnssResult;
         var sysName          = Geo.Utils.StringUtil.ToString(Option.SatelliteTypes, "_");
         var tableDOP         = TableTextManager.GetOrCreate(epoch.Name + sysName + Setting.EpochDopFileExtension);
         tableDOP.NewRow();
         tableDOP.AddItem("Epoch", singleSiteResult.ReceiverTime);
         tableDOP.AddItem("TotalPrns", epoch.EnabledSatCount);
         tableDOP.AddItem("GDOP", singleSiteResult.DilutionOfPrecision.GDOP);
         tableDOP.AddItem("PDOP", singleSiteResult.DilutionOfPrecision.PDOP);
         tableDOP.AddItem("HDOP", singleSiteResult.DilutionOfPrecision.HDOP);
         tableDOP.AddItem("VDOP", singleSiteResult.DilutionOfPrecision.VDOP);
         tableDOP.EndRow();
     }
 }
示例#7
0
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="epochInfo"></param>
 public virtual void Init(ISiteSatObsInfo epochInfo)
 {
     if (epochInfo is EpochInformation)
     {
         Init((EpochInformation)epochInfo);
     }
     else if (epochInfo is PeriodInformation)
     {
         Init((PeriodInformation)epochInfo);
     }
     else if (epochInfo is MultiSiteEpochInfo)
     {
         Init((MultiSiteEpochInfo)epochInfo);
     }
     else if (epochInfo is MultiSitePeriodInfo)
     {
         Init((MultiSitePeriodInfo)epochInfo);
     }
 }
示例#8
0
        /// <summary>
        /// 增加坐标到存储表,主要用于导航解算
        /// </summary>
        /// <param name="epoch"></param>
        /// <param name="gnssResult"></param>
        private void AddEpochCoord(ISiteSatObsInfo epoch, SimpleGnssResult gnssResult)
        {
            if (gnssResult is SingleSiteGnssResult)
            {
                var result = (SingleSiteGnssResult)gnssResult;
                var table  = TableTextManager.GetOrCreate(epoch.Name + Setting.EpochCoordFileExtension);
                table.NewRow();
                table.AddItem("Epoch", epoch.ReceiverTime); //ToShortTimeString());

                var dxyz = result.XyzCorrection;            // XYZ.Parse(result.Adjustment.Estimated);
                if (dxyz != null)
                {
                    var xyz = result.EstimatedXyz;
                    var geo = result.GeoCoord;
                    table.AddItem(Gnsser.ParamNames.X, xyz.X.ToString("0.0000"));
                    table.AddItem(Gnsser.ParamNames.Y, xyz.Y.ToString("0.0000"));
                    table.AddItem(Gnsser.ParamNames.Z, xyz.Z.ToString("0.0000"));
                    //精确到亚毫米
                    table.AddItem(Gnsser.ParamNames.Lon, geo.Lon.ToString("0.00000000"));
                    table.AddItem(Gnsser.ParamNames.Lat, geo.Lat.ToString("0.00000000"));
                    table.AddItem(Gnsser.ParamNames.Height, geo.Height.ToString("0.0000"));
                }
            }
            if (gnssResult is IEstimatedBaseline)
            {
                var result = (IEstimatedBaseline)gnssResult;
                var table  = TableTextManager.GetOrCreate(epoch.Name + Setting.EpochCoordFileExtension);
                table.NewRow();
                table.AddItem("Epoch", epoch.ReceiverTime);                    //ToShortTimeString());

                var xyz = result.EstimatedXyzOfRov;                            //.EstimatedXyz;
                var geo = Geo.Coordinates.CoordTransformer.XyzToGeoCoord(xyz); // result.GeoCoord;
                table.AddItem(Gnsser.ParamNames.X, xyz.X.ToString("0.0000"));
                table.AddItem(Gnsser.ParamNames.Y, xyz.Y.ToString("0.0000"));
                table.AddItem(Gnsser.ParamNames.Z, xyz.Z.ToString("0.0000"));
                //精确到亚毫米
                table.AddItem(Gnsser.ParamNames.Lon, geo.Lon.ToString("0.00000000"));
                table.AddItem(Gnsser.ParamNames.Lat, geo.Lat.ToString("0.00000000"));
                table.AddItem(Gnsser.ParamNames.Height, geo.Height.ToString("0.0000"));
            }
        }
示例#9
0
        /// <summary>
        /// 输出算后残差
        /// </summary>
        /// <param name="epoch"></param>
        /// <param name="gnssResult"></param>
        private void AddResidual(ISiteSatObsInfo epoch, SimpleGnssResult gnssResult)
        {
            var fileName = ResultFileNameBuilder.BuildEpochResidualFileName(epoch.Name);
            var table    = TableTextManager.GetOrCreate(fileName);

            table.NewRow();
            table.AddItem("Epoch", epoch.ReceiverTime);//ToShortTimeString());
            var names = gnssResult.ResultMatrix.ObsMatrix.Observation.ParamNames;
            int i     = 0;
            //var obs = gnssResult.ResultMatrix.ObsMatrix.Observation - gnssResult.ResultMatrix.ObsMatrix.FreeVector;
            var obs = gnssResult.ResultMatrix.PostfitResidual;//.ObsMatrix.Observation - gnssResult.ResultMatrix.ObsMatrix.FreeVector;

            foreach (var item in obs)
            {
                string name = i + "";
                if (names != null)
                {
                    name = names[i] ?? i + "";
                }
                table.AddItem(name, obs[i]);
                i++;
            }
        }
示例#10
0
        /// <summary>
        /// 增加参数到存储表
        /// </summary>
        /// <param name="epoch"></param>
        /// <param name="result"></param>
        private void AddEpochParam(ISiteSatObsInfo epoch, SimpleGnssResult result)
        {
            var fileName = ResultFileNameBuilder.BuildEpochParamFileName(epoch.Name);



            var table = TableTextManager.GetOrCreate(fileName);

            table.NewRow();
            table.AddItem("Epoch", epoch.ReceiverTime);//ToShortTimeString());

            if (result is SingleSiteGnssResult ||
                result is IWithEstimatedBaselines ||
                result is SingleSitePeriodInfoGnssResult ||
                result is IWithEstimatedBaseline)
            {
                XYZ appXyz = new XYZ();
                XYZ estXyz = new XYZ();
                if (result is SingleSiteGnssResult)
                {
                    var singleSiteResult = result as SingleSiteGnssResult;
                    appXyz = singleSiteResult.ApproxXyz;
                    estXyz = singleSiteResult.EstimatedXyz;
                }
                if (result is SingleSitePeriodInfoGnssResult)
                {
                    var period = result as SingleSitePeriodInfoGnssResult;
                    appXyz = period.MaterialObj[0].SiteInfo.ApproxXyz;
                }
                if (result is IWithEstimatedBaseline)
                {
                    var info     = result as IWithEstimatedBaseline;
                    var baseLine = info.GetEstimatedBaseline();
                    estXyz = baseLine.EstimatedXyzOfRov;
                    appXyz = baseLine.ApproxXyzOfRov;
                }
                if (result is IWithEstimatedBaselines)
                {
                    var info     = result as IWithEstimatedBaselines;
                    var baseLine = info.GetEstimatedBaselines().First;
                    estXyz = baseLine.EstimatedXyzOfRov;
                    appXyz = baseLine.ApproxXyzOfRov;
                }


                var dxyz = ((BaseGnssResult)result).XyzCorrection; // XYZ.Parse(result.Adjustment.Estimated);

                if (dxyz != null)                                  //&& epoch.ReceiverTime.SecondsOfDay % 30 == 0
                {
                    ENU enu = null;
                    if (this.Option.IsUpdateEstimatePostition)
                    {
                        dxyz = estXyz - appXyz;

                        enu = CoordTransformer.XyzToEnu(estXyz, appXyz);
                    }
                    else
                    {
                        enu = CoordTransformer.LocaXyzToEnu(dxyz, appXyz);
                    }

                    table.AddItem(Gnsser.ParamNames.De, enu.E);
                    table.AddItem(Gnsser.ParamNames.Dn, enu.N);
                    table.AddItem(Gnsser.ParamNames.Du, enu.U);

                    if (this.Option.IsUpdateEstimatePostition || this.Option.PositionType == PositionType.动态定位)
                    {
                        table.AddItem("EstX", estXyz.X);
                        table.AddItem("EstY", estXyz.Y);
                        table.AddItem("EstZ", estXyz.Z);
                    }
                }
            }

            #region 添加钟结果改正
            if (result is ClockEstimationResult)
            {
                var           mEpochInfo = epoch as MultiSiteEpochInfo;
                List <string> paranames  = result.ResultMatrix.ParamNames;
                int           CountOfSat = epoch.EnabledSatCount * 2;
                foreach (var item in epoch.EnabledPrns)
                {
                    double qq = result.ResultMatrix.Corrected.CorrectedValue[paranames.IndexOf(item + "_" + ParamNames.SatClkErrDistance)];
                    table.AddItem(item.ToString(), qq);
                    int    count = 0;
                    double time  = 0;
                    Time   EmissionSatClockTime = new Time();// Time.Default;
                    //Time EmissionSatClockTime1 = Time.Default;
                    foreach (var item2 in mEpochInfo)
                    {
                        foreach (var item3 in item2)
                        {
                            if (item3.Prn == item)
                            {
                                count++;
                                time += item3.Ephemeris.ClockBias - ((Ephemeris)item3.Ephemeris).RelativeCorrection;
                                //EmissionSatClockTime.TickTime.SecondTicks += item3.EmissionTime.TickTime.SecondTicks;

                                EmissionSatClockTime.TickTime += item3.EmissionTime.TickTime;
                                break;
                            }
                        }
                    }
                    double aa    = qq / 0.3 + time * 1e9 / count;
                    double time1 = (EmissionSatClockTime.TickTime.SecondTicks + EmissionSatClockTime.TickTime.Fraction) / count;
                    EmissionSatClockTime.TickTime = SecondTime.FromSecond(time1);
                    table.AddItem(item + "EmissionSatClockTime", EmissionSatClockTime.ToString());
                    table.AddItem(item + "_Corrected", aa);
                }
            }
            #endregion

            //table.AddItem((IVector)result.Adjustment.Estimated);
            foreach (var name in result.ParamNames)
            {
                //if (item.Length == 6 && item.Substring(3, 3) == "_λN")
                //{
                //    table.AddItem(item.Substring(0, 3), result.Adjustment.Estimated[item]);
                //}
                //else
                {
                    table.AddItem(name, result.ResultMatrix.Estimated[name]);
                }
            }
            if (epoch.UnstablePrns.Count > 0 || epoch.RemovedPrns.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                if (epoch.UnstablePrns.Count > 0)
                {
                    sb.Append(String.Format(new EnumerableFormatProvider(), "{0}", epoch.UnstablePrns));
                }

                if (epoch.RemovedPrns.Count > 0)
                {
                    sb.Append(";" + String.Format(new EnumerableFormatProvider(), "{0}", epoch.RemovedPrns));
                }

                table.AddItem("CsOrRemoved", sb.ToString());
            }

            table.AddItem(ParamNames.ResultType, result.ResultMatrix.ResultType);
            table.AddItem(ParamNames.StdDev, result.ResultMatrix.StdDev);

            table.EndRow();
        }
示例#11
0
        /// <summary>
        /// 添加测站卫星信息
        /// </summary>
        /// <param name="epoch"></param>
        private void AddSiteEpochSatInfo(ISiteSatObsInfo epoch)
        {
            EpochInformation epochInfo = null;

            if (epoch is EpochInformation)
            {
                epochInfo = epoch as EpochInformation;
            }
            else if (epoch is MultiSiteEpochInfo)
            {
                epochInfo = (epoch as MultiSiteEpochInfo).OtherEpochInfo;
            }
            else if (epoch is MultiSitePeriodInfo)
            {
                epochInfo = (epoch as MultiSitePeriodInfo)[0].OtherEpochInfo;
            }
            else if (epoch is PeriodInformation)
            {
                epochInfo = (epoch as PeriodInformation)[0];
            }


            if (epochInfo != null)
            {
                foreach (var sat in epochInfo.EnabledSats)
                {
                    var satTable = TableTextManager.GetOrCreate(epoch.Name + "_" + sat.Prn + "");
                    satTable.NewRow();
                    satTable.AddItem("Epoch", epoch.ReceiverTime);
                    var polar = sat.Polar;
                    satTable.AddItem("Elevation", polar.Elevation);
                    satTable.AddItem("Azimuth", polar.Azimuth);
                    satTable.AddItem("Distance", polar.Range);
                    foreach (var correction in sat.CommonCorrection.Corrections)
                    {
                        satTable.AddItem("通用_" + correction.Key, correction.Value);
                    }
                    foreach (var correction in sat.RangeOnlyCorrection.Corrections)
                    {
                        satTable.AddItem("仅伪距_" + correction.Key, correction.Value);
                    }
                    foreach (var correction in sat.PhaseOnlyCorrection.Corrections)
                    {
                        satTable.AddItem("仅载波距离_" + correction.Key, correction.Value);
                    }

                    foreach (var freq in sat)
                    {
                        foreach (var correction in freq.CommonCorrection.Corrections)
                        {
                            satTable.AddItem("频率_" + freq.FrequenceType + "_通用距离_" + correction.Key, correction.Value);
                        }
                        foreach (var correction in freq.RangeOnlyCorrection.Corrections)
                        {
                            satTable.AddItem("频率_" + freq.FrequenceType + "_仅伪距_" + correction.Key, correction.Value);
                        }
                        foreach (var correction in freq.PhaseOnlyCorrection.Corrections)
                        {
                            satTable.AddItem("频率_" + freq.FrequenceType + "_仅载波距离_" + correction.Key, correction.Value);
                        }

                        foreach (var obs in freq)
                        {
                            foreach (var subObs in obs)
                            {
                                foreach (var correction in subObs.Corrections)
                                {
                                    satTable.AddItem("观测值自身改正_频率_" + freq.FrequenceType + "_" + freq.PseudoRange.GnssCodeType + "_" + correction.Key, correction.Value);
                                }
                            }
                        }
                    }
                }
            }
        }
示例#12
0
        /// <summary>
        /// 构建电离层输出表格
        /// </summary>
        /// <param name="epoch"></param>
        /// <param name="Adjustment"></param>
        /// <param name="ParamNames"></param>
        private void BuildIonoResult(ISiteSatObsInfo epoch, Geo.Algorithm.Adjust.AdjustResultMatrix Adjustment, List <string> ParamNames)
        {
            if (epoch is EpochInformation) //这里只处理单站单历元情况
            {
                var epochInfo = epoch as EpochInformation;
                //电离层汇总
                var allInOneTable = TableTextManager.GetOrCreate(epoch.Name + "_All_" + Gnsser.ParamNames.Iono);
                allInOneTable.NewRow();
                allInOneTable.AddItem("Epoch", epoch.ReceiverTime);

                ObjectTableStorage tableIonoParam          = null;
                ObjectTableStorage tableIf                 = null;
                ObjectTableStorage tableGridFile           = null;
                ObjectTableStorage tableHarmoFile          = null;
                ObjectTableStorage tableOfIonoParamService = null;

                //电离层参数
                if (Geo.Utils.StringUtil.Contanis(ParamNames, Gnsser.ParamNames.Iono, true))//参数化电离层文件
                {
                    tableIonoParam = TableTextManager.GetOrCreate(epoch.Name + "_Param_" + Gnsser.ParamNames.Iono);
                    tableIonoParam.NewRow();
                    tableIonoParam.AddItem("Epoch", epoch.ReceiverTime);

                    var ionoResult = Adjustment.Estimated.GetAll(Gnsser.ParamNames.Iono);
                    foreach (var item in ionoResult)
                    {
                        //斜距转换为垂距
                        //计算穿刺点
                        var prn = SatelliteNumber.Parse(item.Key);
                        var sat = epochInfo.Get(prn);
                        tableIonoParam.AddItem(prn.ToString(), item.Value.Value);
                    }
                }

                //双频电离层
                if (epochInfo.First.Count > 1)
                {
                    tableIf = TableTextManager.GetOrCreate(epoch.Name + "_IFofC_" + Gnsser.ParamNames.Iono);
                    tableIf.NewRow();
                    foreach (var sat in epochInfo.EnabledSats)
                    {
                        //斜距转换为垂距
                        //计算穿刺点
                        var prn            = sat.Prn;
                        var ionXyz         = sat.GetIntersectionXyz();
                        var geoCoordOfIono = CoordTransformer.XyzToGeoCoord(ionXyz);
                        var ionoFreeRange  = sat.Combinations.IonoFreeRange.Value;
                        var rangeA         = sat.FrequenceA.PseudoRange.Value;
                        var ionoError      = rangeA - ionoFreeRange;

                        tableIf.AddItem("Epoch", epoch.ReceiverTime);
                        tableIf.AddItem(prn.ToString(), ionoError);
                    }
                }


                if (Context.IgsGridIonoFileService != null && Context.IgsGridIonoFileService.TimePeriod.Contains(epoch.ReceiverTime))
                {
                    tableGridFile = TableTextManager.GetOrCreate(epoch.Name + "_Grid_" + Gnsser.ParamNames.Iono);
                    tableGridFile.NewRow();
                    foreach (var sat in epochInfo.EnabledSats)
                    {
                        //斜距转换为垂距
                        //计算穿刺点
                        var prn = sat.Prn;
                        tableGridFile.AddItem("Epoch", epoch.ReceiverTime);

                        double val = IonoGridModelCorrector.GetGridModelCorrection(sat, FrequenceType.A, Context.IgsGridIonoFileService);
                        tableGridFile.AddItem(prn.ToString(), val);
                    }
                }

                if (Context.IgsCodeHarmoIonoFileService != null && Context.IgsCodeHarmoIonoFileService.TimePeriod.Contains(epoch.ReceiverTime))
                {
                    tableHarmoFile = TableTextManager.GetOrCreate(epoch.Name + "_Harmo_" + Gnsser.ParamNames.Iono);
                    tableHarmoFile.NewRow();
                    foreach (var sat in epochInfo.EnabledSats)
                    {
                        //斜距转换为垂距
                        //计算穿刺点
                        var prn = sat.Prn;
                        tableHarmoFile.AddItem("Epoch", epoch.ReceiverTime);

                        double val = IonoGridModelCorrector.GetGridModelCorrection(sat, FrequenceType.A, Context.IgsCodeHarmoIonoFileService);
                        tableHarmoFile.AddItem(prn.ToString(), val);
                    }
                }
                if (Context.IonoKlobucharParamService != null)
                {
                    var ionoParam = Context.IonoKlobucharParamService.Get(epoch.ReceiverTime);//
                    if (ionoParam != null)
                    {
                        tableOfIonoParamService = TableTextManager.GetOrCreate(epoch.Name + "_ParamModel_" + Gnsser.ParamNames.Iono);
                        tableOfIonoParamService.NewRow();
                        foreach (var sat in epochInfo.EnabledSats)
                        {
                            tableOfIonoParamService.AddItem("Epoch", epoch.ReceiverTime);

                            var val = IonoParamModelCorrector.GetCorrectorInDistance(sat, ionoParam);

                            tableOfIonoParamService.AddItem(sat.Prn.ToString(), val);
                        }
                    }
                }


                //保存到总表中
                foreach (var sat in epochInfo.EnabledSats)
                {
                    var prn = sat.Prn;
                    CheckAndAddIonoValueToMainTable(allInOneTable, tableIonoParam, prn, "Param");
                    CheckAndAddIonoValueToMainTable(allInOneTable, tableIf, prn, "IfofC");
                    CheckAndAddIonoValueToMainTable(allInOneTable, tableGridFile, prn, "Grid");
                    CheckAndAddIonoValueToMainTable(allInOneTable, tableHarmoFile, prn, "Harmo");
                    CheckAndAddIonoValueToMainTable(allInOneTable, tableOfIonoParamService, prn, "ParamModel");
                }
            }
        }
示例#13
0
        /// <summary>
        /// 输出结果
        /// </summary>
        /// <param name="epoch"></param>
        /// <param name="result"></param>
        public void AddEpochResult(ISiteSatObsInfo epoch, SimpleGnssResult result)
        {
            //结果采样率过滤
            var interval = Math.Abs(epoch.ReceiverTime - PrevEpoch);

            if (interval < this.OutputMinInterval)
            {
                return;
            }
            PrevEpoch = epoch.ReceiverTime;

            //总开关
            if (!Option.IsOutputResult && !Option.IsOutputEpochResult)
            {
                return;
            }

            var Adjustment = result.ResultMatrix;
            var ParamNames = result.ParamNames;

            //各历元信息
            #region  默认逐历元输出

            //参数值
            if (Option.IsOutputEpochParam)
            {
                AddEpochParam(epoch, result);
            }

            // RMS
            if (Option.IsOutputEpochParamRms)
            {
                AddParamRms(epoch, result);
            }

            //钟跳
            if (Option.IsOutputJumpClockFile)
            {
                CheckOrAddClockJump(epoch, result);
            }

            //第二参数
            if (result.ResultMatrix.SecondEstimated != null)
            {
                AddSecondParam(epoch, result);
                AddSecondParamRms(epoch, result);
            }

            //DOP
            if (this.Option.IsOutputEpochDop)
            {
                AddDop(epoch, result);
            }

            //两路滤波,模糊度固定解
            AddAmbFixed(epoch, result);

            //动态定位,且坐标未固定,则添加
            if (this.Option.IsOutputEpochCoord || (this.Option.PositionType == PositionType.动态定位 && !this.Option.IsFixingCoord))
            {
                AddEpochCoord(epoch, result);
            }
            #endregion

            #region  择性历元输出
            #region 平差文件
            if (this.Option.IsOutputAdjust)
            {
                AioAdjustFileBuilder.AddAdjustment(Adjustment);
            }
            if (this.Option.IsOutputObsEquation)
            {
                AdjustEquationFileBuilder.AddAdjustment(Adjustment);
            }
            if (this.Option.IsOutputAdjustMatrix)
            {
                if (results == null)
                {
                    results = new List <SimpleGnssResult>();
                }
                results.Add(result);
            }

            #endregion

            #region 电离层产品
            if (this.Option.IsOutputIono)
            {
                BuildIonoResult(epoch, Adjustment, ParamNames);
            }

            #endregion

            #region 对流层产品
            if (this.Option.IsOutputWetTrop && Geo.Utils.StringUtil.Contanis(ParamNames, Gnsser.ParamNames.WetTropZpd, true) && epoch.ReceiverTime.SecondsOfDay % 300 == 0)
            {
                var table = TableTextManager.GetOrCreate(epoch.Name + "_" + Gnsser.ParamNames.WetTropZpd);
                table.NewRow();
                table.AddItem("Epoch", epoch.ReceiverTime);

                EpochInformation epochInfo = epoch as EpochInformation;
                //var ionoResult = Adjustment.Estimated.GetAll(Gnsser.ParamNames.WetTrop);
                //天顶对流层总延迟,epochInfo[0].WetMap_ZTD=1
                table.AddItem("Trop1", epochInfo[0].AppriorTropDelay + epochInfo[0].WetMap_ZTD * result.ResultMatrix.Estimated[4, 0]);
                table.AddItem("Trop2", epochInfo[1].WetMap_ZTD * result.ResultMatrix.Estimated[4, 0]);
                table.AddItem("Trop3", result.ResultMatrix.Estimated[4, 0]);
                //epoch[0].AppriorTropDelay + epoch[0].WetMap_ZTD *
                //foreach (var item in ionoResult)
                //{
                //    table.AddItem(item.Key, item.Value.Value);
                //}
            }
            #endregion

            #region  历元卫星观测信息
            if (Option.IsOutputEpochSatInfo)
            {
                AddSiteEpochSatInfo(epoch);
            }
            #endregion
            #endregion

            if (Option.IsOutputObservation)
            {
                AddObservation(epoch, result);
            }
            if (Option.IsOutputResidual)
            {
                this.AddResidual(epoch, result);
            }

            //轨道产品输出
            if (result is IOrbitResult)
            {
                var ephs = ((IOrbitResult)result).EphemerisResults;

                Sp3Section sp3Records = new Sp3Section(ephs.First.Original.Time);
                foreach (var eph in ephs)
                {
                    sp3Records.Add(eph.Original.Prn, eph.Corrected);
                }
                Sp3Writer.Write(sp3Records);
            }


            this.PrevResult = result;
        }
示例#14
0
        /// <summary>
        /// 增加参数RMS到存储表
        /// </summary>
        /// <param name="epoch"></param>
        /// <param name="result"></param>
        private void AddParamRms(ISiteSatObsInfo epoch, SimpleGnssResult result)
        {
            var fileName = ResultFileNameBuilder.BuildEpochParamRmsFileName(epoch.Name);
            var tableRms = TableTextManager.GetOrCreate(fileName);

            tableRms.NewRow();
            tableRms.AddItem("Epoch", epoch.ReceiverTime);

            if (result is SingleSiteGnssResult || result is SingleSitePeriodInfoGnssResult)
            {
                if (result.ParamNames.Contains(ParamNames.Dx))
                {
                    XYZ       xyz       = new XYZ();
                    CovaedXyz covaedXyz = null;
                    if (result is SingleSiteGnssResult)
                    {
                        var singleSiteResult = result as SingleSiteGnssResult;
                        xyz       = singleSiteResult.ApproxXyz;
                        covaedXyz = singleSiteResult.CovaedEstXyz;
                    }
                    if (result is SingleSitePeriodInfoGnssResult)
                    {
                        var period = result as SingleSitePeriodInfoGnssResult;
                        xyz       = period.MaterialObj[0].SiteInfo.ApproxXyz;
                        covaedXyz = period.CovaedEstXyz;
                    }
                    var dxyz = ((BaseGnssResult)result).EstimatedXyzRms;// result.EstimatedXyzRms;// XYZ.Parse(result.Adjustment.Estimated);
                    if (dxyz != null && dxyz != XYZ.Zero)
                    {
                        // var tmsenu = CoordTransformer.LocaXyzToEnu(dxyz, xyz);
                        var cova   = ((BaseGnssResult)result).CovaOfFirstThree;
                        var tmsenu = CoordTransformer.XyzToEnuRms(cova, xyz);

                        tableRms.AddItem(Gnsser.ParamNames.De, Math.Abs(tmsenu.E));
                        tableRms.AddItem(Gnsser.ParamNames.Dn, Math.Abs(tmsenu.N));
                        tableRms.AddItem(Gnsser.ParamNames.Du, Math.Abs(tmsenu.U));
                    }
                }
            }

            if (result is IWithEstimatedBaseline)
            {
                var info     = result as IWithEstimatedBaseline;
                var baseLine = info.GetEstimatedBaseline();
                var xyz      = baseLine.EstimatedXyzOfRov;
                var dxyz     = ((BaseGnssResult)result).EstimatedXyzRms;

                //  var tmsenu = CoordTransformer.LocaXyzToEnu(dxyz, xyz);

                var cova   = ((BaseGnssResult)result).CovaOfFirstThree;
                var tmsenu = CoordTransformer.XyzToEnuRms(cova, xyz);


                tableRms.AddItem(Gnsser.ParamNames.De, Math.Abs(tmsenu.E));
                tableRms.AddItem(Gnsser.ParamNames.Dn, Math.Abs(tmsenu.N));
                tableRms.AddItem(Gnsser.ParamNames.Du, Math.Abs(tmsenu.U));
            }

            tableRms.AddItem(result.ResultMatrix.StdOfEstimatedParam);
            if (epoch.UnstablePrns.Count > 0 || epoch.RemovedPrns.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                if (epoch.UnstablePrns.Count > 0)
                {
                    sb.Append(String.Format(new EnumerableFormatProvider(), "{0}", epoch.UnstablePrns));
                }

                if (epoch.RemovedPrns.Count > 0)
                {
                    sb.Append(";" + String.Format(new EnumerableFormatProvider(), "{0}", epoch.RemovedPrns));
                }

                tableRms.AddItem("CsOrRemoved", sb.ToString());
            }

            tableRms.AddItem(ParamNames.ResultType, result.ResultMatrix.ResultType);
            tableRms.AddItem(ParamNames.StdDev, result.ResultMatrix.StdDev);
            tableRms.EndRow();
        }
示例#15
0
 /// <summary>
 /// 输出结果
 /// </summary>
 /// <param name="epoch"></param>
 /// <param name="result"></param>
 private void OutputEpochResult(ISiteSatObsInfo epoch, TResult result)
 {
     GnssResultBuilder.AddEpochResult(epoch, result as SimpleGnssResult);
 }
        /// <summary>
        /// 处理一个历元
        /// </summary>
        /// <param name="epoch"></param>
        public override SimpleGnssResult Produce(EpochInformation epoch)
        {
            if (!this.EphemerisDataSource.TimePeriod.Contains(epoch.ReceiverTime))
            {
                this.IsCancel = true; log.Warn("星历结束,结束计算!" + this.EphemerisDataSource.TimePeriod);
            }
            if (epoch.Count == 0)
            {
                log.Error(epoch.ToShortString() + ", 没有可用卫星,是否系统选错了?"); return(null);
            }

            ISiteSatObsInfo  material = null;
            SimpleGnssResult result   = null;

            if (Solver is SingleSiteGnssSolver)
            {
                material = epoch;
                result   = ((SingleSiteGnssSolver)Solver).Get(epoch);
            }
            else if (Solver is SingleSitePeriodSolver) //单站多历元
            {
                PeriodInformationBuilder.Add(epoch);
                var period = PeriodInformationBuilder.Build();
                if (period == null || !period.Enabled)
                {
                    return(null);
                }
                material = period;
                result   = ((SingleSitePeriodSolver)Solver).Get(period);

                PeriodInformationBuilder.Data.Clear();
            }
            else if (Solver is CommonSingeSatGnssSolver || Solver is CommonSingePeriodSatGnssSolver) //单站多历元
            {
                material = epoch;

                if (!epoch.Contains(this.Prn))
                {//如果星历不存在则重新选星
                    if (this.Option.IsIndicatedPrn)
                    {
                        this.Prn = this.Option.IndicatedPrn;
                    }
                    else
                    {
                        //this.Prn = epoch.FirstKey;
                        this.Prn = epoch.GetMaxElevationPrn();
                        log.Info(this.Name + ", 最大高度角选星:" + this.Prn);
                    }
                }

                var sat = epoch.Get(this.Prn);
                if (sat == null)
                {
                    return(null);
                }
                if (Solver is CommonSingeSatGnssSolver)
                {
                    result = ((CommonSingeSatGnssSolver)Solver).Get(sat);
                }
                else if (Solver is CommonSingePeriodSatGnssSolver) //单站多历元
                {
                    if (PeriodSatelliteBuilder.Add(sat))
                    {
                        var period = PeriodSatelliteBuilder.Build();
                        if (period == null || !period.Enabled)
                        {
                            return(null);
                        }
                        //material = period;
                        result = ((CommonSingePeriodSatGnssSolver)Solver).Get(period);
                    }
                }
            }
            return(result);
        }