예제 #1
0
        /// <summary>
        /// 获取观测数据的测站以及测站的所有doy
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        /// <summary>
        /// 读取观测值
        /// </summary>
        public void Read(string folder)
        {
            if (string.IsNullOrWhiteSpace(folder))
            {
                folder = Folder;
            }
            else
            {
                Folder = folder;
            }

            foreach (var station in DOYs.Keys)
            {
                OStation oSta = new OStation(station);
                oSta.ReadAllObs();
                oSta.SortObs();
                if (oSta.EpochNum > 0)
                {
                    oSta.StartTime = oSta.Epoches[0].Epoch;
                }
                Stations.Add(oSta);
            }

            foreach (var sta in Stations)
            {
                if (sta is null)
                {
                    continue;
                }

                Interval = sta.Interval;
                break;
            }
        }
예제 #2
0
파일: Orbit.cs 프로젝트: mfkiwl/GeoFun
        public void GetSatPos(ref OStation sta)
        {
            if (sta is null || sta.Epoches is null || sta.Epoches.Count == 0)
            {
                return;
            }

            OEpoch oe;

            for (int i = 0; i < sta.Epoches.Count; i++)
            {
                oe = sta.Epoches[i];
                GetSatPos(ref oe);
            }
        }
예제 #3
0
파일: Iono.cs 프로젝트: mfkiwl/GeoFun
 /// <summary>
 /// 单站模型
 /// </summary>
 public static void SingleStation(OStation station)
 {
 }
예제 #4
0
        /// <summary>
        /// 每几个历元输出一张图
        /// </summary>
        /// <param name="epoNum"></param>
        public void WriteTECMap(string outFolder, int epoNum = 10)
        {
            List <int> startIndex = new List <int>();

            GPST startTime = Stations.Min(s => s.StartTime);

            for (int i = 0; i < Stations.Count; i++)
            {
                OStation sta   = Stations[i];
                int      index = (int)Math.Floor(sta.StartTime.TotalSeconds - startTime.TotalSeconds + 0.1d);
                startIndex.Add(index);
            }

            GPST curStartTime = new GPST(startTime);
            GPST curEndTime   = new GPST(startTime);

            curEndTime.AddSeconds(epoNum * Interval);
            double          p4 = 0d;
            int             start = 0, end = epoNum;
            List <string[]> data = new List <string[]>();

            do
            {
                data = new List <string[]>();
                for (int i = 0; i < Stations.Count; i++)
                {
                    var sta = Stations[i];
                    if (startIndex[i] >= end)
                    {
                        continue;
                    }
                    if (startIndex[i] + sta.EpochNum <= start)
                    {
                        continue;
                    }

                    int epoNum1 = startIndex[i] < start ? start - startIndex[i] : 0;
                    int epoNum2 = end - startIndex[i];
                    for (int j = epoNum1; j < epoNum2; j++)
                    {
                        foreach (var sat in sta.Epoches[j].AllSat.Values)
                        {
                            p4 = sat["SP4"];
                            if (Math.Abs(p4) < 1e-10)
                            {
                                continue;
                            }

                            data.Add(new string[]
                            {
                                (sat.IPP[1] * Angle.R2D).ToString("#.##########"),
                                (sat.IPP[0] * Angle.R2D).ToString("#.##########"),
                                p4.ToString("f4")
                            });
                        }
                    }
                }

                // 写入文件
                //if (data.Count > 0)
                {
                    string fileName = string.Format("{0}{1:0#}{2:0#}{3:0#}{4:0#}{5:##.#}.{6}{7:0#}{8:0#}{9:0#}{10:0#}{11:##.#}.tec",
                                                    curStartTime.CommonT.Year,
                                                    curStartTime.CommonT.Month,
                                                    curStartTime.CommonT.Day,
                                                    curStartTime.CommonT.Hour,
                                                    curStartTime.CommonT.Minute,
                                                    curStartTime.CommonT.Second,
                                                    curEndTime.CommonT.Year,
                                                    curEndTime.CommonT.Month,
                                                    curEndTime.CommonT.Day,
                                                    curEndTime.CommonT.Hour,
                                                    curEndTime.CommonT.Minute,
                                                    curEndTime.CommonT.Second
                                                    );

                    string filePath = Path.Combine(outFolder, fileName);
                    FileHelper.WriteLines(filePath, data, ',');

                    curStartTime.AddSeconds(epoNum * Interval);
                    curEndTime.AddSeconds(epoNum * Interval);
                }

                start += epoNum;
                end   += epoNum;
            }while (data.Count > 0);
        }
예제 #5
0
        public static List <OArc> Detect(OStation sta, string prn, int minArcLen = -1)
        {
            if (sta is null)
            {
                return(null);
            }
            if (minArcLen < 0)
            {
                minArcLen = Options.ARC_MIN_LENGTH;
            }

            List <OArc> arcs = new List <OArc>();

            int    start = -1;
            double l1, l2, p1, p2, c1;

            for (int i = 0; i < sta.EpochNum; i++)
            {
                bool flag = true;
                if (!sta.Epoches[i].AllSat.ContainsKey(prn))
                {
                    flag = false;
                }
                else
                {
                    l1 = sta.Epoches[i][prn]["L1"];
                    l2 = sta.Epoches[i][prn]["L2"];
                    p1 = sta.Epoches[i][prn]["P1"];
                    p2 = sta.Epoches[i][prn]["P2"];
                    c1 = sta.Epoches[i][prn]["C1"];

                    if (l1 == 0 || l2 == 0 || p2 == 0)
                    {
                        flag = false;
                    }
                    else if (p1 == 0 && c1 == 0)
                    {
                        flag = false;
                    }
                    else if (sta.Epoches[i][prn].Outlier)
                    {
                        flag = false;
                    }
                    else if (sta.Epoches[i][prn].CycleSlip)
                    {
                        flag = false;
                    }
                }

                if (flag)
                {
                    // 弧段继续
                    if (start > -1)
                    {
                        continue;
                    }
                    // 弧段开始
                    else
                    {
                        start = i;
                    }
                }
                else
                {
                    // 弧段结束
                    if (start > -1)
                    {
                        if (i - start > minArcLen)
                        {
                            OArc arc = new OArc();
                            arc.StartIndex = start + 10;
                            arc.EndIndex   = i - 1 - 10;
                            arc.Station    = sta;
                            arc.PRN        = prn;
                            arcs.Add(arc);
                        }
                        start = -1;
                    }
                    else
                    {
                        continue;
                    }
                }
            }

            return(arcs);
        }