Exemple #1
0
        public void DetectCycleSlipTest()
        {
            OStation station = new OStation("fjpt");

            station.ReadAllObs();
            station.DetectCycleSlip();
        }
Exemple #2
0
        /// <summary>
        /// 逐个测站解算,耗内存小
        /// </summary>
        public void ResolveSingleStationMultiDay()
        {
            var staNames = GetStationNames(obsFolder);

            if (staNames.Count <= 0)
            {
                return;
            }
            if (SetProgressMax != null)
            {
                SetProgressMax(staNames.Count);
            }


            for (int i = 0; i < staNames.Count; i++)
            {
                try
                {
                    if (SetProgressValue != null)
                    {
                        SetProgressValue(i + 1);
                    }

                    var staName = staNames[i];
                    Print(string.Format("\r\n\r\n开始解算第{0}个测站,共{1}个:{2}", i + 1, staNames.Count, staName));
                    PrintWithTime("正在搜索观测文件...");

                    OStation sta = new OStation(staName);
                    sta.SearchAllOFiles(obsFolder);
                    PrintWithTime(string.Format("共找到{0}个文件:", sta.FileNum));
                    for (int j = 0; j < sta.OFiles.Count; j++)
                    {
                        Print(string.Format("\r\n    {0} {1}", j + 1, sta.OFiles[j].Path));
                    }
                    if (sta.FileNum <= 0)
                    {
                        return;
                    }

                    if (!sta.CheckDataConsist())
                    {
                        PrintWithTime("错误!本站数据不连续");
                        continue;
                    }

                    PrintWithTime("正在下载辅助文件...");
                    if (!Download(sta.DOYs))
                    {
                        PrintWithTime("错误!下载辅助文件失败");
                    }

                    PrintWithTime("读取星历文件...");
                    Orb = new Orbit(orbFolder);
                    Orb.GetAllSp3Files(orbFolder, sta.StartDOY, sta.EndDOY);
                    Orb.Read(orbFolder);

                    PrintWithTime("读取观测文件...");
                    sta.ReadAllObs();
                    sta.SortObs();

                    PrintWithTime(string.Format("共读取到{0}个历元", sta.EpochNum));
                    if (sta.EpochNum > 0)
                    {
                        sta.StartTime = sta.Epoches[0].Epoch;
                    }
                    else
                    {
                        return;
                    }

                    PrintWithTime("计算卫星轨道...");
                    for (int j = 0; j < sta.EpochNum; j++)
                    {
                        OEpoch oepo = sta.Epoches[j];
                        Orb.GetSatPos(ref oepo);
                    }
                    PrintWithTime("\r\n穿刺点计算...");
                    sta.CalAzElIPP();

                    PrintWithTime("粗差探测...");
                    sta.DetectOutlier();
                    PrintWithTime("弧段探测...");
                    sta.DetectArcs();
                    PrintWithTime("周跳探测...");
                    sta.DetectCycleSlip();
                    PrintWithTime("相位平滑伪距计算...");
                    sta.SmoothP4();
                    if (FitType == enumFitType.None)
                    {
                        sta.CalVTEC();
                        PrintWithTime(string.Format("{0}观测值写入文件", "sp4"));
                        sta.WriteMeas(resFolder, "SP4");
                    }
                    else if (FitType == enumFitType.Polynomial)
                    {
                        PrintWithTime("VTEC计算...");
                        sta.CalVTEC();
                        PrintWithTime("多项式拟合计算...");
                        sta.Fit();
                        PrintWithTime(string.Format("{0}观测值写入文件", "vtec"));
                        sta.WriteMeas(resFolder, "vtec");
                        PrintWithTime(string.Format("{0}观测值写入文件", "dtec"));
                        sta.WriteMeas(resFolder, "dtec");
                    }
                    else if (FitType == enumFitType.Smooth)
                    {
                        PrintWithTime("VTEC计算...");
                        sta.CalVTEC();
                        PrintWithTime("滑动平均计算...");
                        sta.Smooth();
                        PrintWithTime(string.Format("{0}观测值写入文件", "vtec"));
                        sta.WriteMeas(resFolder, "vtec");
                        PrintWithTime(string.Format("{0}观测值写入文件", "dtec"));
                        sta.WriteMeas(resFolder, "dtec");
                    }
                    else if (FitType == enumFitType.DoubleDifference)
                    {
                        PrintWithTime("二阶差分计算...");
                        sta.DoubleDiff();
                        PrintWithTime(string.Format("{0}观测值写入文件", "l6"));
                        sta.WriteMeas1(resFolder, "L6");
                    }
                    else if (FitType == enumFitType.ROTI)
                    {
                        PrintWithTime("计算ROTI...");
                        sta.ROTI();
                        PrintWithTime(string.Format("{0}观测值写入文件", "l6"));
                        sta.WriteMeas(resFolder, "roti");
                    }
                }
                catch (Exception e)
                {
                    PrintWithTime("未知异常(" + e.ToString() + ")");
                    continue;
                }
            }
        }