private void AddStatistics(SeriesList wyList) { bool anyStats = checkBoxMax.Checked || checkBoxMin.Checked || checkBoxAvg.Checked; if (!anyStats) { return; } int y1 = 1990; int y2 = 2011; int.TryParse(this.textBoxWY1.Text, out y1); int.TryParse(this.textBoxWY2.Text, out y2); DateTime t1 = new DateTime(y1 - 1, 10, 1); DateTime t2 = new DateTime(y2, 9, 30); var server = HydrometInfoUtility.HydrometServerFromPreferences(); Series s = new HydrometDailySeries(comboBoxCbtt.Text.Trim(), DeterminePcode(), server); s.Read(t1, t2); s.RemoveMissing(); s.Appearance.LegendText = ""; YearRange yr = new YearRange(2000, 10); var list = Math.SummaryHydrograph(s, new int[] { }, yr.DateTime1, checkBoxMax.Checked, checkBoxMin.Checked, checkBoxAvg.Checked, false); //, false); wyList.Add(list); }
public SeriesList SummaryHydrograph(int[] exceedanceLevels, DateTime beginningDate, bool max, bool min, bool avg, bool removeEmptySeries)//, bool removeFeb29) { SeriesList rval = new SeriesList(); foreach (Series s in this) { SeriesList list = Math.SummaryHydrograph(s, exceedanceLevels, beginningDate, max, min, avg, removeEmptySeries);//,removeFeb29); rval.AddRange(list); } return(rval); }
private static Series Get30YearAverageSeries(string cbtt, string pcode, int forecastMonth) { var t1 = HydrometDataUtility.T1Thirty; var t2 = HydrometDataUtility.T2Thirty; var s2 = new HydrometDailySeries(cbtt, pcode, HydrometHost.PNLinux); s2.Read(t1, t2); DateTime t = new DateTime(2018, forecastMonth, 1); var list = Math.SummaryHydrograph(s2, new int[] { }, t, false, false, true, false); return(list[0]); }
private void AddStatistics(SeriesList wyList) { bool anyStats = checkBoxMax.Checked || checkBoxMin.Checked || checkBoxAvg.Checked || checkBoxPctls.Checked; if (!anyStats) { return; } int y1 = 1990; int y2 = 2011; int[] pctls = new int[] { }; int.TryParse(this.textBoxWY1.Text, out y1); int.TryParse(this.textBoxWY2.Text, out y2); if (checkBoxPctls.Checked) { try { string values = textBoxPctls.Text; string[] tokens = values.Split(','); pctls = Array.ConvertAll <string, int>(tokens, int.Parse); } catch { pctls = new int[] { 10, 50, 90 }; } } DateTime t1 = new DateTime(y1 - 1, 10, 1); DateTime t2 = new DateTime(y2, 9, 30); var server = HydrometInfoUtility.HydrometServerFromPreferences(); Series s = new HydrometDailySeries(comboBoxCbtt.Text.Trim(), DeterminePcode(), server); s.Read(t1, t2); s.RemoveMissing(); s.Appearance.LegendText = ""; YearRange yr = new YearRange(2000, 10); var list = Math.SummaryHydrograph(s, pctls, yr.DateTime1, checkBoxMax.Checked, checkBoxMin.Checked, checkBoxAvg.Checked, false); //, false); wyList.Add(list); }
private static Series Get30YearAverageSeries(string cbtt, string pcode, int forecastMonth) { var t1 = HydrometDataUtility.T1Thirty; var t2 = HydrometDataUtility.T2Thirty; var s2 = new HydrometDailySeries(cbtt, pcode, HydrometHost.PNLinux); s2.Read(t1, t2); // Resolve current WY // [JR] Don't know why this was hard coded to the current WY... int currWY = DateTime.Now.Year; if (DateTime.Now.Month > 9) { //currWY = currWY + 1; //[JR] need to check what this does come January... } DateTime t = new DateTime(currWY, forecastMonth, 1); var list = Math.SummaryHydrograph(s2, new int[] { }, t, false, false, true, false); return(list[0]); }