示例#1
0
        public override void PostRun()
        {
            base.PostRun();
            var fileName = Path.GetFileName(FilePath);
            var outFile  = Path.Combine(OutputDirectory, Path.GetFileName(FilePath));

            var result = ObsAnalysisInfoCollection.BuildResult();

            result.WriteAsRinexCommentFile(Path.Combine(OutputDirectory, fileName + ".Anasis"));

            result.UpdateToRinexOFileHeader(FilePath, outFile);
            var resultFromFile = ObsAnalysisInfo.ParseRinexCommentFile(outFile);
        }
示例#2
0
        /// <summary>
        /// 解析
        /// </summary>
        /// <param name="rinexFile"></param>
        public static ObsAnalysisInfo ParseRinexCommentFile(string rinexFile)
        {
            WidthFixedParamReader reader = new WidthFixedParamReader();
            var paramDic = reader.ParseFromRinexOFile(rinexFile);

            ObsAnalysisInfo info = new ObsAnalysisInfo(rinexFile);

            info.MultipathFactors = new Dictionary <FrequenceType, double>();
            if (paramDic.ContainsKey("A_MP"))
            {
                info.MultipathFactors.Add(FrequenceType.A, Double.Parse(paramDic["A_MP"]));
                info.MultipathFactors.Add(FrequenceType.B, Double.Parse(paramDic["B_MP"]));
            }
            return(info);
        }
示例#3
0
        /// <summary>
        /// 是否符合要求
        /// </summary>
        /// <param name="inpath"></param>
        /// <returns></returns>
        public bool IsMatch(string inpath)
        {
            var fileName = Path.GetFileName(inpath);
            var reader   = new RinexObsFileReader(inpath, false);
            var header   = reader.GetHeader();

            //多路径效应,此处采用TEQC分析
            if (Option.MultipathMp1.Enabled || Option.MultipathMp2.Enabled)
            {
                #region 利用TEQC分析获取数据多路径值
                var TeqcPath = Setting.GnsserConfig.TeqcPath;
                Gnsser.Interoperation.Teqc.TeqcFunctionCaller call = new Gnsser.Interoperation.Teqc.TeqcFunctionCaller(TeqcPath, Gnsser.Interoperation.Teqc.TeqcFunction.QualityChecking);
                string result = call.Run(inpath)[0];
                //当后台cmd输出流不正常时,说明该测站O文件QC失败!
                if (!result.Contains("SUM ") || ((result.Contains("SUM ")) && result.Substring(result.IndexOf("SUM ") + 63, 4).Replace(" ", "") == "n/a"))
                {
                    //QC失败,还得靠自己算!
                }
                else
                {
                    double Mp1 = double.Parse(result.Substring(result.IndexOf("SUM ") + 63, 4).Replace(" ", ""));
                    double Mp2 = double.Parse(result.Substring(result.IndexOf("SUM ") + 69, 4).Replace(" ", ""));

                    if (this.Option.MultipathMp1.Enabled)
                    {
                        if (Mp1 > this.Option.MultipathMp1.Value)
                        {
                            return(false);
                        }
                    }
                    if (this.Option.MultipathMp2.Enabled)
                    {
                        if (Mp2 > this.Option.MultipathMp2.Value)
                        {
                            return(false);
                        }
                    }
                }

                #endregion
            }

            ObsAnalysisInfo anaInfo = new ObsAnalysisInfo(header);
            //if (this.Option.MultipathMp1.Enabled && anaInfo.HasMultipathFactor)
            //{
            //    if (anaInfo.MultipathFactors[FrequenceType.A] > this.Option.MultipathMp1.Value)
            //    {
            //        return false;
            //    }
            //}

            //if (this.Option.MultipathMp2.Enabled && anaInfo.HasMultipathFactor)
            //{
            //    if (anaInfo.MultipathFactors[FrequenceType.B] > this.Option.MultipathMp2.Value)
            //    {
            //        return false;
            //    }
            //}


            if (Option.IsEnableSatelliteTypes)
            {
                foreach (var satType in Option.SatelliteTypes)
                {
                    if (!header.SatelliteTypes.Contains(satType))
                    {
                        log.Info(fileName + " 不包含系统 " + satType);
                        return(false);
                    }
                }
            }


            if (Option.IsEnableObsCodes)
            {
                var codes = header.ObsCodes;
                foreach (var item in Option.ObsCodes)
                {
                    foreach (var list in codes.Values)
                    {
                        if (!list.Contains(item))
                        {
                            log.Info(fileName + " 不包含 " + item);
                            return(false);
                        }
                    }
                }
            }

            if (Option.IsEnableMinFrequencyCount)
            {
                var codes = header.ObsCodes;

                foreach (var item in codes)
                {
                    var count = MathedCount(item.Value, "L");
                    if (count < Option.MinFrequencyCount)
                    {
                        log.Info(fileName + " 伪距数量少于 " + Option.MinFrequencyCount);
                        return(false);
                    }

                    count = MathedCount(item.Value, new string[] { "C", "P" });
                    if (count < Option.MinFrequencyCount)
                    {
                        log.Info(fileName + " 载波数量少于 " + Option.MinFrequencyCount);
                        return(false);
                    }
                }
            }


            if (Option.IsEnableMinFileSizeMB)
            {
                FileInfo info    = new FileInfo(inpath);
                var      minByte = Option.MinFileSizeMB * 1024L * 1024L;
                if (info.Length < minByte)
                {
                    log.Info(fileName + " 文件小于 " + Option.MinFileSizeMB + " MB");
                    return(false);
                }
            }


            if (Option.IsEnableCenterRegion)
            {
                if (!Option.CenterRegion.Contains(header.ApproxXyz))
                {
                    log.Info(fileName + "  " + header.ApproxXyz + " 不在指定区域内 " + Option.CenterRegion);
                    return(false);
                }
            }

            if (Option.IsEnableExcludeSiteNames)
            {
                if (Option.ExcludeSiteNames.Contains(header.SiteName))
                {
                    log.Info(fileName + " 点名被排除了");
                    return(false);
                }
            }

            if (Option.IsEnableIncludeSiteNames)
            {
                if (!Option.IncludeSiteNames.Contains(header.SiteName))
                {
                    log.Info(fileName + " 点名被排除了");
                    return(false);
                }
            }
            if (Option.IsEnableTimePeriod)
            {
                if (!Option.TimePeriod.Contains(header.StartTime))
                {
                    log.Info(fileName + " 不在指定时段内 " + Option.TimePeriod);
                    return(false);
                }
            }
            //这个比较耗时,放在最后
            if (Option.IsEnableMinEpochCount)
            {
                var count = RinexObsFileReader.ReadGetEpochCount(inpath);
                if (count < Option.MinEpochCount)
                {
                    log.Info(fileName + " 历元数量 " + count + "  少于 " + Option.MinEpochCount);
                    return(false);
                }
            }

            if (Option.IsEnableMinRatioOfSatCount)
            {
                var ratio = RinexObsFileReader.GetRatioOfSatCount(inpath, Option.MinSatCount);
                if (ratio < Option.MinRatioOfSatCount)
                {
                    log.Info(fileName + " 最小卫星数量比率 " + ratio);
                    return(false);
                }
            }

            return(true);
        }