/// <summary> /// 检查数据DOY是否连续 /// </summary> public bool CheckDOY() { bool flag = true; if (DOYs.Count < 2) { return(true); } // 检查数据某天是否缺失 for (int i = 1; i < DOYs.Count; i++) { int dayNum = DOYs[i] - DOYs[i - 1]; // 有缺失 if (dayNum > 1) { for (int j = 0; j < dayNum - 1; j++) { DOY doy = DOYs[i - 1].AddDays(j + 1); OFile file = OFile.CreateEmptyFile(Name, doy.Year, doy.Day, 30); OFiles.Add(file); } } } return(flag); }
public void GetAllSp3Files(string folder = null, int start = -1, int end = -2) { if (start < 0 || end < 0) { return; } GetAllSp3Files(folder, DOY.FromInt(start), DOY.FromInt(end)); }
public void GetAllSp3Files(string folder = null, DOY start = null, DOY end = null) { if (folder == null) { folder = Folder; } else { Folder = folder; } DirectoryInfo dir = new DirectoryInfo(folder); if (!dir.Exists) { return; } var paths = dir.GetFiles("*.sp3"); if (paths.Length == 0) { return; } foreach (var path in paths) { string center; int week, dow; FileName.ParseSP3Name(path.Name, out center, out week, out dow); int year, doy; Time.GPS2DOY(week, dow, out year, out doy); DOY fileDOY = new DOY(year, doy); if (start != null) { if (fileDOY < start) { continue; } } if (end != null) { if (fileDOY > end) { continue; } } Files.Add(new SP3File(path.FullName)); } Files.Sort((left, right) => { if ((left.Week == right.Week) && (left.DayOfWeek == right.DayOfWeek)) { return(-1); } else if (left.Week < right.Week) { return(0); } else if ((left.Week == right.Week) && (left.DayOfWeek < right.DayOfWeek)) { return(0); } else { return(1); } }); // 星历不连续 if (!CheckConsist()) { return; } }
public void Read(string folder, int doyStart, int doyEnd) { GetAllSp3Files(folder, DOY.FromInt(doyStart), DOY.FromInt(doyEnd)); Read(folder); }