Ejemplo n.º 1
0
        protected override void Execute(string inPath, string outPath)
        {
            //先整体探测一遍。
            Gnsser.Data.Rinex.RinexObsFileReader reader = new Data.Rinex.RinexObsFileReader(inPath);
            var oldHeader = reader.GetHeader();
            var processer = new SatConsecutiveAnalyst(oldHeader.Interval);

            foreach (var item in reader)
            {
                var obs = Domain.EpochInformation.Parse(item, item.Header.SatelliteTypes);
                processer.Revise(ref obs);
            }
            var smallParts = processer.SatSequentialPeriod.GetFilteredPeriods(MinSuccessiveCount * oldHeader.Interval, true);


            //写入到流
            Gnsser.Data.Rinex.RinexObsFileWriter writer = new Data.Rinex.RinexObsFileWriter(outPath, this.CurrentParam.OutputVersion);

            EpochInfoToRinex EpochInfoToRinex = new Domain.EpochInfoToRinex(3.02, false);

            //
            Gnsser.Data.Rinex.RinexObsFileHeader newHeader = null;
            int maxBufferEpoch = 200;
            int i = 0;

            reader.Reset();
            foreach (var item in reader)
            {
                var epochInfo = Domain.EpochInformation.Parse(item, item.Header.SatelliteTypes);
                FilterSat(smallParts, epochInfo);

                var epochObs = EpochInfoToRinex.Build(epochInfo);
                if (newHeader == null)
                {
                    newHeader = epochObs.Header;
                    writer.WriteHeader(newHeader);
                }

                writer.WriteEpochObservation(epochObs);

                // throw new Exception("需要实现 EpochInformation 向 RinexEpcohObs 的转换");

                if (i > maxBufferEpoch)
                {
                    writer.Writer.Flush();
                }
                i++;
            }
            writer.Writer.Close();


            //cycleSlipProcesser.SatPeriodInfoManager.SaveSatPeriodText(outPath + "_BreakingChart.txt");

            //File.WriteAllText(outPath + "__BreakingPeriod.txt", cycleSlipProcesser.SatPeriodInfoManager.ToFormatedString(), Encoding.UTF8);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 具体的执行.
        /// </summary>
        /// <param name="fileInPath"></param>
        /// <param name="fileOutPath"></param>
        protected override void Execute(string fileInPath, string fileOutPath)
        {
            Gnsser.Data.Rinex.RinexObsFileReader reader = new Data.Rinex.RinexObsFileReader(fileInPath);
            var oldHeader = reader.GetHeader();
            var processer = new SatCycleSlipAnalyst(new List <SatelliteType>()
            {
                SatelliteType.G
            }, oldHeader.Interval);

            //写入到流
            EpochInfoToRinex EpochInfoToRinex = new Domain.EpochInfoToRinex(this.CurrentParam.OutputVersion, false);

            Gnsser.Data.Rinex.RinexObsFileWriter writer    = new Data.Rinex.RinexObsFileWriter(fileOutPath, this.CurrentParam.OutputVersion);
            Gnsser.Data.Rinex.RinexObsFileHeader newHeader = null;
            int maxBufferEpoch = 200;
            int i = 0;

            foreach (var item in reader)
            {
                //标记
                var obs = Domain.EpochInformation.Parse(item, item.Header.SatelliteTypes);
                processer.Revise(ref obs);

                //写入文件
                var epochObs = EpochInfoToRinex.Build(obs);
                if (newHeader == null)
                {
                    newHeader = epochObs.Header;
                    writer.WriteHeader(newHeader);
                }
                writer.WriteEpochObservation(EpochInfoToRinex.Build(obs));

                if (i > maxBufferEpoch)
                {
                    writer.Writer.Flush();
                }
            }
            writer.Writer.Close();

            processer.SatSequentialPeriod.SaveSatPeriodText(fileOutPath + "_CycleSlip.txt");
            File.WriteAllText(fileOutPath + "__cycleSlipPeriod.txt", processer.SatSequentialPeriod.ToFormatedString(), Encoding.UTF8);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 具体的执行
        /// </summary>
        /// <param name="inPath"></param>
        /// <param name="outPath"></param>
        protected override void Execute(string inPath, string outPath)
        {
            this.EphemerisDataSource = EphemerisDataSourceFactory.Create(CurrentParam.EphemerisPath);
            if (File.Exists(CurrentParam.ClockPath))
            {
                this.ClockFile = new Data.SimpleClockService(CurrentParam.ClockPath);
            }

            RinexFileObsDataSource obsDataSource = new RinexFileObsDataSource(inPath, true);
            GnssProcessOption      option        = GnssProcessOption.GetDefault(GnsserConfig, obsDataSource.ObsInfo);

            DataSourceContext      DataSourceContext = DataSourceContext.LoadDefault(option, obsDataSource, this.EphemerisDataSource, ClockFile);
            EpochInfoReviseManager reviser           = new EpochInfoReviseManager(DataSourceContext, option);

            //写入到流
            Gnsser.Data.Rinex.RinexObsFileWriter writer = new Data.Rinex.RinexObsFileWriter(outPath, CurrentParam.OutputVersion);
            EpochInfoToRinex EpochInfoToRinex           = new Domain.EpochInfoToRinex(this.CurrentParam.OutputVersion, true);

            //直接写入数据流,并不存储,以节约空间。
            Gnsser.Data.Rinex.RinexObsFileHeader newHeader = null;
            int maxBufferEpoch = 200;
            int i = 0;

            foreach (var item in obsDataSource)
            {
                //预处理在此进行!!!
                var processed = item;
                reviser.Revise(ref processed);

                if (processed != null)
                {
                    var epochObs = EpochInfoToRinex.Build(processed);
                    if (newHeader == null)
                    {
                        newHeader = epochObs.Header;
                        writer.WriteHeader(newHeader);
                    }

                    writer.WriteEpochObservation(epochObs);

                    if (i > maxBufferEpoch)
                    {
                        writer.Writer.Flush();
                    }
                }
                i++;
            }
            writer.Writer.Close();

            TimeSpan      span = DateTime.Now - startTime;
            StringBuilder sb   = new StringBuilder();

            sb.Append("耗时:" + DateTimeUtil.GetFloatString(span));
            sb.AppendLine(",输出到 " + outPath);

            //信息汇总
            lock (locker)
            {
                var path = Path.Combine(Path.GetDirectoryName(outPath), "PositionPreprocess.summery");

                Geo.Utils.FileUtil.CheckOrCreateDirectory(Path.GetDirectoryName(path));
                File.AppendAllText(path, sb.ToString());
            }
        }