private string[] QueryPrds2dataset(string sensor) { ConnectMySqlCloud con = new ConnectMySqlCloud(); if (sensor.ToUpper() == "MOD06") { this.combxYears.Items.Clear(); for (int i = 2000; i <= DateTime.Now.Year; i++) { this.combxYears.Items.Add(i.ToString()); } return(con.QueryMOD06setsWithPrdsID()); } else if (sensor.ToUpper() == "MYD06") { this.combxYears.Items.Clear(); for (int i = 2000; i <= DateTime.Now.Year; i++) { this.combxYears.Items.Add(i.ToString()); } return(con.QueryMYD06setsWithPrdsID()); } else if (sensor.ToUpper() == "AIRS") { this.combxYears.Items.Clear(); for (int i = 2002; i <= DateTime.Now.Year; i++) { this.combxYears.Items.Add(i.ToString()); } return(con.QueryAIRSsetsWithPrdsID()); } return(null); }
//Initialize values private DBConnect() { //UserPreferences config = UserPreferences.GetInstance(); //StringBuilder connectionString = new StringBuilder(); //connectionString.Append("SERVER=").Append(config.Server).Append(";"); //connectionString.Append("DATABASE=").Append(config.Database).Append(";"); //connectionString.Append("UID=").Append(config.Uid).Append(";"); //connectionString.Append("PASSWORD="******";"); //_connection = new MySqlConnection(connectionString.ToString()); _connection = new ConnectMySqlCloud(); }
public PeriodicSynPrds2Base(string dir, string logfName, ConnectMySqlCloud dbConnect) { _inputDIR = dir; _logfName = logfName; //_dbxml = dbxml; _dbConnect = dbConnect; _statName2ID.Add("MAX", 1); _statName2ID.Add("MIN", 2); _statName2ID.Add("AVG", 3); _periodTypeID.Add("day", 2); _periodTypeID.Add("ten", 3); _periodTypeID.Add("month", 4); _periodTypeID.Add("year", 5); }
private void InitSetting() { _data2DBTable.Add("ISCCP", "cp_isccpd2_tb"); _data2DBTable.Add("MODIS", "cp_modismod06_tb"); _data2DBTable.Add("AIRS", "cp_airs_tb"); _data2DBTable.Add("CLOUDSAT", "cp_cloudsat_tb"); _data2DBTable.Add("日拼接产品", "cp_daymergeproducts_tb"); _data2DBTable.Add("周期合成产品", "cp_periodicsynthesis_tb"); if (!File.Exists(_dataBaseXml)) { MessageBox.Show("数据库配置文件不存在,请先配置数据库!"); return; } _DBcon = new ConnectMySqlCloud(_dataBaseXml); arg = DataBaseArg.ParseXml(_dataBaseXml); _dataDocDir = arg.OutputDir; }
public static void DayMergePrdsUnContinuty2Base(string setName, Dictionary <string, List <DateTime> > lostMosaicDayPrds) { string sat = "AQUA", sensor = "AIRS", region; ConnectMySqlCloud con = new ConnectMySqlCloud(); long prdID; if (con.QueryPrdID(sensor, setName, out prdID)) { foreach (string reg in lostMosaicDayPrds.Keys) { region = reg; foreach (DateTime da in lostMosaicDayPrds[reg]) { con.InsertPrdsDataTimeContinutyTable(prdID, setName, da, sat, sensor, region); } } } }
private void btnTestLink_Click(object sender, EventArgs e) { ConnectMySqlCloud con = new ConnectMySqlCloud(txtserver.Text, txtDatabase.Text, txtAccount.Text, txtpassword.Text); try { if (con.ConnOpend() || con.OpenConn()) { MessageBox.Show("链接数据库成功!"); } else { MessageBox.Show("链接数据库失败!请确认服务已开启并输入正确的参数!"); } } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }
public AIRSDataProcesser(string inputDir, string outputDir, string[] dataSets, float resl, PrjEnvelopeItem[] prjEnvelopes, bool overlapPrj, bool overlapMosaic, bool isdirectmosaic = false, bool isonlyprj = false) { _inputDir = inputDir; _outputDir = outputDir; _pro._outputDir = _outputDir; _dataSets = dataSets;//选择的数据集 _resl = resl; _prjEnvelopes = prjEnvelopes; _overlapPrj = overlapPrj; _overlapMosaic = overlapMosaic; _isDirectMosaic = isdirectmosaic; _isOnlyPrj = isonlyprj; if (File.Exists(_dataBaseXml)) { _dbCon = new ConnectMySqlCloud(); } else { MessageBox.Show("无法读取数据库配置文件,请先设置数据库连接配置文件!"); } }
public OriginData2Database(string inputDir, Dictionary <string, List <string> > originFiles2Base, bool isOverrideRecord, Action <string> calProBack) { InitializeComponent(); _uniformOriginFiles = originFiles2Base; _inputDir = inputDir; _isOverrideRecord = isOverrideRecord; _dbConnect = new ConnectMySqlCloud(); _calProBack = calProBack; if (File.Exists(_path)) { InputArg arg = InputArg.ParseXml(_path); if (arg != null && arg.ValidEnvelopes != null && arg.ValidEnvelopes.Length > 0) { _chinaENV = arg.ValidEnvelopes[0].PrjEnvelope; } } if (_chinaENV == null) { _chinaENV = new RasterProject.PrjEnvelope(65, 145, 10, 60); } }
private void InitTask() { CheckFrmMode(); Load += new EventHandler(frmMod06DataPro_Load); lstRegions.SelectedIndexChanged += new EventHandler(lstRegionsSelectedIndexChanged); if (File.Exists(_dataBaseXml)) { _dbcon = new ConnectMySqlCloud(); DataBaseArg arg = DataBaseArg.ParseXml(_dataBaseXml); if (_frmMode.ToUpper() == "MOD06" || _frmMode.ToUpper() == "MYD06") { _outputDir = arg.OutputDir; } else { _outputDir = arg.AIRSRootPath; } txtOutDir.Text = _outputDir; txtHistoryPrj.Text = _outputDir; } Control.CheckForIllegalCrossThreadCalls = false;//关闭该异常检测的方式来避免异常的出现 _state = new Action <int, string>(InvokeProgress); }
private void InitInterface() { InitializeComponent(); _con = new ConnectMySqlCloud(); ucRadioBoxListProducts.CheckedChanged += new EventHandler(ucRadioBoxList1_CheckedChanged); }
public void Compute(Action <int, string> progressCallback) { if (progressCallback != null) { progressCallback(1, "周期合成开始,链接数据库..."); } if (File.Exists(_dataBaseXml)) { _con = new ConnectMySqlCloud(); } else { return; } _periodicsyn = new PeriodicSynPrds2Base(_args.InputDir, "周期合成入库", _con); _statics = _args.StatisticsTypes;//统计类型 string[] periods = _args.PeriodTypes; _inputDataPath = Path.Combine(_args.InputDir, "日拼接产品"); _overwritefiles = _args.OverWriteHistoryFiles; if (!Directory.Exists(_inputDataPath)) { MessageBox.Show("配置的输入文件目录不存在!请重试!"); return; } string outputdir = Path.Combine(_args.OutputDir, "周期合成产品"); if (!Directory.Exists(outputdir)) { Directory.CreateDirectory(outputdir); } DirectoryInfo dir = new DirectoryInfo(_inputDataPath); List <string> childPath = new List <string>(); //日拼接产品\Cloud_Effective_Emissivity\AQUA\MODIS\2011\1\day或nigh\resl int al = dir.GetDirectories("*").Length; if (al == 0) { return; } float interval = 99 / al; int i = -1; foreach (DirectoryInfo dChild in dir.GetDirectories("*")) { i++; childPath.Add(dChild.FullName); //存放每个子产品 string setName = dChild.Name; double filvalue, invalidvalue, setfill; if (!_con.QueryDatasetsInvalidValue(_dataOrigin, setName, out setfill, out filvalue, out invalidvalue)) { continue; } if (progressCallback != null) { progressCallback((int)(i * interval) + 1, "开始扫描" + dChild.FullName + "的待处理文件..."); } RasterStatics sta = new RasterStatics(); sta.SetDstFillValues(filvalue.ToString()); sta.SetDstInvalidValues(invalidvalue.ToString()); string dayfileformat = "*{0}*{1}*.ldf"; string[] danightlabels = new string[2] { "day", "night" }; foreach (string label in danightlabels) { string[] parafiles = Directory.GetFiles(dChild.FullName, string.Format(dayfileformat, _dataOrigin, label), SearchOption.AllDirectories); if (parafiles.Length == 0) { continue; } //按月进行分组 Dictionary <string, List <string> > monthFiles = new Dictionary <string, List <string> >(); foreach (string file in parafiles.ToArray()) { string path = Path.GetDirectoryName(file); if (!monthFiles.ContainsKey(path)) { monthFiles.Add(path, new List <string>(new string[1] { file })); } else { monthFiles[path].Add(file); } } //旬文件名,产品类型_MOD06_region_旬产品_yyyy-mm-N_MAX/MIN/AVG_day或night_0.05.LDF Dictionary <string, string> dirxunlist = new Dictionary <string, string>(); //将数据按区域进行分组; float m = -1; int ml = monthFiles.Keys.Count; foreach (string monthdir in monthFiles.Keys) { int start = monthdir.LastIndexOf("\\") + 1; string resl = monthdir.Substring(start, monthdir.Length - start); string dirXun = "{0}\\{1}\\{2}\\{3}\\{4}\\{5}"; dirXun = string.Format(dirXun, dir.Parent.FullName, "周期合成产品", dChild.Name, _satellite, _sensor, label + "\\" + resl + "\\Ten"); if (!dirxunlist.ContainsKey(dirXun)) { dirxunlist.Add(dirXun, resl); } m++; Dictionary <string, List <string> > regionFiles = new Dictionary <string, List <string> >(); foreach (string file in monthFiles[monthdir]) { string fileName = Path.GetFileNameWithoutExtension(file); string[] parts = fileName.Split('_'); if (parts.Length != 6) { continue; } string region = parts[2]; if (!regionFiles.ContainsKey(region)) { regionFiles.Add(region, new List <string>(new string[1] { file })); } else { regionFiles[region].Add(file); } } if (progressCallback != null) { progressCallback((int)(interval * (i + m / ml * 0.5)) + 1, "正在处理" + monthdir + "的旬产品..."); } ComputeTenPeriodSyn(setName, dirXun, regionFiles, sta, resl, progressCallback, label); } string dirnext; if (periods.Contains("MONTH")) { if (dirxunlist.Count < 1) { continue; } int xlength = dirxunlist.Count; int xcur = 0; foreach (string dirXun in dirxunlist.Keys) { string resl = dirxunlist[dirXun]; string flabel = string.Format("_{0}_{1}.LDF", label, resl); if (progressCallback != null) { progressCallback((int)(interval * (i * 1.0 / xlength * xcur++ + 0.5)) + 1, "正在处理" + dirXun + "的月产品..."); } UpdateDataNext(dirXun, "Ten", "Month", out dirnext, sta, progressCallback, flabel); if (periods.Contains("YEAR")) { if (progressCallback != null) { progressCallback((int)(interval * (i * 1.0 / xlength * xcur + 0.8)) + 1, "正在处理" + dirnext + "的年产品..."); } UpdateDataNext(dirnext, "Month", "Year", out dirnext, sta, progressCallback, flabel); } } } } } if (progressCallback != null) { progressCallback(100, "周期合成完成!"); } return; }
private void DoProcess() { if (_originFiles2Base.Count != 0) { _originFiles2Base.Clear(); } if (cbxPrdsLevl.SelectedIndex == 0)//原始数据 { try { string subdataDocDir = Path.Combine(_dataDocDir, "原始数据"); #region 原始数据入库 //_logfName = "RawData2Database"; if (radiMODIS.Checked) { GetMODOriginDataFiles(_state); if (!_originFiles2Base.Keys.Contains("MOD06") || _originFiles2Base["MOD06"].Count < 1) { txtErrorLog.Text += "当前路径不存在可入库的MODIS数据!\r\n"; } } else if (radiAIRS.Checked) { GetAIRSOriginDataFiles(_state); if (!_originFiles2Base.Keys.Contains("AIRS") || _originFiles2Base["AIRS"].Count < 1) { txtErrorLog.Text += "当前路径不存在可入库的AIRS数据!\r\n"; } } else if (radiISCCP.Checked) { GetISCCPOriginDataFiles(_state); if (_originFiles2Base.Keys.Contains("ISCCP")) { if (_state != null) { _state("共计" + _originFiles2Base["ISCCP"].Count + "个待入库ISCCP文件!"); } else { txtErrorLog.Text += "共计" + _originFiles2Base["ISCCP"].Count + "个待入库ISCCP文件!\r\n"; } } } else if (radiCloudSAT.Checked) { GetCloudSATOriginDataFiles(_state); if (!_originFiles2Base.Keys.Contains("CloudSAT") || _originFiles2Base["CloudSAT"].Count < 1) { txtErrorLog.Text += "当前路径不存在可入库的CloudSAT数据!\r\n"; } } if (_originFiles2Base.Count == 0) { MessageBox.Show("当前目录不存在可入库的文件!请重新选择"); return; } #region 数据归档 //Dictionary<string, List<string>> uniformOriginFiles = new Dictionary<string, List<string>>(); //foreach (string mode in _originFiles2Base.Keys) //{ // if (_state != null) // _state(string.Format("正在归档{0}数据,请稍候...", mode)); // List<string> unifiles = FileToDatabase.Files2UniformDir(_originFiles2Base[mode], _dataDocDir, mode, _state); // uniformOriginFiles.Add(mode, unifiles); //} #endregion try { OriginData2Database OriDbase = new OriginData2Database(subdataDocDir, _originFiles2Base, cbxOverrideRecord.Checked, _state); OriDbase.IsFiles2UniformDir = cbxData2DocDir.Checked; OriDbase._DocDir = _dataDocDir; runTaskThread1 = new Thread(new ThreadStart(OriDbase.CheckFile2Table)); runTaskThread1.IsBackground = true; if (_state != null) { _state(string.Format("开始将数据归档并入库,请稍候...")); } runTaskThread1.Start(); } catch (System.Exception ex) { _state(ex.Message); return; } #endregion } catch (System.Exception ex) { _state(ex.Message); return; } } else if (cbxPrdsLevl.SelectedIndex == 1)//历史日产品数据 { #region 日产品数据入库 string fileFilter, sensor; if (radiAIRS.Checked) { fileFilter = "*AIRS*day*.ldf";//文件名的格式有待确认 sensor = "AIRS"; } else { fileFilter = "mod06_*_*.dat";//文件名的格式有待确认 sensor = "MODIS"; } List <string> dayprdsfiles = Directory.GetFiles(_inputDir, fileFilter, SearchOption.AllDirectories).ToList(); //归档; //从文件名中解析数据的时间信息、数据集信息、区域信息、分辨率信息、日夜标识信息 //拼接生成数据的归档路径,对数据按照现有的规则进行重命名;//日拼接产品\CloudTopTemperature\TERRA\MODIS\2011\1\day\0.05 List <string> unidayprdsfiles = new List <string>(); //string newfnameformat = "{0}_MOD06_china_day_{1}_0.01.dat"; string newfname = ""; foreach (string oldfile in dayprdsfiles) { //mod06_20131201_CMLF.dat //CloudOpticalThickness_MOD06_china_day_20110101_0.01.LDF System.IO.File.Move(oldfile, newfname); } //入库---注意数据中的无效值问题 //需要查询数据集对应的产品ID及数据集ID,regionID, //double selfFillValue = _selfFillValue[setName]; //double dayFillValue = _dayFillValue[setName]; //double dayInvalidValue = _dayInvalidValue[setName]; //重新计算有效百分比,granulesCount/granulesTimes、日夜标识DataSource #region 入库 //归档路径 string tableName = "CP_DayMergeProducts_TB"; ConnectMySqlCloud dbcon = new ConnectMySqlCloud(_dataBaseXml); string setName, imagedata, regionName, fname; float resl; double invalidValue = 32767; int validPercent, regionID = 1;; long prdID, datasetID = 0; string datasource = ""; string[] parts; DateTime fdate; DataProcesser datapro = new DataProcesser(); foreach (string newFileName in unidayprdsfiles) { imagedata = newFileName.Replace(_dataDocDir, ""); fname = Path.GetFileNameWithoutExtension(newFileName); parts = fname.Split('_'); if (parts.Length != 6) { continue; } setName = parts[0]; if (!dbcon.QueryDatasetsID(sensor, setName, out prdID, out datasetID)) { continue; } regionName = parts[2]; if (!dbcon.QueryRegionID(regionName, out regionID)) { } if (parts[3].ToLower() == "day") { datasource = "D"; } else { datasource = "N"; } //fdate =DataProcesser.getDayTime(newFileName); fdate = DateTime.TryParseExact(Path.GetFileNameWithoutExtension(newFileName).Split('_')[4], "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture, System.Globalization.DateTimeStyles.None, out fdate) ? fdate : DateTime.MinValue; validPercent = ComputeValidPercent(datapro, newFileName, invalidValue, out resl); if (!dbcon.IshasRecord(tableName, "ImageName", Path.GetFileName(newFileName))) { dbcon.InsertNDayMergeProductsTable(fdate, prdID, datasetID, imagedata, regionID, regionName, sensor, resl, validPercent, 0, "", datasource); _state(newFileName + "入库完成!"); } else { dbcon.DeleteCLDParatableRecord(tableName, "ImageName", Path.GetFileName(newFileName)); dbcon.InsertNDayMergeProductsTable(fdate, prdID, datasetID, imagedata, regionID, regionName, sensor, resl, validPercent, 0, "", datasource); _state(newFileName + "入库更新完成!"); } } #endregion #endregion } else if (cbxPrdsLevl.SelectedIndex == 2)//周期合成产品 { //PeriodicSynPrds2Base psp = new PeriodicSynPrds2Base(_inputDir, _logfName, _dataBaseXml); //psp.StartComp(); } }
public void Compute(Action <int, string> progressCallback) { if (File.Exists(_dataBaseXml)) { _con = new ConnectMySqlCloud(); } else { if (progressCallback != null) { progressCallback(-1, "数据库配置文件" + @"\SystemData\ProductArgs\CLD\CPDataBaseArgs.xml" + "不存在!"); } return; } _periodicsyn = new PeriodicSynPrds2Base(_args.InputDir, "周期合成入库", _con); _statics = _args.StatisticsTypes;//统计类型 _overwritefiles = _args.OverWriteHistoryFiles; string[] periods = null; if (_periodPrdsArgs == "YEAR") { periods = new string[3] { "YEAR", "MONTH", "TEN" } } ; else if (_periodPrdsArgs == "MONTH") { periods = new string[2] { "MONTH", "TEN" } } ; //string[] periods = _args.PeriodTypes; _inputDataPath = Path.Combine(_args.InputDir, "日拼接产品"); if (!Directory.Exists(_inputDataPath)) { if (progressCallback != null) { progressCallback(-1, "输入文件目录" + _inputDataPath + "不存在!请重试!"); } return; } if (progressCallback != null) { progressCallback(-1, "输入文件夹:" + _inputDataPath); } string outputdir = Path.Combine(_args.OutputDir, "周期合成产品"); if (progressCallback != null) { progressCallback(-1, "输出文件夹:" + outputdir); } if (!Directory.Exists(outputdir)) { Directory.CreateDirectory(outputdir); } //日拼接产品\CloudEffectiveEmissivity\TERRA\MODIS\2011\1\day或night\resl int al = _validsets.Length; if (al == 0) { return; } float interval = 99 / al / 2; int i = -1, pp; string childpath; List <string> childPath = new List <string>(); foreach (string set in _validsets) { i++; pp = i + 1; string setName = set.Replace("_", ""); double filvalue, invalidvalue, setfill; //childpath = Path.Combine(_inputDataPath, set.Replace("_", "")); childpath = Path.Combine(new string[] { _inputDataPath, set.Replace("_", ""), _satellite, _sensor, _singleyear.ToString() }); if (progressCallback != null) { progressCallback((int)(i * interval * 2) + 1, "共" + _validsets.Length + "个数据集,开始处理第" + pp + "个," + set + ",文件夹:" + childpath); } if (progressCallback != null) { progressCallback(-1, "\t链接数据库,查询数据集ID及无效值..."); } if (!_con.QueryDatasetsID(_dataOrigin, setName, out _prdID, out _datasetID))//_sensor { if (progressCallback != null) { progressCallback(-1, "\t链接数据库,查询数据集ID失败!"); } continue; } if (!_con.QueryDatasetsInvalidValue(_dataOrigin, setName, out setfill, out filvalue, out invalidvalue))//_sensor { if (progressCallback != null) { progressCallback(-1, "\t链接数据库,查询数据集无效值失败!"); } continue; } RasterStatics sta = new RasterStatics(); sta.SetDstFillValues(filvalue.ToString()); sta.SetDstInvalidValues(invalidvalue.ToString()); //sta.SetDstInvalidValues("0"); #region 原有算法 string dayfileformat = null; //CloudFractionDay_MOD06_china_day_20060101_0.05.LDF string[] danightlabels = new string[2] { "day", "night" }; int dnc = 0, kk; foreach (string label in danightlabels) { if (progressCallback != null) { progressCallback((int)(interval * (i + dnc++ / 2.0f)) + 1, "\t开始扫描数据集" + set + "的" + _singleyear + "年的" + label + "文件..."); } kk = dnc; //CloudFractionDay_MOD06_china_day_20060101_0.05.LDF DirectoryInfo yearDirInfo = new DirectoryInfo(childpath); int monthCount = yearDirInfo.GetDirectories().Length; if (progressCallback != null) { progressCallback(-1, "\t共" + monthCount + "个月待处理..."); } if (monthFiles != null) { monthFiles.Clear(); } dayfileformat = string.Format("{0}*{1}*{2}_{3}*.ldf", setName, _dataOrigin, label, _singleyear); foreach (DirectoryInfo d in yearDirInfo.GetDirectories()) //查找子目录,月 { //日拼接产品\CloudEffectiveRadius\TERRA\MODIS\2006\1\day\0.01 if (progressCallback != null) { progressCallback(-1, "\t开始扫描" + _singleyear + "年" + d.Name + "月的旬文件..."); } TryComputeXunFiles(Path.Combine(yearDirInfo.FullName, d.ToString()), dayfileformat, progressCallback); } //string[] parafiles = Directory.GetFiles(childpath, string.Format(dayfileformat, setName,_dataOrigin, label,_singleyear), SearchOption.AllDirectories); //if (parafiles.Length == 0) //{ // if (progressCallback != null) // progressCallback(-1, "\t没有符合数据集" + set + "的" + _singleyear + "年的" + label + "的文件!"); // continue; //} ////按月进行分组 //Dictionary<string, List<string>> monthFiles = new Dictionary<string, List<string>>(); //foreach (string file in parafiles.ToArray()) //{ // string path = Path.GetDirectoryName(file); // if (!path.Replace(childpath, "").Contains("\\" + _singleyear.ToString() + "\\")) // continue; // if (!monthFiles.ContainsKey(path)) // monthFiles.Add(path, new List<string>(new string[1] { file })); // else // monthFiles[path].Add(file); //} //if (progressCallback != null) // progressCallback(-1, "\t共" + monthFiles.Count + "个月的" + parafiles.Length + "个日拼接文件..."); //旬文件名,产品类型_MOD06_region_旬产品_yyyy-mm-N_MAX/MIN/AVG_day或night_0.05.LDF Dictionary <string, string> dirxunlist = new Dictionary <string, string>(); //将数据按区域进行分组; float m = -1; int ml = monthFiles.Keys.Count; if (ml == 0) { if (progressCallback != null) { progressCallback(-1, "\t没有符合数据集" + set + "的" + _singleyear + "年的" + label + "文件!"); } continue; } string[] monthdirparts = null; float reslf = 0; foreach (string monthdir in monthFiles.Keys) { int start = monthdir.LastIndexOf("\\") + 1; string resl = monthdir.Substring(start, monthdir.Length - start); monthdirparts = monthdir.Split('\\'); if (!float.TryParse(monthdirparts[monthdirparts.Length - 1], out reslf) || !danightlabels.Contains(monthdirparts[monthdirparts.Length - 2].ToLower())) { continue; } string dirXun = "{0}\\{1}\\{2}\\{3}\\{4}"; dirXun = string.Format(dirXun, outputdir, set.Replace("_", ""), _satellite, _sensor, label + "\\" + resl + "\\Ten"); if (!dirxunlist.ContainsKey(dirXun)) { dirxunlist.Add(dirXun, resl); } m++; Dictionary <string, List <string> > regionFiles = new Dictionary <string, List <string> >(); foreach (string file in monthFiles[monthdir]) { string fileName = Path.GetFileNameWithoutExtension(file); string[] parts = fileName.Split('_'); //CloudMultiLayerFlag_MOD06_china_day_20110101_0.01.LDF if (parts.Length < 6) { continue; } string region = parts[2]; if (!regionFiles.ContainsKey(region)) { regionFiles.Add(region, new List <string>(new string[1] { file })); } else { regionFiles[region].Add(file); } } if (progressCallback != null) { progressCallback((int)(interval * (i + kk / 2.0f + m / ml * 0.8)) + 1, "\t\t正在合成" + monthdir + "的旬产品..."); } ComputeTenPeriodSyn(setName, dirXun, regionFiles, sta, resl, progressCallback, label); } string dirnext; if (periods.Contains("MONTH")) { if (dirxunlist.Count < 1) { continue; } if (progressCallback != null) { progressCallback(-1, "\t开始合成" + setName + "的" + _singleyear + "年" + label + "的月产品..."); } int xlength = dirxunlist.Count; int xcur = 0; foreach (string dirXun in dirxunlist.Keys) { string resl = dirxunlist[dirXun]; string flabel = string.Format("_{0}_{1}.LDF", label, resl); if (progressCallback != null) { progressCallback((int)(interval * (i + kk / 2.0f + xcur++ / (1.0f * xlength) * 0.2 + 0.8)) + 1, "\t\t正在合成" + dirXun + "的月产品..."); } UpdateDataNext(dirXun, "Ten", "Month", out dirnext, sta, progressCallback, flabel); if (periods.Contains("YEAR")) { if (progressCallback != null) { progressCallback(-1, "\t\t正在合成" + dirnext + "的年产品..."); } UpdateDataNext(dirnext, "Month", "Year", out dirnext, sta, progressCallback, flabel); } } } } #endregion } if (progressCallback != null) { progressCallback(100, "周期合成完成!"); } return; }