public override IExplorerView Run() { SeriesList list = Explorer.CreateSelectedSeries(); if (list.Count != 2) { string msg = "Correlation Graph requires exactly two series, there are " + list.Count + " series selected"; view.Messages.Add(msg); Logger.WriteLine(msg); view.SeriesList.Clear(); view.DataTable = new DataTable(); return(view); } ReadSeriesList(list); string title = list.Text.TitleText(); string subTitle = list.MissingRecordsMessage; list.RemoveMissing(); SeriesList myList = list.Subset(Explorer.MonthDayRange); myList = myList.AggregateAndSubset(Explorer.StatisticalMethods, Explorer.MonthDayRange, Explorer.BeginningMonth); view.Title = title; view.SubTitle = subTitle; view.SeriesList = myList; return(view); }
/// <summary> /// Used by Exceedance and Probability /// </summary> /// <param name="sortType"></param> protected void SortAndRank(RankType sortType) { // Logger.WriteLine("Settings.HasTraces: " + Explorer.HasTraces); SeriesList list = Explorer.CreateSelectedSeries(); ReadSeriesList(list); list.RemoveMissing(); if (Explorer.SelectedSeries.Length == 1 && Explorer.MergeSelected) { // merge single Year Traces. var s = list.MergeYearlyScenarios(); list = new SeriesList(); list.Add(s); } Explorer.WriteProgressMessage("SubSet using Month Range " + Explorer.MonthDayRange.ToString(), 10); SeriesList myList = list.Subset(Explorer.MonthDayRange); Performance p = new Performance(); myList = myList.AggregateAndSubset(Explorer.StatisticalMethods, Explorer.MonthDayRange, Explorer.BeginningMonth);//, Explorer.HasTraces); p.Report("kt"); //if (Explorer.HasTraces && Explorer.StatisticalMethods != StatisticalMethods.None) //{ // // combine each 'year/scenario' into a single series // myList = myList.Merge(); //} SeriesList proababilityList = new SeriesList(); foreach (Series s in myList) { s.Appearance.Style = Styles.Line; proababilityList.Add(Math.Sort(s, sortType)); } Explorer.WriteProgressMessage("drawing graph", 86); view.Title = Explorer.MonthDayRange.ToString() + " " + list.Text.TitleText(); proababilityList.Type = SeriesListType.Sorted; view.SubTitle = list.MissingRecordsMessage; view.SeriesList = proababilityList; }