Ejemplo n.º 1
0
        public void GetCorrelations()
        {
            // 4368 = Moscow code
            var collection = new GismeteoWeatherCollection(4368, new DateTime(2011, 04, 3), new DateTime(2012, 03, 31));

            var distribs = new List<Tuple<string, Dictionary<DateTime, double>>>
                {
                    Tuple.Create("Cloudiness", collection.GetWeekCloudinessDistribution().ToDictionary(it => it.Key, it => (double) it.Value)),
                    Tuple.Create("Rain", collection.GetWeekRainDistribution().ToDictionary(it => it.Key, it => (double) it.Value)),
                    Tuple.Create("EveningTemperature", collection.GetWeekEveningTemperature()),
                    Tuple.Create("DayPressure", collection.GetWeekPressureDistribution())
                };

            foreach (var d in distribs)
            {
                Console.WriteLine("\n" + d.Item1);
                PrintTopCorrelations(d.Item2.NormalizeByMax(), 10);
            }
        }
Ejemplo n.º 2
0
 public static void TestYearWeatherRetrieval()
 {
     var collection = new GismeteoWeatherCollection(4368, new DateTime(2011, 03, 31), new DateTime(2012, 03, 31));
     Assert.AreEqual(365, collection.GetWeather().Count);
 }
Ejemplo n.º 3
0
 public static void RunWeatherRetrieval()
 {
     // 4368 = Moscow code
     var collection = new GismeteoWeatherCollection(4368, new DateTime(2011, 04, 1), new DateTime(2012, 03, 31));
     collection.SaveTo("../../Files/MoscowWeather2011-2012.txt");
     collection.SaveDayInfoTo("../../Files/MoscowDayWeather2011-2012.txt");
     collection.SaveEveningInfoTo("../../Files/MoscowEveningWeather2011-2012.txt");
 }