public void ClimatologySeasonlyTimeseriesTest() { Random r = new Random(54256); using (DataSet ds = DataSet.Open("msds:memory")) { Assert.AreEqual(0, ds.Variables.Count); ds.AddClimatologyAxisSeasonly(); Assert.AreEqual(2, ds.Variables.Count); var clim = ds.Variables.Where(v => v.Rank == 2).First(); DateTime dt0 = ((DateTime[, ])clim.GetData(new int[] { 0, 0 }, new int[] { 1, 1 }))[0, 0]; DateTime dt1 = ((DateTime[, ])clim.GetData(new int[] { 0, 1 }, new int[] { 1, 1 }))[0, 0]; DateTime dt2 = ((DateTime[, ])clim.GetData(new int[] { 1, 0 }, new int[] { 1, 1 }))[0, 0]; DateTime dt3 = ((DateTime[, ])clim.GetData(new int[] { 1, 1 }, new int[] { 1, 1 }))[0, 0]; Assert.AreEqual(dt0.Year, dt2.Year); Assert.AreEqual(dt0.Hour, dt2.Hour); Assert.AreNotEqual(dt0.DayOfYear, dt2.DayOfYear); Assert.AreEqual(dt1.Year, dt3.Year); Assert.AreEqual(dt1.Hour, dt3.Hour); Assert.AreNotEqual(dt1.DayOfYear, dt3.DayOfYear); } using (DataSet ds = DataSet.Open("msds:memory")) { Assert.AreEqual(0, ds.Variables.Count); ds.AddClimatologyAxisSeasonly(1940, 1954, 3, 230, 3, 5, 5, "tim123", "climatAx"); Assert.AreEqual(2, ds.Variables.Count); var clim = ds.Variables["climatAx"]; Assert.AreEqual("climatAx", ds.Variables["tim123"].Metadata["climatology"]); DateTime dt0 = ((DateTime[, ])clim.GetData(new int[] { 0, 0 }, new int[] { 1, 1 }))[0, 0]; DateTime dt1 = ((DateTime[, ])clim.GetData(new int[] { 0, 1 }, new int[] { 1, 1 }))[0, 0]; DateTime dt2 = ((DateTime[, ])clim.GetData(new int[] { 1, 0 }, new int[] { 1, 1 }))[0, 0]; DateTime dt3 = ((DateTime[, ])clim.GetData(new int[] { 1, 1 }, new int[] { 1, 1 }))[0, 0]; Assert.AreEqual(dt0.Year, dt2.Year); Assert.AreEqual(1940, dt0.Year); Assert.AreEqual(dt0.Hour, dt2.Hour); Assert.AreEqual(3, dt0.Hour); Assert.AreNotEqual(dt0.DayOfYear, dt2.DayOfYear); Assert.AreEqual(dt1.Year, dt3.Year); Assert.AreEqual(1954, dt1.Year); Assert.AreEqual(dt1.Hour, dt3.Hour); Assert.AreEqual(5, dt1.Hour); Assert.AreNotEqual(dt1.DayOfYear, dt3.DayOfYear); } }