private void Summarize(int MaxCount, BaseTimeSeries bts) { TimespanSeries tspan = bts as TimespanSeries; TimestampSeries tstam = bts as TimestampSeries; if (tspan != null) { if (tspan.Items.Count > MaxCount) { List <TimespanValue> temp = new List <TimespanValue>(); DateTime Start = tspan.Items.First().StartTime; DateTime End = tspan.Items.Last().EndTime; double periodDays = End.Subtract(Start).TotalDays / MaxCount; for (int i = 0; i < MaxCount; i++) { TimespanValue TValue = new TimespanValue(Start.AddDays(i * periodDays), Start.AddDays((i + 1) * periodDays), 0); TValue.Value = tspan.GetValue(TValue.StartTime, TValue.EndTime); temp.Add(TValue); } tspan.Items.Clear(); foreach (var v in temp) { tspan.Items.Add(v); } } } if (tstam != null) { if (tstam.Items.Count > MaxCount) { List <TimestampValue> temp = new List <TimestampValue>(); DateTime Start = tstam.Items.First().Time; DateTime End = tstam.Items.Last().Time; double periodDays = End.Subtract(Start).TotalDays / MaxCount; for (int i = 0; i < MaxCount; i++) { TimestampValue TValue = new TimestampValue(Start.AddDays(i * periodDays), 0); TValue.Value = tstam.GetValue(TValue.Time); temp.Add(TValue); } tstam.Items.Clear(); foreach (var v in temp) { tstam.Items.Add(v); } } } }
public void KeyedCollection() { List<TimestampValue> _list = new List<TimestampValue>(); DateTime Start = DateTime.Now; int n = 100000; for (int i = 0; i < n; i++) { _list.Add(new TimestampValue(Start.AddSeconds(i), i)); } Stopwatch sw = new Stopwatch(); TimestampSeries ts = new TimestampSeries(); sw.Reset(); sw.Start(); for (int i = n - 1; i > 0; i--) { ts.AddValue(_list[i].Time, _list[i].Value); } sw.Stop(); Console.WriteLine("TimestampSeries:" + sw.Elapsed); TimestampSeries2 ts2 = new TimestampSeries2(); sw.Reset(); sw.Start(); for (int i = n - 1; i > 0; i--) { ts2.AddValue(_list[i].Time, _list[i].Value); } sw.Stop(); Console.WriteLine("TimestampSeries2:" + sw.Elapsed); sw.Reset(); sw.Start(); for (int i = n - 1; i > 0; i--) { ts2.GetValue(Start.AddSeconds(i)); } sw.Stop(); sw.Reset(); sw.Start(); for (int i = n - 1; i > 0; i--) { ts.GetValue(Start.AddSeconds(i)); } sw.Stop(); }
public void AppendValue() { TimestampSeries ts = new TimestampSeries(); ts.AppendValue(1); ts.AppendValue(2); Assert.AreEqual(new DateTime(2020, 1, 1), ts.Items[0].Time); Assert.AreEqual(1, ts.Items[0].Value); Assert.AreEqual(new DateTime(2020, 1, 2), ts.Items[1].Time); Assert.AreEqual(2, ts.Items[1].Value); ts = new TimestampSeries(); //testing when timestep is two seconds ts.Items.Add(new TimestampValue(new DateTime(2010, 1, 1, 0, 0, 1), 10)); ts.Items.Add(new TimestampValue(new DateTime(2010, 1, 1, 0, 0, 3), 20)); ts.AppendValue(30); Assert.AreEqual(new DateTime(2010, 1, 1, 0, 0, 5), ts.Items[2].Time); ts = new TimestampSeries(); //testing when timestep is two minutes ts.Items.Add(new TimestampValue(new DateTime(2010, 1, 1, 0, 1, 0), 10)); ts.Items.Add(new TimestampValue(new DateTime(2010, 1, 1, 0, 3, 0), 20)); ts.AppendValue(30); Assert.AreEqual(new DateTime(2010, 1, 1, 0, 5, 0), ts.Items[2].Time); ts = new TimestampSeries(); //testing when timestep is two days ts.Items.Add(new TimestampValue(new DateTime(2010, 1, 1), 10)); ts.Items.Add(new TimestampValue(new DateTime(2010, 1, 3), 20)); ts.AppendValue(30); Assert.AreEqual(new DateTime(2010, 1, 5), ts.Items[2].Time); ts = new TimestampSeries(); //testing when timestep is two days, when passing end of month ts.Items.Add(new TimestampValue(new DateTime(2010, 1, 31), 10)); ts.Items.Add(new TimestampValue(new DateTime(2010, 2, 2), 20)); ts.AppendValue(30); Assert.AreEqual(new DateTime(2010, 2, 4), ts.Items[2].Time); ts = new TimestampSeries(); //testing when timestep two months ts.Items.Add(new TimestampValue(new DateTime(2010, 1, 1, 0, 0, 0), 10)); ts.Items.Add(new TimestampValue(new DateTime(2010, 3, 1, 0, 0, 0), 20)); ts.AppendValue(30); Assert.AreEqual(new DateTime(2010, 5, 1, 0, 0, 0), ts.Items[2].Time); ts = new TimestampSeries(); //testing when timestep two months, when passing january 1st ts.Items.Add(new TimestampValue(new DateTime(2010, 12, 1, 0, 0, 0), 10)); ts.Items.Add(new TimestampValue(new DateTime(2011, 2, 1, 0, 0, 0), 20)); ts.AppendValue(30); Assert.AreEqual(new DateTime(2011, 4, 1, 0, 0, 0), ts.Items[2].Time); ts = new TimestampSeries(); //testing when timestep is two years ts.Items.Add(new TimestampValue(new DateTime(2010, 6, 17), 10)); ts.Items.Add(new TimestampValue(new DateTime(2011, 6, 17), 20)); ts.AppendValue(30); Assert.AreEqual(new DateTime(2012, 6, 17), ts.Items[2].Time); }
public void IsVisibleTest() { TimestampSeries target = new TimestampSeries(); Assert.AreEqual(true, target.IsVisible); bool expected = false; bool actual; target.IsVisible = expected; actual = target.IsVisible; Assert.AreEqual(expected, actual); }
public void ConvertUnit() { TimestampSeries timestampSeries = new TimestampSeries(); timestampSeries.Unit = new HydroNumerics.Core.Unit("cm pr second", 0.01, 0.0); timestampSeries.Items.Add(new TimestampValue(new DateTime(2010, 1, 1, 0, 0, 0), 7)); timestampSeries.Items.Add(new TimestampValue(new DateTime(2010, 1, 2, 0, 0, 0), 9)); HydroNumerics.Core.Unit newUnit = new HydroNumerics.Core.Unit("mm pr sec", 0.001, 0.0); timestampSeries.ConvertUnit(newUnit); Assert.AreEqual(70, timestampSeries.Items[0].Value); Assert.AreEqual(90, timestampSeries.Items[1].Value); Assert.IsTrue(timestampSeries.Unit.Equals(newUnit)); }
public void TimestampSeries01() { TimestampSeries ts = new TimestampSeries("tsname", new DateTime(2010, 1, 1), 3, 2, TimestepUnit.Days, 3.2); Assert.AreEqual("tsname", ts.Name); Assert.AreEqual(3, ts.Items.Count); Assert.AreEqual(new DateTime(2010, 1, 1), ts.Items[0].Time); Assert.AreEqual(new DateTime(2010, 1, 3), ts.Items[1].Time); Assert.AreEqual(new DateTime(2010, 1, 5), ts.Items[2].Time); Assert.AreEqual(3.2, ts.Items[0].Value); Assert.AreEqual(3.2, ts.Items[1].Value); Assert.AreEqual(3.2, ts.Items[2].Value); }
public Observations(string ID) : base() { Discharge = new TimestampSeries(); Discharge.Name = ID + ": Discharge"; Discharge.Unit = UnitFactory.Instance.GetUnit(NamedUnits.cubicmeterpersecond); Items.Add(Discharge); WaterLevel = new TimestampSeries(); WaterLevel.Name = ID + ": WaterLevel"; WaterLevel.Unit = UnitFactory.Instance.GetUnit(NamedUnits.meter); Items.Add(WaterLevel); ChemicalConcentrations = new Dictionary <Chemical, TimestampSeries>(); }
public void Create() { string filename = "HydroNumerics.Time.Core.UnitTest.TimeSeriesGroupFactoryTest.Create.xts"; TimeSeriesGroup tsg = new TimeSeriesGroup(); TimespanSeries timespanSeries = new TimespanSeries("timespanseriesname", new System.DateTime(2010, 1, 1), 10, 2, TimestepUnit.Days, 4.3); TimestampSeries timestampSeries = new TimestampSeries("timestampseriesname", new System.DateTime(2010, 1, 1), 10, 2, TimestepUnit.Days, 4.3); tsg.Items.Add(timespanSeries); tsg.Items.Add(timestampSeries); tsg.Save(filename); TimeSeriesGroup tsg2 = TimeSeriesGroupFactory.Create(filename); for (int i = 0; i < tsg.Items.Count; i++) { Assert.AreEqual(tsg.Items[i], tsg2.Items[i]); } }
public void RemoveAfter() { TimestampSeries ts = new TimestampSeries(); ts.Items.Add(new TimestampValue(new DateTime(2010, 1, 1, 0, 0, 0), 1)); ts.Items.Add(new TimestampValue(new DateTime(2010, 1, 2, 0, 0, 0), 2)); ts.Items.Add(new TimestampValue(new DateTime(2010, 1, 3, 0, 0, 0), 3)); ts.Items.Add(new TimestampValue(new DateTime(2010, 1, 4, 0, 0, 0), 4)); ts.Items.Add(new TimestampValue(new DateTime(2010, 1, 5, 0, 0, 0), 5)); ts.Items.Add(new TimestampValue(new DateTime(2010, 1, 6, 0, 0, 0), 6)); ts.RemoveAfter(new DateTime(2010, 1, 3, 0, 0, 0)); Assert.AreEqual(2, ts.Items.Count); ts.RemoveAfter(new DateTime(2010, 1, 8, 0, 0, 0)); Assert.AreEqual(2, ts.Items.Count); ts.RemoveAfter(new DateTime(2009, 1, 1, 0, 0, 0)); Assert.AreEqual(0, ts.Items.Count); ts.RemoveAfter(new DateTime(2010, 3, 1, 0, 0, 0)); Assert.AreEqual(0, ts.Items.Count); }
public void Load() { string filename = "HydroNumerics.Time.Core.UnitTest.TimestampSeriesTest.Load.xts"; TimestampSeries ts1 = new TimestampSeries("TSName", new DateTime(2010, 1, 1), 10, 1, TimestepUnit.Days, 5.5); ts1.Save(filename); TimestampSeries ts2 = new TimestampSeries(); ts2.Load(filename); Assert.AreEqual(ts1.Id, ts2.Id); Assert.AreEqual(ts1.Description, ts2.Description); Assert.AreEqual(ts1.Name, ts2.Name); Assert.AreEqual(ts1.Unit, ts2.Unit); Assert.AreEqual(ts1.Items.Count, ts2.Items.Count); for (int i = 0; i < ts1.Items.Count; i++) { Assert.AreEqual(ts1.Items[i].Time, ts2.Items[i].Time); Assert.AreEqual(ts1.Items[i].Value, ts2.Items[i].Value); } }
public void Getvalue3() { TimestampSeries ts = new TimestampSeries("Test", new DateTime(1999, 1, 1), 400, 1, TimestepUnit.Days, 0); ts.ExtrapolationMethod = ExtrapolationMethods.RecycleYear; ts.AllowExtrapolation = true; for (int i = 0; i < ts.Items.Count; i++) { ts.Items[i].Value = i; } Assert.AreEqual(7, ts.GetValue(new DateTime(1999, 1, 8))); Assert.AreEqual(7, ts.GetValue(new DateTime(1995, 1, 8))); Assert.AreEqual(365 + 7, ts.GetValue(new DateTime(2010, 1, 8))); Assert.AreEqual(7.5, ts.GetValue(new DateTime(1995, 1, 8, 12, 0, 0))); Assert.AreEqual(7.5, ts.GetValue(new DateTime(1999, 1, 8), new DateTime(1999, 1, 9))); Assert.AreEqual(7.5, ts.GetValue(new DateTime(1995, 1, 8), new DateTime(1995, 1, 9))); Assert.AreEqual(365 + 7 + 0.5, ts.GetValue(new DateTime(2010, 1, 8), new DateTime(2010, 1, 9))); Assert.AreEqual(365 + 8, ts.GetValue(new DateTime(2010, 1, 8), new DateTime(2010, 1, 10))); }
public void Equals() { TimestampSeries ts1 = new TimestampSeries("tsname", new DateTime(2010, 1, 1), 3, 2, TimestepUnit.Days, 4.5); TimestampSeries ts2 = new TimestampSeries("tsname", new DateTime(2010, 1, 1), 3, 2, TimestepUnit.Days, 4.5); Assert.AreEqual(ts1, ts2); ts2.Name = "something else"; Assert.AreNotEqual(ts1, ts2); ts2 = new TimestampSeries("tsname", new DateTime(2010, 1, 1), 3, 2, TimestepUnit.Days, 4.5); Assert.AreEqual(ts1, ts2); ts2.Id = 99; Assert.AreNotEqual(ts1, ts2); ts2 = new TimestampSeries("tsname", new DateTime(2010, 1, 1), 3, 2, TimestepUnit.Days, 4.5); Assert.AreEqual(ts1, ts2); ts2.Description = "another description"; Assert.AreNotEqual(ts1, ts2); ts2 = new TimestampSeries("tsname", new DateTime(2010, 1, 1), 3, 2, TimestepUnit.Days, 4.5); Assert.AreEqual(ts1, ts2); ts2.RelaxationFactor = 0.2323; Assert.AreNotEqual(ts1, ts2); ts2 = new TimestampSeries("tsname", new DateTime(2010, 1, 1), 3, 2, TimestepUnit.Days, 4.5); Assert.AreEqual(ts1, ts2); ts2.Unit.Dimension.ElectricCurrent = 6; Assert.AreNotEqual(ts1, ts2); ts2 = new TimestampSeries("tsname", new DateTime(2010, 1, 1), 3, 2, TimestepUnit.Days, 4.5); Assert.AreEqual(ts1, ts2); ts2.Items.Add(new TimestampValue(new DateTime(2010, 1, 1), 66)); Assert.AreNotEqual(ts1, ts2); ts2 = new TimestampSeries("tsname", new DateTime(2010, 1, 1), 3, 2, TimestepUnit.Days, 4.5); Assert.AreEqual(ts1, ts2); ts2.Items[2].Value = 33; Assert.AreNotEqual(ts1, ts2); }
public void Save() { string filename = "HydroNumerics.Time.Core.UnitTest.TimeSeriesGroupTest.Save.xts"; TimespanSeries timespanSeries = new TimespanSeries("Flow", new System.DateTime(2010, 1, 1), 10, 2, TimestepUnit.Days, 4.3); timespanSeries.Unit = new HydroNumerics.Core.Unit("Liters pr. sec", 0.001, 0.0, "Liters pr second"); timespanSeries.Unit.Dimension.Length = 3; timespanSeries.Unit.Dimension.Time = -1; timespanSeries.Description = "Measured Flow"; TimestampSeries timestampSeries = new TimestampSeries("Water Level", new System.DateTime(2010, 1, 1), 6, 2, TimestepUnit.Days, 6.3); timestampSeries.Unit = new HydroNumerics.Core.Unit("cm", 0.01, 0.0, "centimeters"); timestampSeries.Unit.Dimension.Length = 1; timestampSeries.Description = "Measured Head"; TimeSeriesGroup tsg = new TimeSeriesGroup(); tsg.Name = "MyTsGroup"; tsg.Items.Add(timespanSeries); tsg.Items.Add(timestampSeries); tsg.Save(filename); }
public void PropertyChangedEvent() { TimestampSeries timeSeries = new TimestampSeries(); timeSeries.Unit = new HydroNumerics.Core.Unit("liter/sec", 0.001, 0.0, "liters pr. second"); timeSeries.AddValue(new DateTime(2010, 1, 1, 0, 0, 0), 5.0); timeSeries.AddValue(new DateTime(2010, 1, 2, 0, 0, 0), 5.0); timeSeries.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(timeSeries_PropertyChanged); propertyChanged = false; timeSeries.Name = "something else"; Assert.IsTrue(propertyChanged); propertyChanged = false; timeSeries.Items[0].Value = 7.3; Assert.IsTrue(propertyChanged); propertyChanged = false; timeSeries.IsVisible = false; Assert.IsTrue(propertyChanged); Assert.AreEqual("IsVisible", changedProperty); //TODO: implement test like above for the remaining properties }
public QStation() { Discharge = new TimestampSeries(); }
public void GroundWaterTest() { WaterPacket GroundWater = new WaterPacket(1); // GroundWater.AddChemical(ChemicalFactory.Instance.GetChemical(ChemicalNames.Radon), 0.01); GroundWater.IDForComposition = 4; Lake Vedsted = LakeFactory.GetLake("Vedsted Sø"); Vedsted.Depth = 5; Vedsted.WaterLevel = 45.7; //Create and add a discharge boundary TimestampSeries Discharge = new TimestampSeries(); Discharge.AddSiValue(new DateTime(2007, 3, 12), 6986 / TimeSpan.FromDays(365).TotalSeconds); Discharge.AddSiValue(new DateTime(2007, 4, 3), 5894 / TimeSpan.FromDays(365).TotalSeconds); Discharge.AddSiValue(new DateTime(2007, 4, 25), 1205 / TimeSpan.FromDays(365).TotalSeconds); Discharge.RelaxationFactor = 1; Discharge.AllowExtrapolation = true; Assert.AreEqual(Discharge.GetValue(new DateTime(2007, 4, 25)), Discharge.GetValue(new DateTime(2007, 6, 25)), 0.0000001); SinkSourceBoundary Kilde = new SinkSourceBoundary(Discharge); Kilde.Name = "Small spring"; Kilde.ID = 3; Kilde.WaterSample.IDForComposition = 3; Vedsted.Sources.Add(Kilde); Vedsted.Output.LogAllChemicals = true; Vedsted.Output.LogComposition = true; //Add to an engine Model Engine = new Model(); Engine.Name = "Vedsted-opsætning"; Engine._waterBodies.Add(Vedsted); //Set initial state WaterPacket InitialStateWater = new WaterPacket(1); InitialStateWater.IDForComposition = 1; DateTime Start = new DateTime(2007, 1, 1); DateTime End = new DateTime(2007, 12, 31); Engine.SetState("Initial", Start, InitialStateWater); Engine.SimulationEndTime = End; Engine.TimeStep = TimeSpan.FromDays(30); Engine.MoveInTime(End, TimeSpan.FromDays(30)); Vedsted.Name = "Vedsted step 1"; Engine.Save(testDataPath + Vedsted.Name + ".xml"); Engine.RestoreState("Initial"); //Create and add precipitation boundary TimespanSeries Precipitation = new TimespanSeries(); Precipitation.ExtrapolationMethod = ExtrapolationMethods.RecycleYear; Precipitation.AllowExtrapolation = true; double[] values = new double[] { 108, 83, 73, 52, 61, 86, 99, 101, 75, 108, 85, 101 }; AddMonthlyValues(Precipitation, 2007, values); SinkSourceBoundary Precip = new SinkSourceBoundary(Precipitation); Precip.ContactGeometry = Vedsted.SurfaceArea; Precip.Name = "Precipitation"; Precip.ID = 2; Precip.WaterSample.IDForComposition = 2; Vedsted.Precipitation.Add(Precip); //Create and add evaporation boundary TimespanSeries Evaporation = new TimespanSeries(); Evaporation.AllowExtrapolation = true; Evaporation.ExtrapolationMethod = ExtrapolationMethods.RecycleYear; double[] values2 = new double[] { 4, 11, 34, 66, 110, 118, 122, 103, 61, 26, 7, 1 }; AddMonthlyValues(Evaporation, 2007, values2); EvaporationRateBoundary eva = new EvaporationRateBoundary(Evaporation); eva.ContactGeometry = Vedsted.SurfaceArea; eva.Name = "Evapo"; Vedsted.EvaporationBoundaries.Add(eva); Engine.MoveInTime(End, TimeSpan.FromDays(30)); Vedsted.Name = "Vedsted step 2"; Engine.Save(testDataPath + Vedsted.Name + ".xml"); Engine.RestoreState("Initial"); //To be used by other tests Engine.Save(testDataPath + "VedstedNoGroundwater.xml"); XYPolygon ContactArea = XYPolygon.GetSquare(Vedsted.Area / 10); #region Groundwater boundaries //Add groundwater boundaries GroundWaterBoundary B1 = new GroundWaterBoundary(Vedsted, 1.3e-4, 1, 45.47, ContactArea); B1.Name = "B1"; B1.ID = 4; B1.WaterSample = GroundWater; Vedsted.GroundwaterBoundaries.Add(B1); GroundWaterBoundary B2 = new GroundWaterBoundary(Vedsted, 1e-6, 1, 44.96, ContactArea); B2.Name = "B2"; B2.ID = 5; B2.WaterSample = GroundWater; Vedsted.GroundwaterBoundaries.Add(B2); GroundWaterBoundary B3 = new GroundWaterBoundary(Vedsted, 2e-6, 1, 44.63, ContactArea); B3.Name = "B3"; B3.ID = 6; B3.WaterSample = GroundWater; Vedsted.GroundwaterBoundaries.Add(B3); GroundWaterBoundary B4 = new GroundWaterBoundary(Vedsted, 4.9e-7, 1, 44.75, ContactArea); B4.Name = "B4"; B4.ID = 7; B4.WaterSample = GroundWater; Vedsted.GroundwaterBoundaries.Add(B4); GroundWaterBoundary B5 = new GroundWaterBoundary(Vedsted, 1.5e-8, 1, 44.27, ContactArea); B5.Name = "B5"; B5.ID = 8; B5.WaterSample = GroundWater; Vedsted.GroundwaterBoundaries.Add(B5); GroundWaterBoundary B6 = new GroundWaterBoundary(Vedsted, 1.5e-8, 1, 44.16, ContactArea); B6.Name = "B6"; B6.ID = 9; B6.WaterSample = GroundWater; Vedsted.GroundwaterBoundaries.Add(B6); GroundWaterBoundary B7 = new GroundWaterBoundary(Vedsted, 1.1e-6, 1, 45.15, ContactArea); B7.Name = "B7"; B7.ID = 10; B7.WaterSample = GroundWater; Vedsted.GroundwaterBoundaries.Add(B7); GroundWaterBoundary B8 = new GroundWaterBoundary(Vedsted, 1.1e-6, 1, 44.54, ContactArea); B8.Name = "B8"; B8.ID = 11; B8.WaterSample = GroundWater; Vedsted.GroundwaterBoundaries.Add(B8); GroundWaterBoundary B9 = new GroundWaterBoundary(Vedsted, 2.1e-8, 1, 45.4, ContactArea); B9.Name = "B9"; B9.ID = 12; B9.WaterSample = GroundWater; Vedsted.GroundwaterBoundaries.Add(B9); GroundWaterBoundary B10 = new GroundWaterBoundary(Vedsted, 3.5e-6, 1, 45.16, ContactArea); B10.Name = "B10"; B10.ID = 13; B10.WaterSample = GroundWater; Vedsted.GroundwaterBoundaries.Add(B10); #endregion Engine.MoveInTime(End, TimeSpan.FromDays(30)); Vedsted.Name = "Vedsted step 3"; Engine.Save(testDataPath + Vedsted.Name + ".xml"); Engine.RestoreState("Initial"); Vedsted.GroundwaterBoundaries.Clear(); var cl = ChemicalFactory.Instance.GetChemical(ChemicalNames.IsotopeFraction); GroundWaterBoundary Inflow = new GroundWaterBoundary(Vedsted, 1e-7, 1, 46.7, XYPolygon.GetSquare(Vedsted.Area / 2)); Inflow.Name = "Inflow"; GroundWater.AddChemical(cl, 3); Inflow.WaterSample = GroundWater; Vedsted.RealData.AddChemicalTimeSeries(cl); Vedsted.RealData.ChemicalConcentrations[cl].AddSiValue(new DateTime(2007, 8, 7), 2.5); ((WaterPacket)InitialStateWater).AddChemical(cl, 2.5 * InitialStateWater.Volume); Engine.SetState("Initial", Start, InitialStateWater); GroundWaterBoundary Outflow = new GroundWaterBoundary(Vedsted, 1e-7, 1, 44.7, XYPolygon.GetSquare(Vedsted.Area / 2)); Outflow.Name = "Outflow"; Vedsted.GroundwaterBoundaries.Add(Inflow); Vedsted.GroundwaterBoundaries.Add(Outflow); Engine.MoveInTime(End, TimeSpan.FromDays(30)); Vedsted.Name = "Vedsted step 4"; Engine.Save(testDataPath + Vedsted.Name + ".xml"); Engine.RestoreState("Initial"); #region ////Add seepage meter boundaries //GroundWaterBoundary S1 = new GroundWaterBoundary(Vedsted, 4e-5, 1, 2, 46); //Vedsted.SinkSources.Add(S1); //GroundWaterBoundary S2 = new GroundWaterBoundary(Vedsted, 4e-5, 1, 2, 46); //Vedsted.SinkSources.Add(S2); //GroundWaterBoundary S3 = new GroundWaterBoundary(Vedsted, 4e-5, 1, 2, 46); //Vedsted.SinkSources.Add(S3); //GroundWaterBoundary I1 = new GroundWaterBoundary(Vedsted, 4e-5, 1, 2, 46); //Vedsted.SinkSources.Add(I1); //GroundWaterBoundary I2 = new GroundWaterBoundary(Vedsted, 4e-5, 1, 2, 46); //Vedsted.SinkSources.Add(I2); //GroundWaterBoundary I3 = new GroundWaterBoundary(Vedsted, 4e-5, 1, 2, 46); //Vedsted.SinkSources.Add(I3); #endregion Assert.AreEqual(Evaporation.EndTime, Engine.MaximumEndTime); Engine.Save(testDataPath + "Vedsted.xml"); Engine.MoveInTime(End, TimeSpan.FromDays(30)); double outflow2 = Vedsted.Output.Outflow.GetValue(Start, End.Subtract(TimeSpan.FromDays(5))); double evapo2 = Vedsted.Output.Evaporation.GetValue(Start, End.Subtract(TimeSpan.FromDays(5))); Engine.Save(testDataPath + "Vedsted2.xml"); }
public void TestMethod1() { List<TimestampValue> _list = new List<TimestampValue>(); DateTime Start = DateTime.Now; int n=100000; for (int i = 0; i < n; i++) { _list.Add(new TimestampValue(Start.AddSeconds(i), i)); } Stopwatch sw = new Stopwatch(); SortedList<DateTime, double> _sortedList = new SortedList<DateTime, double>(); sw.Start(); for (int i = n - 1; i > 0; i--) { _sortedList.Add(_list[i].Time, _list[i].Value); } sw.Stop(); Console.WriteLine("SortedList:" + sw.Elapsed); SortedDictionary<DateTime, double> _sortedDictionary = new SortedDictionary<DateTime, double>(); sw.Reset(); sw.Start(); for (int i = n - 1; i > 0; i--) { _sortedDictionary.Add(_list[i].Time, _list[i].Value); } sw.Stop(); Console.WriteLine("SortedDictionary:" + sw.Elapsed); TimestampSeries ts = new TimestampSeries(); sw.Reset(); sw.Start(); for (int i = n-1; i >0; i--) { ts.AddValue(_list[i].Time, _list[i].Value); } sw.Stop(); Console.WriteLine("TimestampSeries:" + sw.Elapsed); List<TimestampValue> _listAndSort = new List<TimestampValue>(); sw.Reset(); sw.Start(); for (int i = n - 1; i > 0; i--) { _listAndSort.Add(_list[i]); } _listAndSort.Sort((var,var2) => var.Time.CompareTo(var2.Time)); sw.Stop(); Console.WriteLine("_listAndSort:" + sw.Elapsed); sw.Reset(); sw.Start(); _listAndSort.Sort((var, var2) => var.Time.CompareTo(var2.Time)); sw.Stop(); Console.WriteLine("Sort sorted list:" + sw.Elapsed); }
public void KrabbenhoftExample() { Lake L = new Lake("Sparkling Lake", XYPolygon.GetSquare(0.81e6)); L.Depth = 8.84e6 / L.Area; L.Output.LogAllChemicals = true; IsotopeWater LakeWater = new IsotopeWater(1); LakeWater.SetIsotopeRatio(5.75); TimestampSeries EvapoConcentrations = new TimestampSeries(); EvapoConcentrations.AddSiValue(new DateTime(1985, 4, 1), 3.95); EvapoConcentrations.AddSiValue(new DateTime(1985, 5, 1), 13.9); EvapoConcentrations.AddSiValue(new DateTime(1985, 6, 1), 25.24); EvapoConcentrations.AddSiValue(new DateTime(1985, 7, 1), 23.97); EvapoConcentrations.AddSiValue(new DateTime(1985, 8, 1), 17.13); EvapoConcentrations.AddSiValue(new DateTime(1985, 9, 1), 10.40); EvapoConcentrations.AddSiValue(new DateTime(1985, 10, 1), 6.12); EvapoConcentrations.AddSiValue(new DateTime(1985, 10, 1), 33.24); EvapoConcentrations.AllowExtrapolation = true; EvapoConcentrations.ExtrapolationMethod = ExtrapolationMethods.RecycleYear; LakeWater.EvaporationConcentration = EvapoConcentrations; TimestampSeries PrecipConcentrations = new TimestampSeries(); PrecipConcentrations.AddSiValue(new DateTime(1985, 1, 1), 22.8); PrecipConcentrations.AddSiValue(new DateTime(1985, 2, 1), 22.8); PrecipConcentrations.AddSiValue(new DateTime(1985, 3, 1), 22.8); PrecipConcentrations.AddSiValue(new DateTime(1985, 4, 1), 14.8); PrecipConcentrations.AddSiValue(new DateTime(1985, 5, 1), 10.7); PrecipConcentrations.AddSiValue(new DateTime(1985, 6, 1), 6.3); PrecipConcentrations.AddSiValue(new DateTime(1985, 7, 1), 5.1); PrecipConcentrations.AddSiValue(new DateTime(1985, 8, 1), 8.4); PrecipConcentrations.AddSiValue(new DateTime(1985, 9, 1), 11.1); PrecipConcentrations.AddSiValue(new DateTime(1985, 10, 1), 13.8); PrecipConcentrations.AddSiValue(new DateTime(1985, 10, 1), 21.9); PrecipConcentrations.AllowExtrapolation = true; PrecipConcentrations.ExtrapolationMethod = ExtrapolationMethods.RecycleYear; TimespanSeries Precipitation = new TimespanSeries(); Precipitation.Unit = new HydroNumerics.Core.Unit("cm/month", 1.0 / 100.0 / (86400.0 * 30.0), 0); Precipitation.AddValue(new DateTime(1985, 1, 1), new DateTime(1985, 3, 1), 0); Precipitation.AddValue(new DateTime(1985, 3, 1), new DateTime(1985, 3, 31), 12.5); Precipitation.AddValue(new DateTime(1985, 4, 1), new DateTime(1985, 4, 30), 7.1); Precipitation.AddValue(new DateTime(1985, 5, 1), new DateTime(1985, 5, 31), 7.6); Precipitation.AddValue(new DateTime(1985, 6, 1), new DateTime(1985, 6, 30), 8.8); Precipitation.AddValue(new DateTime(1985, 7, 1), new DateTime(1985, 7, 31), 8.6); Precipitation.AddValue(new DateTime(1985, 8, 1), new DateTime(1985, 8, 31), 12.7); Precipitation.AddValue(new DateTime(1985, 9, 1), new DateTime(1985, 9, 30), 11); Precipitation.AddValue(new DateTime(1985, 10, 1), new DateTime(1985, 10, 31), 6.2); Precipitation.AddValue(new DateTime(1985, 11, 1), new DateTime(1985, 11, 30), 4.8); Precipitation.AddValue(new DateTime(1985, 11, 30), new DateTime(1985, 12, 31), 0); Precipitation.AllowExtrapolation = true; Precipitation.ExtrapolationMethod = ExtrapolationMethods.RecycleYear; Assert.AreEqual(79, 12 * Precipitation.GetValue(new DateTime(1985, 1, 1), new DateTime(1985, 12, 31)), 3); SourceBoundary Precip = new SourceBoundary(Precipitation); Precip.WaterSample = new IsotopeWater(1); Precip.AddChemicalConcentrationSeries(ChemicalFactory.Instance.GetChemical(ChemicalNames.IsotopeFraction), PrecipConcentrations); TimespanSeries Evaporation = new TimespanSeries(); Evaporation.Unit = new HydroNumerics.Core.Unit("cm/month", 1.0 / 100.0 / (86400.0 * 30.0), 0); Evaporation.AddValue(new DateTime(1985, 1, 1), new DateTime(1985, 4, 1), 0); Evaporation.AddValue(new DateTime(1985, 4, 1), new DateTime(1985, 4, 30), 2.8); Evaporation.AddValue(new DateTime(1985, 5, 1), new DateTime(1985, 5, 31), 7.0); Evaporation.AddValue(new DateTime(1985, 6, 1), new DateTime(1985, 6, 30), 10.5); Evaporation.AddValue(new DateTime(1985, 7, 1), new DateTime(1985, 7, 31), 11.1); Evaporation.AddValue(new DateTime(1985, 8, 1), new DateTime(1985, 8, 31), 10.0); Evaporation.AddValue(new DateTime(1985, 9, 1), new DateTime(1985, 9, 30), 7.0); Evaporation.AddValue(new DateTime(1985, 10, 1), new DateTime(1985, 10, 31), 4.7); Evaporation.AddValue(new DateTime(1985, 11, 1), new DateTime(1985, 11, 30), 0.6); Evaporation.AddValue(new DateTime(1985, 11, 30), new DateTime(1985, 12, 31), 0); Evaporation.AllowExtrapolation = true; Evaporation.ExtrapolationMethod = ExtrapolationMethods.RecycleYear; EvaporationRateBoundary erb = new EvaporationRateBoundary(Evaporation); Assert.AreEqual(54, 12 * Evaporation.GetValue(new DateTime(1985, 1, 1), new DateTime(1985, 12, 31)), 3); GroundWaterBoundary grb = new GroundWaterBoundary(L, 1e-7, 1, 1, (XYPolygon)L.Geometry); grb.FlowType = GWType.Flow; grb.WaterFlow = new TimespanSeries(); grb.WaterFlow.AddSiValue(DateTime.MinValue, DateTime.MaxValue, Evaporation.Unit.ToSiUnit(29 / 12) * L.Area); IsotopeWater gwsp25 = new IsotopeWater(1); gwsp25.SetIsotopeRatio(11.5); grb.WaterSample = gwsp25; GroundWaterBoundary gout = new GroundWaterBoundary(L, 1e-7, 1, -1, (XYPolygon)L.Geometry); gout.FlowType = GWType.Flow; gout.WaterFlow = new TimespanSeries(); gout.WaterFlow.AddSiValue(DateTime.MinValue, DateTime.MaxValue, -Evaporation.Unit.ToSiUnit(54 / 12) * L.Area); DateTime Start = new DateTime(1985, 1, 1); L.Precipitation.Add(Precip); Precip.ContactGeometry = L.Geometry; L.EvaporationBoundaries.Add(erb); erb.ContactGeometry = L.Geometry; L.GroundwaterBoundaries.Add(grb); L.GroundwaterBoundaries.Add(gout); Model M = new Model(); M.WaterBodies.Add(L); M.SetState("Initial", Start, LakeWater); L.Depth *= 1.5; ((IsotopeWater)L.CurrentStoredWater).CurrentTime = Start; M.MoveInTime(new DateTime(1985, 12, 31), TimeSpan.FromDays(10)); M.Save(@"..\..\..\TestData\Krabbenhoft.xml"); }
public Intake() { HeadObservations = new TimestampSeries(); Extractions = new TimespanSeries(); }
public void GetValues_AsAcceptor() { filename = "HydroNumerics.Time.OpenMI.UnitTest.LinkableTimeSeriesGroupTest.GetValues_AsAcceptor.xts"; string acceptorOutputFilename = "HydroNumerics.Time.OpenMI.UnitTest.LinkableTimeSeriesGroupTest.GetValues_AsAcceptor.out.xts"; TimespanSeries timespanSeries = new TimespanSeries("Flow", new System.DateTime(2010, 1, 1), 10, 2, TimestepUnit.Days, 10.2); timespanSeries.Unit = new HydroNumerics.Core.Unit("Liters pr. sec", 0.001, 0.0, "Liters pr second"); timespanSeries.Unit.Dimension.Length = 3; timespanSeries.Unit.Dimension.Time = -1; timespanSeries.Description = "Measured Flow"; TimestampSeries timestampSeries = new TimestampSeries("Water Level", new System.DateTime(2010, 1, 1), 6, 2, TimestepUnit.Days, 12.2); timestampSeries.Unit = new HydroNumerics.Core.Unit("cm", 0.01, 0.0, "centimeters"); timestampSeries.Unit.Dimension.Length = 1; timestampSeries.Description = "Measured Head"; TimeSeriesGroup tsg = new TimeSeriesGroup(); tsg.Name = "Acceptor"; tsg.Items.Add(timespanSeries); tsg.Items.Add(timestampSeries); tsg.Save(filename); Argument filenameArgument = new Argument("Filename", filename, true, "someDescription"); Argument outputFilenameArgument = new Argument("OutputFilename", acceptorOutputFilename, true, "someDescription"); Argument[] acceptorArguments = new Argument[2] { filenameArgument, outputFilenameArgument }; LinkableTimeSeriesGroup acceptorTs = new LinkableTimeSeriesGroup(); acceptorTs.Initialize(acceptorArguments); acceptorTs.WriteOmiFile(filename); LinkableTimeSeriesGroup linkableTimeSeriesGroup = new LinkableTimeSeriesGroup(); linkableTimeSeriesGroup.Initialize(arguments); Link ts2tsLink1 = new Link(); ts2tsLink1.SourceComponent = linkableTimeSeriesGroup; ts2tsLink1.TargetComponent = acceptorTs; ts2tsLink1.SourceQuantity = linkableTimeSeriesGroup.GetOutputExchangeItem(0).Quantity; ts2tsLink1.SourceElementSet = linkableTimeSeriesGroup.GetOutputExchangeItem(0).ElementSet; ts2tsLink1.TargetQuantity = acceptorTs.GetInputExchangeItem(0).Quantity; ts2tsLink1.TargetElementSet = acceptorTs.GetInputExchangeItem(0).ElementSet; ts2tsLink1.ID = "ts2ts1"; linkableTimeSeriesGroup.AddLink(ts2tsLink1); acceptorTs.AddLink(ts2tsLink1); Link ts2tsLink2 = new Link(); ts2tsLink2.SourceComponent = linkableTimeSeriesGroup; ts2tsLink2.TargetComponent = acceptorTs; ts2tsLink2.SourceQuantity = linkableTimeSeriesGroup.GetOutputExchangeItem(1).Quantity; ts2tsLink2.SourceElementSet = linkableTimeSeriesGroup.GetOutputExchangeItem(1).ElementSet; ts2tsLink2.TargetQuantity = acceptorTs.GetInputExchangeItem(1).Quantity; ts2tsLink2.TargetElementSet = acceptorTs.GetInputExchangeItem(1).ElementSet; ts2tsLink2.ID = "ts2ts2"; linkableTimeSeriesGroup.AddLink(ts2tsLink2); acceptorTs.AddLink(ts2tsLink2); //setting up the work arround type of trigger InputExchangeItem targetExchangeItem = new InputExchangeItem(); Quantity targetQuantity = new Quantity(); targetQuantity.ID = "Water Level"; targetQuantity.Unit = new HydroNumerics.OpenMI.Sdk.Backbone.Unit("meter", 1, 0, "meter"); ElementSet targetElementSet = new ElementSet("inputLocation", "Location", ElementType.IDBased, new SpatialReference("")); Link triggerLink = new Link(); triggerLink.SourceComponent = acceptorTs; triggerLink.TargetComponent = null; triggerLink.SourceQuantity = acceptorTs.GetOutputExchangeItem(0).Quantity; triggerLink.SourceElementSet = acceptorTs.GetOutputExchangeItem(0).ElementSet; triggerLink.TargetQuantity = targetQuantity; triggerLink.TargetElementSet = targetElementSet; triggerLink.ID = "TriggerLink"; acceptorTs.AddLink(triggerLink); TimespanSeries tss1 = (TimespanSeries)acceptorTs.TimeSeriesGroup.Items[0]; TimestampSeries tss2 = (TimestampSeries)acceptorTs.TimeSeriesGroup.Items[1]; Assert.AreEqual(10.2, tss1.Items[0].Value); Assert.AreEqual(12.2, tss2.Items[0].Value); acceptorTs.GetValues(new TimeStamp(new System.DateTime(2010, 1, 3)), triggerLink.ID); Assert.AreEqual(4.3, tss1.Items[0].Value); Assert.AreEqual(6.3, tss2.Items[0].Value); linkableTimeSeriesGroup.Finish(); //save file acceptorTs.Finish(); //save file }
public HydroCatEditor() { InitializeComponent(); hydroCatEngine = new HydroNumerics.HydroCat.Core.HydroCatEngine(); //-- Default Initial values hydroCatEngine.InitialSnowStorage = 0; hydroCatEngine.InitialSurfaceStorage = 0; hydroCatEngine.InitialRootZoneStorage = 220; hydroCatEngine.InitialOverlandFlow = 0; hydroCatEngine.InitialInterFlow = 0; hydroCatEngine.InitialBaseFlow = 0.6; //-- Parameters hydroCatEngine.CatchmentArea = 160000000; hydroCatEngine.SnowmeltCoefficient = 2.0; hydroCatEngine.SurfaceStorageCapacity = 18; hydroCatEngine.RootZoneStorageCapacity = 250; hydroCatEngine.OverlandFlowCoefficient = 0.61; hydroCatEngine.InterflowCoefficient = 0.027586; // svarende til = 24/CKIF = 24/870 hydroCatEngine.OverlandFlowTreshold = 0.38; hydroCatEngine.InterflowTreshold = 0.08; hydroCatEngine.OverlandFlowTimeConstant = 1.25; // svarende til CK12/24 30/24 hydroCatEngine.InterflowTimeConstant = 1.25; // svarende til CK12/24 30/24 hydroCatEngine.BaseflowTimeConstant = 116.6666666; //svarende til 2800/24 // -- Default simulatio time --- hydroCatEngine.SimulationStartTime = new System.DateTime(1973, 1, 1, 12, 0, 0); hydroCatEngine.SimulationEndTime = new System.DateTime(1975, 12, 1, 12, 0, 0); int numberOfTimesteps = 1095; TimespanSeries precipitationTs = new TimespanSeries("Precipitation", hydroCatEngine.SimulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0); precipitationTs.Unit = Units.MmPrDay; TimespanSeries potentialEvaporationTs = new TimespanSeries("PotentialEvaporation", hydroCatEngine.SimulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0); potentialEvaporationTs.Unit = Units.MmPrDay; TimespanSeries temperatureTs = new TimespanSeries("Temperature", hydroCatEngine.SimulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0); temperatureTs.Unit = Units.Centigrade; TimestampSeries observedRunoffTs = new TimestampSeries("ObservedRunoff", hydroCatEngine.SimulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0); observedRunoffTs.Unit = Units.M3PrSec; double[] observedRunoff = new double[1095] { 1.1970, 0.9910, 1.0470, 1.0270, 1.1230, 1.2220, 1.2130, 1.2450, 1.1300, 1.0580, 1.0120, 0.9200, 0.9010, 0.9180, 0.9840, 1.6800, 1.8050, 1.6600, 1.4070, 1.1980, 1.1140, 1.2660, 1.6370, 1.4360, 1.4890, 2.0670, 2.9970, 2.3670, 2.3300, 2.0210, 1.8180, 1.6670, 1.4660, 1.3810, 1.2980, 1.2300, 1.2670, 1.4510, 1.2620, 1.4870, 1.4700, 1.3190, 1.5200, 4.4690, 3.9720, 2.4260, 2.0370, 2.3040, 3.8690, 3.0320, 2.3240, 1.9890, 1.6320, 1.5460, 1.5170, 1.3530, 1.1970, 1.0720, 1.0710, 1.1180, 1.9850, 2.3790, 2.1200, 1.9040, 1.5970, 1.3640, 1.1700, 1.0590, 1.0580, 0.9980, 0.9280, 0.9040, 0.8770, 0.8510, 0.8350, 0.8310, 0.8160, 0.7910, 0.7760, 0.7620, 0.7470, 0.7330, 0.7300, 0.7260, 0.7120, 0.7080, 0.6950, 0.6910, 0.6880, 0.6840, 0.7100, 0.7370, 0.6960, 0.6750, 0.8540, 1.1070, 1.2230, 0.9430, 0.8030, 0.7310, 0.8090, 0.8480, 0.7640, 0.7040, 0.6820, 0.6710, 0.6600, 0.6300, 0.6210, 0.6030, 0.6400, 0.6770, 0.6400, 0.6120, 0.6120, 0.6140, 0.6150, 0.6170, 0.6180, 0.6290, 0.7500, 0.7220, 0.6940, 0.6970, 0.8050, 0.8190, 0.8570, 1.7410, 1.5130, 1.5150, 2.0980, 1.4650, 1.2940, 1.2450, 1.0620, 0.9060, 0.8170, 0.7450, 0.6970, 0.6530, 0.6210, 0.5980, 0.5700, 0.5900, 0.5700, 0.5440, 0.5200, 0.5030, 0.4950, 0.4870, 0.4790, 0.5310, 0.5070, 0.6100, 0.5260, 0.4800, 0.4430, 0.4090, 0.3870, 0.3720, 0.3720, 0.3530, 0.3270, 0.3270, 0.3200, 0.2960, 0.2810, 0.2750, 0.2690, 0.2640, 0.2510, 0.2650, 0.2640, 0.2570, 0.2560, 0.2560, 0.2620, 0.2750, 0.3030, 0.2950, 0.2870, 0.2700, 0.2660, 0.2650, 0.2650, 0.2460, 0.2460, 0.2220, 0.2190, 0.2130, 0.2300, 0.2480, 0.2310, 0.2160, 0.2090, 0.2030, 0.2000, 0.2050, 0.2130, 0.2100, 0.2080, 0.2060, 0.2040, 0.2090, 0.2650, 0.2290, 0.2230, 0.2450, 0.2230, 0.2210, 0.2150, 0.2130, 0.2070, 0.1980, 0.2000, 0.2100, 0.2090, 0.2080, 0.2100, 0.2190, 0.2110, 0.2200, 0.2050, 0.1900, 0.1820, 0.1850, 0.1800, 0.1750, 0.1700, 0.1650, 0.1630, 0.1580, 0.1530, 0.1490, 0.1490, 0.1450, 0.1430, 0.1390, 0.1400, 0.1440, 0.1440, 0.1850, 0.2030, 0.1810, 0.1870, 0.1760, 0.1720, 0.1770, 0.1550, 0.1270, 0.1220, 0.1490, 0.1610, 0.1490, 0.1450, 0.1420, 0.1400, 0.1380, 0.1360, 0.1340, 0.1320, 0.1300, 0.2990, 0.3070, 0.6170, 0.7010, 0.5070, 0.4260, 0.3910, 0.3780, 0.6120, 0.6630, 0.5590, 0.4920, 0.4490, 0.4150, 0.4160, 0.4160, 0.4100, 0.4110, 0.4110, 0.5120, 0.6560, 0.5030, 0.4560, 0.4330, 0.4170, 0.4070, 0.3980, 0.4030, 0.4760, 0.6100, 0.5670, 0.4900, 0.4450, 0.4290, 0.4200, 0.4310, 0.4330, 0.4220, 0.4110, 0.4130, 0.4160, 0.3920, 0.3820, 0.3720, 0.3680, 0.3640, 0.3850, 0.5690, 0.4660, 0.4360, 0.4310, 0.4020, 0.4360, 0.5670, 1.0330, 0.7080, 0.6220, 0.6970, 0.6920, 0.6610, 1.0210, 1.1710, 0.8260, 0.7740, 0.7880, 1.2850, 1.3900, 1.0730, 0.8990, 0.8900, 0.8850, 0.8800, 0.8750, 0.8700, 2.0790, 1.8000, 1.1910, 2.0740, 3.2910, 2.0310, 1.3100, 1.1250, 1.4480, 1.6390, 2.0280, 2.4840, 1.7430, 1.5070, 2.0170, 2.0250, 1.3710, 1.1440, 1.1370, 1.2150, 1.3840, 1.7270, 3.0710, 3.0830, 2.9360, 2.3620, 1.9840, 2.0680, 2.5220, 1.8970, 1.6560, 1.4810, 1.3640, 1.3660, 1.3300, 1.2810, 1.2570, 1.3100, 1.3510, 1.4050, 2.3300, 4.8060, 4.6420, 5.2280, 5.1240, 5.0420, 4.7750, 3.8090, 3.0730, 2.5830, 2.2200, 1.9690, 2.9730, 2.6900, 2.2590, 2.0980, 2.5040, 2.4490, 2.4910, 2.1520, 1.8190, 1.7710, 1.6960, 1.6220, 1.5630, 1.6540, 1.7850, 1.4880, 1.3260, 1.9420, 4.4560, 5.5210, 4.5020, 3.4410, 3.7220, 2.8500, 2.2120, 1.9490, 1.7010, 1.4940, 1.5510, 1.5560, 1.3940, 1.1940, 1.1870, 1.1350, 1.0830, 1.0330, 0.9890, 0.9130, 0.8810, 0.8590, 0.8380, 0.7970, 0.7860, 0.7650, 0.7540, 0.7340, 0.7140, 0.7130, 0.7210, 0.7110, 0.7090, 0.7170, 0.7440, 0.7900, 0.9290, 0.8760, 0.9570, 0.9240, 0.8320, 0.7730, 0.7340, 0.7140, 0.6860, 0.6580, 0.6480, 0.6200, 0.6190, 0.6180, 0.6170, 0.6160, 0.6120, 0.6090, 0.6050, 0.6020, 0.5980, 0.5950, 0.5910, 0.5880, 0.5600, 0.5410, 0.5380, 0.5420, 0.5330, 0.5240, 0.5150, 0.5070, 0.4980, 0.4900, 0.4820, 0.4740, 0.4660, 0.4510, 0.4440, 0.4370, 0.4230, 0.4230, 0.4160, 0.4040, 0.3990, 0.4900, 0.5740, 0.4900, 0.4150, 0.3800, 0.4050, 0.3940, 0.3840, 0.3740, 0.3640, 0.3600, 0.3560, 0.3470, 0.3610, 0.3550, 0.3530, 0.3520, 0.3560, 0.3600, 0.3530, 0.3470, 0.3460, 0.3500, 0.3490, 0.3530, 0.3520, 0.3880, 0.3590, 0.3440, 0.3390, 0.3380, 0.3590, 0.3540, 0.3450, 0.3610, 0.3690, 0.3550, 0.3420, 0.3370, 0.3440, 0.3740, 0.3580, 0.3500, 0.3550, 0.3470, 0.3440, 0.3360, 0.3610, 0.3690, 0.3490, 0.3520, 0.3440, 0.3390, 0.3390, 0.3410, 0.3400, 0.3390, 0.3340, 0.3210, 0.3360, 0.3520, 0.3510, 0.3930, 0.3680, 0.3270, 0.3270, 0.3200, 0.3150, 0.3100, 0.3100, 0.3150, 0.3200, 0.3500, 0.3450, 0.3400, 0.3400, 0.3300, 0.3250, 0.3250, 0.3200, 0.3200, 0.3250, 0.3400, 0.3350, 0.3300, 0.3300, 0.3350, 0.3300, 0.3250, 0.3200, 0.3200, 0.3100, 0.3000, 0.2950, 0.2900, 0.2850, 0.2800, 0.2750, 0.2700, 0.3000, 0.2800, 0.2950, 0.2950, 0.2700, 0.2630, 0.2570, 0.2420, 0.2320, 0.2270, 0.2240, 0.2250, 0.2220, 0.2190, 0.2130, 0.2140, 0.2070, 0.2080, 0.2100, 0.2070, 0.2120, 0.2060, 0.1930, 0.2200, 0.2310, 0.2260, 0.2400, 0.2620, 0.2450, 0.2990, 0.6120, 0.3700, 0.2910, 0.2650, 0.2670, 0.2960, 0.2940, 0.2800, 0.2780, 0.2790, 0.2810, 0.3030, 0.3050, 0.5230, 0.7040, 0.6710, 0.8020, 0.7890, 0.7690, 1.1390, 0.9570, 0.9190, 0.8830, 0.8140, 1.6300, 1.7260, 2.1340, 2.1120, 1.9080, 1.6170, 1.4350, 1.3690, 1.4380, 1.3500, 1.2420, 1.1790, 1.1480, 1.1080, 1.0990, 1.0800, 1.0500, 2.3200, 2.1690, 1.9390, 3.2440, 2.9380, 2.0800, 1.6430, 1.4490, 1.0440, 1.6950, 1.7660, 1.5260, 1.4690, 1.3770, 1.2630, 1.2220, 1.1690, 1.1510, 1.1770, 1.2160, 1.8230, 3.3650, 3.4090, 3.8940, 3.2520, 3.9900, 4.8740, 4.7210, 5.9580, 5.4190, 4.5530, 4.0140, 3.1490, 2.4340, 1.9920, 1.8300, 2.0340, 2.3090, 2.3160, 3.4970, 4.2260, 3.3720, 2.2530, 2.2600, 2.1770, 2.5250, 3.6390, 3.0750, 3.2950, 3.5950, 3.3140, 4.4300, 5.5010, 4.9340, 3.5600, 3.3710, 4.4610, 3.9200, 4.7380, 4.6690, 3.9600, 4.0720, 4.5080, 4.3190, 5.1720, 4.4300, 4.6090, 5.3970, 4.8080, 4.0850, 3.9410, 3.1290, 2.8590, 3.4560, 3.0320, 2.7640, 2.7390, 2.4810, 2.4090, 2.0550, 1.8230, 1.8600, 2.9750, 3.7280, 4.9730, 4.2310, 3.5730, 3.0830, 2.7920, 2.8020, 3.5650, 3.5960, 3.4940, 3.2610, 4.3150, 6.7780, 7.1950, 6.4270, 5.8290, 5.2530, 6.9740, 7.1390, 6.9050, 6.3820, 6.0870, 5.2740, 4.1730, 3.5690, 3.1670, 2.9430, 2.7260, 2.3330, 2.2790, 2.3070, 2.1420, 2.0750, 1.9930, 1.7640, 1.5040, 1.4180, 1.3880, 1.5770, 1.6870, 1.6410, 1.6800, 1.6760, 1.5880, 1.6410, 1.6090, 1.5220, 1.5330, 1.5430, 1.5680, 1.5510, 1.7450, 2.1940, 2.3500, 4.5640, 3.6630, 3.5130, 3.0930, 2.4300, 2.0110, 1.6800, 1.5070, 1.4310, 1.4100, 1.2990, 1.1690, 1.0910, 1.0610, 1.0430, 1.0020, 0.9960, 0.9900, 0.9940, 0.9880, 1.0030, 1.0190, 1.0350, 0.9960, 0.9570, 0.9090, 0.9130, 0.9180, 0.8610, 0.8250, 0.8100, 0.8750, 1.1040, 1.1080, 1.2150, 1.2320, 1.3910, 1.2180, 1.1540, 0.9950, 1.4220, 1.4470, 1.1320, 0.9950, 0.8850, 0.8280, 0.8110, 0.8330, 0.8640, 0.8090, 0.7460, 0.7130, 0.7160, 0.7090, 0.7030, 0.7670, 0.8810, 1.2100, 1.0420, 0.8870, 0.8060, 0.7550, 0.7140, 0.6910, 0.6760, 0.6710, 0.6690, 0.6670, 0.6490, 0.6630, 0.6530, 0.6440, 0.6340, 0.6400, 1.1660, 1.9310, 1.2910, 0.8750, 0.7260, 0.6580, 0.6160, 0.5830, 0.5580, 0.5410, 0.5310, 0.5530, 0.6700, 0.6170, 0.5870, 0.6900, 0.7560, 0.7290, 0.6250, 0.5800, 0.5490, 0.5250, 0.4970, 0.4710, 0.4560, 0.4470, 0.4330, 0.4150, 0.3980, 0.3910, 0.3750, 0.3680, 0.3580, 0.3490, 0.3360, 0.3280, 0.3200, 0.3160, 0.3120, 0.3080, 0.2980, 0.2840, 0.2780, 0.2680, 0.2630, 0.2580, 0.2560, 0.2540, 0.2550, 0.2500, 0.2540, 0.2520, 0.2530, 0.2600, 0.2650, 0.2690, 0.2770, 0.2920, 0.3170, 0.3120, 0.3000, 0.2850, 0.2730, 0.2680, 0.2760, 0.3150, 0.3520, 0.3490, 0.3590, 0.3470, 0.3520, 0.3730, 0.3700, 0.3600, 0.3600, 0.3500, 0.3400, 0.3300, 0.3300, 0.3200, 0.3200, 0.3100, 0.3100, 0.3000, 0.3000, 0.3000, 0.2900, 0.2900, 0.2800, 0.2800, 0.3020, 0.3050, 0.2970, 0.3040, 0.3360, 0.4770, 0.3860, 0.3910, 0.3740, 0.3580, 0.3470, 0.3470, 0.3470, 0.3470, 0.3470, 0.3520, 0.3570, 0.3830, 0.5360, 0.4440, 0.4440, 0.4550, 0.4320, 0.4310, 0.7190, 0.6130, 0.5670, 0.5340, 0.5710, 0.5830, 0.5880, 0.5130, 0.4780, 0.4720, 0.4600, 0.4710, 0.4590, 0.4480, 0.4530, 0.4800, 0.5910, 0.5840, 0.6520, 0.5580, 0.5170, 0.5330, 0.6480, 0.6760, 1.1340, 0.9980, 0.7960, 0.6550, 0.5930, 0.5640, 0.5660, 0.5520, 0.5390, 0.5410, 0.5820, 0.6820, 0.7440, 0.7470, 0.6880, 0.6490, 0.6260, 0.6120, 0.6060, 0.6080, 0.6100, 0.6040, 0.6000, 0.5900, 0.5800, 0.5700, 0.5600, 0.5500, 0.5500, 0.5500, 0.6740, 0.7030, 0.6970, 0.7520, 0.7640, 0.7220, 0.6980, 0.6910, 0.6850, 0.6780, 0.6810, 0.6830, 0.6770, 0.9340, 1.6870, 1.3210, 1.1650, 1.4120, 1.2180, 1.0140, 0.9150, 0.9080, 0.9410, 1.1690, 1.7100, 1.6620, 1.6540, 1.3950, 1.3390, 3.1540, 4.2760, 2.9380, 2.0970, 1.6670, 1.4720, 1.3720, 1.2390, 1.1330, 1.0970, 1.1750, 1.1510, 1.0360, 1.1010, 1.1580, 1.0980, 0.9840, 0.9710, 0.9580, 1.0800, 1.1370, 1.1350, 1.1340, 1.0500, 1.0710, 1.0930, 1.0680, 1.0550, 1.0890, 1.2350 }; double[] precipitation = new double[1095] { 0.0000, 0.0000, 2.3000, 0.2000, 0.0000, 0.1000, 0.1000, 0.0000, 0.3000, 0.4000, 0.1000, 0.1000, 1.0000, 0.0000, 0.5000, 5.3000, 1.9000, 0.1000, 0.0000, 0.4000, 1.1000, 1.2000, 2.6000, 0.0000, 1.5000, 3.4000, 6.0000, 0.7000, 4.0000, 0.1000, 0.6000, 2.0000, 0.4000, 0.1000, 0.0000, 0.0000, 0.0000, 4.1000, 0.2000, 4.0000, 0.3000, 0.6000, 3.1000, 14.1000, 3.9000, 0.1000, 3.7000, 2.4000, 4.3000, 0.0000, 0.0000, 0.0000, 0.0000, 2.7000, 1.0000, 0.1000, 0.3000, 0.2000, 0.0000, 0.2000, 8.7000, 2.0000, 1.8000, 0.9000, 0.1000, 0.2000, 0.1000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.6000, 1.8000, 0.0000, 1.1000, 4.7000, 2.4000, 0.0000, 0.1000, 8.2000, 4.6000, 1.0000, 0.1000, 0.0000, 0.0000, 7.8000, 2.0000, 0.3000, 0.0000, 0.1000, 0.1000, 0.0000, 0.0000, 0.3000, 0.1000, 2.2000, 2.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 6.7000, 0.0000, 0.0000, 0.0000, 5.4000, 2.2000, 1.0000, 10.8000, 3.6000, 3.1000, 10.1000, 0.0000, 0.3000, 2.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 1.3000, 0.0000, 0.0000, 7.6000, 3.6000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 4.5000, 0.0000, 12.8000, 0.0000, 4.4000, 0.0000, 0.0000, 0.0000, 0.0000, 4.9000, 0.0000, 0.8000, 0.0000, 2.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 7.1000, 0.2000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 4.4000, 1.5000, 4.6000, 1.4000, 0.8000, 0.0000, 0.0000, 0.0000, 0.0000, 5.5000, 4.6000, 1.3000, 0.1000, 2.8000, 2.6000, 0.0000, 0.1000, 3.5000, 1.0000, 8.7000, 0.5000, 0.0000, 0.4000, 0.0000, 0.0000, 0.0000, 0.0000, 3.8000, 4.9000, 4.6000, 2.5000, 7.9000, 0.1000, 4.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.6000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.2000, 14.4000, 2.0000, 6.2000, 0.5000, 0.3000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 3.2000, 8.1000, 1.3000, 20.2000, 13.5000, 1.1000, 1.3000, 0.0000, 0.0000, 2.1000, 13.7000, 3.9000, 0.5000, 0.1000, 0.0000, 0.0000, 0.1000, 0.0000, 0.0000, 0.2000, 4.8000, 7.2000, 0.4000, 0.0000, 4.6000, 0.2000, 0.0000, 0.0000, 0.5000, 4.8000, 9.8000, 0.6000, 0.0000, 0.0000, 0.0000, 0.0000, 3.2000, 0.0000, 0.0000, 0.0000, 0.0000, 0.4000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.5000, 8.5000, 0.5000, 1.9000, 1.2000, 0.0000, 3.2000, 1.7000, 12.3000, 1.9000, 0.0000, 4.3000, 3.6000, 1.1000, 6.7000, 5.4000, 0.0000, 0.0000, 0.9000, 10.0000, 7.8000, 0.1000, 1.3000, 0.5000, 0.1000, 0.2000, 0.5000, 0.0000, 7.2000, 0.0000, 0.0000, 10.2000, 9.7000, 0.2000, 0.1000, 0.9000, 3.5000, 1.2000, 4.9000, 4.6000, 3.5000, 1.1000, 5.8000, 0.4000, 0.0000, 0.0000, 0.6000, 0.1000, 1.2000, 0.8000, 9.4000, 1.5000, 0.1000, 0.1000, 0.2000, 0.9000, 4.8000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.0000, 0.1000, 1.9000, 0.8000, 0.9000, 2.1000, 7.9000, 3.8000, 3.8000, 9.6000, 1.4000, 7.9000, 0.4000, 0.6000, 0.7000, 0.0000, 0.0000, 0.0000, 7.0000, 0.1000, 0.1000, 0.1000, 5.3000, 1.0000, 4.3000, 0.2000, 0.0000, 1.8000, 0.1000, 0.6000, 0.0000, 1.5000, 3.2000, 0.1000, 4.1000, 5.5000, 10.6000, 9.0000, 0.9000, 0.8000, 2.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.4000, 0.6000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.1000, 2.5000, 5.7000, 2.3000, 2.0000, 0.6000, 0.8000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 4.2000, 9.6000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 9.3000, 0.0000, 0.0000, 0.0000, 0.0000, 5.3000, 0.0000, 0.0000, 0.7000, 9.0000, 0.2000, 0.0000, 0.0000, 2.8000, 2.4000, 1.5000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 6.4000, 0.0000, 0.0000, 0.8000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 7.1000, 0.1000, 0.0000, 0.2000, 0.0000, 0.0000, 0.2000, 0.0000, 0.6000, 0.9000, 10.0000, 5.1000, 4.1000, 10.3000, 1.9000, 0.0000, 0.0000, 0.0000, 0.2000, 4.2000, 0.4000, 5.8000, 0.5000, 0.1000, 3.3000, 4.9000, 1.4000, 0.5000, 0.0000, 1.8000, 2.5000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 1.4000, 0.0000, 2.4000, 7.6000, 5.2000, 11.4000, 0.1000, 1.1000, 0.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.8000, 0.0000, 2.3000, 0.4000, 0.0000, 0.0000, 0.0000, 0.0000, 5.2000, 2.2000, 0.0000, 10.0000, 5.3000, 1.2000, 8.0000, 30.7000, 2.9000, 0.0000, 0.0000, 0.0000, 6.8000, 0.0000, 0.0000, 0.0000, 1.4000, 0.5000, 4.1000, 0.1000, 10.6000, 11.2000, 2.5000, 6.2000, 5.3000, 4.5000, 12.8000, 0.1000, 1.0000, 0.0000, 0.0000, 22.7000, 2.5000, 5.5000, 3.7000, 0.8000, 0.0000, 1.6000, 1.7000, 3.8000, 0.2000, 0.3000, 0.0000, 0.4000, 0.0000, 0.2000, 0.5000, 1.0000, 16.3000, 0.3000, 4.3000, 14.8000, 0.0000, 2.7000, 0.0000, 2.8000, 3.2000, 5.3000, 2.1000, 0.0000, 2.2000, 0.4000, 0.3000, 0.1000, 0.0000, 0.0000, 1.8000, 0.5000, 9.4000, 11.4000, 2.4000, 9.2000, 1.1000, 11.1000, 6.4000, 8.3000, 15.3000, 0.1000, 6.8000, 2.9000, 0.0000, 0.3000, 0.4000, 0.2000, 3.3000, 6.2000, 1.0000, 9.0000, 5.5000, 0.0000, 0.0000, 3.0000, 1.1000, 0.0000, 10.8000, 0.0000, 7.1000, 2.0000, 1.6000, 7.2000, 9.4000, 0.9000, 6.1000, 1.4000, 2.5000, 0.6000, 8.1000, 0.9000, 2.8000, 5.0000, 3.3000, 2.1000, 9.5000, 0.0000, 6.0000, 7.0000, 0.0000, 2.2000, 1.8000, 0.2000, 1.1000, 5.2000, 0.0000, 0.3000, 1.6000, 0.8000, 0.4000, 0.0000, 0.2000, 1.4000, 5.9000, 7.1000, 7.0000, 1.9000, 1.5000, 0.1000, 0.3000, 5.6000, 4.1000, 4.8000, 1.5000, 1.5000, 2.7000, 11.4000, 8.6000, 3.7000, 5.7000, 1.3000, 13.4000, 5.6000, 5.9000, 5.4000, 5.3000, 0.1000, 0.1000, 0.2000, 0.0000, 0.5000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 4.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.0000, 2.9000, 3.0000, 1.0000, 14.6000, 0.6000, 5.0000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 1.6000, 2.2000, 0.0000, 0.0000, 0.6000, 0.0000, 0.2000, 2.4000, 0.3000, 0.0000, 0.3000, 5.8000, 1.6000, 1.6000, 5.7000, 2.8000, 1.9000, 0.6000, 2.8000, 0.0000, 8.8000, 2.5000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 3.1000, 0.0000, 0.0000, 0.0000, 0.2000, 0.5000, 0.0000, 3.7000, 5.0000, 10.2000, 1.2000, 0.4000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.6000, 0.3000, 0.0000, 0.0000, 2.2000, 8.4000, 11.5000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.8000, 12.4000, 2.8000, 3.9000, 10.1000, 4.5000, 6.6000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.5000, 0.5000, 0.0000, 0.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.3000, 0.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 3.2000, 1.4000, 7.3000, 0.0000, 3.7000, 11.1000, 1.2000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 8.3000, 2.2000, 6.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.2000, 0.0000, 0.0000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 11.6000, 5.9000, 0.0000, 0.0000, 8.9000, 17.1000, 0.1000, 4.9000, 2.3000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 14.5000, 2.7000, 1.9000, 3.3000, 0.0000, 0.0000, 19.9000, 2.4000, 4.1000, 2.0000, 4.2000, 0.9000, 0.3000, 0.0000, 0.1000, 0.3000, 0.0000, 3.1000, 2.5000, 0.0000, 1.6000, 3.8000, 8.2000, 5.7000, 7.7000, 0.3000, 0.0000, 5.4000, 7.9000, 1.3000, 10.0000, 0.6000, 0.7000, 0.0000, 0.0000, 0.0000, 0.9000, 0.0000, 0.0000, 0.1000, 2.6000, 6.3000, 4.7000, 0.7000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.2000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 2.3000, 2.0000, 0.0000, 3.1000, 0.9000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.3000, 0.4000, 7.5000, 12.4000, 2.9000, 0.5000, 7.6000, 1.6000, 2.3000, 0.0000, 0.0000, 2.1000, 2.3000, 8.0000, 2.1000, 1.7000, 0.0000, 0.0000, 17.9000, 4.5000, 0.5000, 0.7000, 0.3000, 0.0000, 1.1000, 0.1000, 0.0000, 0.0000, 1.1000, 0.1000, 0.0000, 1.2000, 0.0000, 1.2000, 0.8000, 0.7000, 0.0000, 0.1000, 0.2000, 0.2000, 0.0000, 0.4000, 1.3000, 0.0000, 0.0000, 0.0000, 0.1000, 1.4000 }; double[] potentialEvaporation = new double[1095] { 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.2330, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 2.0970, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 3.9000, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 4.1940, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 3.2260, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 1.6330, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.7740, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.2670, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.1610, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.6330, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 3.5160, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 2.1290, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.2330, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.1790, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 0.6450, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 1.3330, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 2.4840, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.3330, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.8390, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 3.2580, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 1.4000, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.6130, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.3000, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610, 0.1610 }; double[] temperature = new double[1095] { -2.1500, 0.0500, 2.9000, 2.5500, 2.7000, 6.1000, 2.8000, 1.3500, -1.7000, -1.7000, -0.4500, -2.3500, -0.7000, 1.2000, 1.3500, 1.6000, 0.7500, 0.5000, 0.2000, -0.3000, -0.0500, 1.7500, 1.3000, 0.9000, 1.5000, 3.6500, 4.6500, 2.5500, 1.9500, 3.8000, 1.6500, 2.7500, 2.4500, 3.8000, 5.9000, 6.5000, 5.4000, 5.9500, 4.1500, 3.3000, 1.5500, 0.9500, 2.7000, 3.0000, -0.0500, -0.7500, 0.6500, 0.3000, 0.7500, 0.6000, 3.4000, 7.3000, 5.3500, 2.4500, -0.1500, -1.1500, -0.8500, -0.6000, 1.1500, 4.1500, 6.0000, 3.3500, 3.7000, 4.8000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 2.7500, -0.9000, 1.0500, 1.7000, 1.5500, 4.5000, 5.1500, 1.8000, 3.5000, 7.5500, 4.6000, 2.4500, -3.8500, -5.3500, -5.1500, -5.7000, -7.4500, -8.3000, -10.1500, -2.4500, 5.4000, 3.2000, 2.8000, 2.2500, -0.3000, -3.2000, -0.4500, 4.4000, 2.8500, 2.7000, 2.3500, -0.6500, -2.1500, 1.3500, -0.9500, -2.0500, -0.7500, 0.5000, 0.9000, 0.8000, 0.8500, 0.8500, 0.9000, 3.8500, 5.4500, 4.0000, 5.8500, 3.5000, 2.3500, 1.6000, 0.0500, 0.4000, 1.1000, 1.7500, 1.9000, 1.1500, 0.0000, 1.2000, 0.7500, 0.6000, 2.2000, 4.5000, 4.8500, 5.1000, 3.1500, 1.8500, 5.3000, 6.0000, 5.2000, 2.8000, 1.0000, 2.6000, 4.4500, 5.2500, 4.1000, 1.9500, 2.7000, 2.9500, 2.9000, 2.2500, 1.5500, 4.8500, 4.7500, 3.2500, 1.7500, 0.4000, -0.1000, 0.8000, 2.2500, 5.4500, 8.3500, 4.6000, 2.7500, 2.9000, 3.4500, 2.5000, 3.4000, 0.0000, -0.1000, 1.9500, 5.9500, 3.9000, 1.8500, 2.6000, 4.7500, 3.4000, 0.3500, 1.2000, 1.5500, 1.6000, 1.7000, 2.5000, 3.3000, 0.5500, 0.0500, -0.2000, 1.4000, 2.3500, 1.2500, 1.2000, 0.8500, 1.9000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 0.4000, -4.4500, -2.9000, 3.0000, 1.7500, 1.9000, -0.1000, 1.6000, 4.2500, 7.5500, 8.2000, 7.1500, 6.5000, 5.2500, 5.7000, 4.8500, 2.7000, 6.3000, 3.7000, 0.7000, 4.1500, 4.9000, 6.7000, 4.9500, 4.4000, 8.1000, 4.8500, 1.2000, -1.0500, 3.5500, 4.0500, 5.4000, 5.9500, 5.7000, 7.0500, 7.2500, 6.2500, 4.1500, 2.9000, 1.8500, 2.5500, 3.8000, 3.9500, 2.3500, 3.1500, 3.2000, 2.9500, 2.0000, 4.1000, 3.4500, 2.9500, 5.1500, 6.2000, 2.5000, 1.4000, 2.7000, 2.6000, 1.3500, 0.2000, -0.6500, 1.4500, 1.3500, 1.6500, 0.7000, -0.2500, -2.6500, -5.2000, -2.6000, 0.4500, 3.4000, 2.7000, 0.6000, 1.1000, 1.4000, 1.7000, 1.6500, 1.5000, 0.6500, 1.6000, 1.9000, 1.6500, 1.7500, 5.7500, 6.4500, 5.0500, 4.4000, 5.2500, 3.8500, 4.2000, 4.3500, 2.6000, 1.9500, 2.6000, 2.1500, 1.2000, 1.2500, -1.1000, -0.9500, 2.6500, 0.8500, 0.7000, 2.1500, 4.1500, 2.9500, 2.0000, -0.8500, -0.4500, 1.2500, 0.6500, 1.4000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 10.0000, 0.6500, -1.5000, -0.5000, 0.8000, 0.3500, 2.1500, 2.8000, 2.6500, 2.4500, 1.2000, 2.1000, 3.0500, 4.7500, 3.5500, 5.2500, 5.6000, 2.4000, 5.2500, 4.9000, 4.9500, 2.2000, 2.9000, 2.5500, -1.6500, 3.4500, 6.5000, 2.2000, -2.8500, -0.5000, 0.0500, 3.2500, 6.9000, 6.5500, 4.5000, 2.1500, 1.8000, 6.4000, 7.6500, 6.3000, 4.3000, 6.0500 }; for (int i = 0; i < numberOfTimesteps; i++) { precipitationTs.Items[i].Value = precipitation[i]; potentialEvaporationTs.Items[i].Value = potentialEvaporation[i]; temperatureTs.Items[i].Value = temperature[i]; observedRunoffTs.Items[i].Value = observedRunoff[i]; } hydroCatEngine.InputPrecipitation = precipitationTs; hydroCatEngine.InputPotentialEvaporation = potentialEvaporationTs; hydroCatEngine.InputTemperature = temperatureTs; hydroCatEngine.InputObservedRunoff = observedRunoffTs; hydroCatEngine.Initialize(); parametersPropertyGrid.SelectedObject = hydroCatEngine; timeSeriesPlot.Visible = true; Run(); }
private void Configurate() { numberOfTimesteps = (int)(SimulationEndTime.ToOADate() - SimulationStartTime.ToOADate() - 0.5); precipitation = new TimestampSeries("Precipitation", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.MmPrDay); potentialEvaporation = new TimestampSeries("PotentialEvaportion", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.MmPrDay); temperature = new TimestampSeries("Temperature", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.Centigrade); int numberOfObservedRunoffValues = 0; if (inputObservedRunoff is TimespanSeries) { numberOfObservedRunoffValues = ((TimespanSeries)inputObservedRunoff).Items.Count; } else if (inputObservedRunoff is TimestampSeries) { numberOfObservedRunoffValues = ((TimestampSeries)inputObservedRunoff).Items.Count; } else { throw new Exception("Unexpected exception"); } observedSpecificRunoff = new TimestampSeries("Observed specific runoff", simulationStartTime, numberOfObservedRunoffValues, 1, TimestepUnit.Days, 0, Units.MmPrDay); observedRunoff = new TimestampSeries("Observed Runoff", simulationStartTime, numberOfObservedRunoffValues, 1, TimestepUnit.Days, 0, Units.M3PrSec); for (int i = 0; i < numberOfTimesteps; i++) { DateTime fromTime = SimulationStartTime.AddDays(i); DateTime toTime = SimulationStartTime.AddDays(i + 1); precipitation.Items[i].Value = InputPrecipitation.GetValue(fromTime, toTime, precipitation.Unit); potentialEvaporation.Items[i].Value = InputPotentialEvaporation.GetValue(fromTime, toTime, potentialEvaporation.Unit); temperature.Items[i].Value = InputTemperature.GetValue(fromTime, toTime, temperature.Unit); } for (int i = 0; i < numberOfObservedRunoffValues; i++) { DateTime fromTime = SimulationStartTime.AddDays(i); DateTime toTime = SimulationStartTime.AddDays(i + 1); observedSpecificRunoff.Items[i].Value = InputObservedRunoff.GetValue(fromTime, toTime, observedSpecificRunoff.Unit) * (1000.0 * 3600 * 24 / CatchmentArea); observedRunoff.Items[i].Value = InputObservedRunoff.GetValue(fromTime, toTime, observedRunoff.Unit); } surfaceEvaporation = new TimestampSeries("SurfaceEvaporation", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.MmPrDay); rootZoneEvaporation = new TimestampSeries("RootZoneEvaporation", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.MmPrDay); rainfall = new TimestampSeries("Rainfall", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.MmPrDay); snowfall = new TimestampSeries("Snowfall", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.MmPrDay); snowMelt = new TimestampSeries("Snowmelt", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.MmPrDay); snowStorage = new TimestampSeries("Snow storage", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.Millimiters); surfaceStorage = new TimestampSeries("Surface storage", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.Millimiters); rootZoneStorage = new TimestampSeries("Root zone storage", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.Millimiters); overlandflow = new TimestampSeries("Overlandflow", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.MmPrDay); routedOverlandflow = new TimestampSeries("Routed overlandflow", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.MmPrDay); interflow = new TimestampSeries("Inteflow", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.MmPrDay); routedInterflow = new TimestampSeries("Routed interflow", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.MmPrDay); baseflow = new TimestampSeries("Baseflow", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.MmPrDay); routedBaseflow = new TimestampSeries("Routed baseflow", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.MmPrDay); specificRunoff = new TimestampSeries("Specific runoff", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.MmPrDay); runoff = new TimestampSeries("Runoff", simulationStartTime, numberOfTimesteps, 1, TimestepUnit.Days, 0, Units.M3PrSec); OutputTimeSeries.Items.Clear(); OutputTimeSeries.Items.Add(precipitation); OutputTimeSeries.Items.Add(potentialEvaporation); OutputTimeSeries.Items.Add(temperature); OutputTimeSeries.Items.Add(observedSpecificRunoff); OutputTimeSeries.Items.Add(observedRunoff); OutputTimeSeries.Items.Add(surfaceEvaporation); OutputTimeSeries.Items.Add(rootZoneEvaporation); OutputTimeSeries.Items.Add(rainfall); OutputTimeSeries.Items.Add(snowfall); OutputTimeSeries.Items.Add(snowMelt); OutputTimeSeries.Items.Add(snowStorage); OutputTimeSeries.Items.Add(surfaceStorage); OutputTimeSeries.Items.Add(rootZoneStorage); OutputTimeSeries.Items.Add(overlandflow); OutputTimeSeries.Items.Add(routedOverlandflow); OutputTimeSeries.Items.Add(interflow); OutputTimeSeries.Items.Add(routedInterflow); OutputTimeSeries.Items.Add(baseflow); OutputTimeSeries.Items.Add(routedBaseflow); OutputTimeSeries.Items.Add(specificRunoff); OutputTimeSeries.Items.Add(runoff); foreach (TimestampSeries ts in OutputTimeSeries.Items) { ts.IsVisible = false; } observedRunoff.IsVisible = true; runoff.IsVisible = true; isConfigurated = true; }
public void TestMethod1() { Lake Vedsted = LakeFactory.GetLake("Vedsted Sø"); Vedsted.Depth = 5; Vedsted.WaterLevel = 45.7; //Create and add precipitation boundary TimespanSeries Precipitation = new TimespanSeries(); double[] values = new double[] { 108, 83, 73, 52, 61, 86, 99, 101, 75, 108, 85, 101 }; LakeVedsted.AddMonthlyValues(Precipitation, 2007, values); SinkSourceBoundary Precip = new SinkSourceBoundary(Precipitation); Precip.ContactGeometry = Vedsted.SurfaceArea; Vedsted.Sources.Add(Precip); //Create and add evaporation boundary TimespanSeries Evaporation = new TimespanSeries(); double[] values2 = new double[] { 4, 11, 34, 66, 110, 118, 122, 103, 61, 26, 7, 1 }; LakeVedsted.AddMonthlyValues(Evaporation, 2007, values2); EvaporationRateBoundary eva = new EvaporationRateBoundary(Evaporation); eva.ContactGeometry = Vedsted.SurfaceArea; Vedsted.EvaporationBoundaries.Add(eva); //Create and add a discharge boundary TimestampSeries Discharge = new TimestampSeries(); Discharge.AddSiValue(new DateTime(2007, 3, 12), 6986 / TimeSpan.FromDays(365).TotalSeconds); Discharge.AddSiValue(new DateTime(2007, 4, 3), 5894 / TimeSpan.FromDays(365).TotalSeconds); Discharge.AddSiValue(new DateTime(2007, 4, 25), 1205 / TimeSpan.FromDays(365).TotalSeconds); Discharge.RelaxationFactor = 1; Discharge.AllowExtrapolation = true; Assert.AreEqual(Discharge.GetValue(new DateTime(2007, 4, 25)), Discharge.GetValue(new DateTime(2007, 6, 25)), 0.0000001); SinkSourceBoundary Kilde = new SinkSourceBoundary(Discharge); Vedsted.Sources.Add(Kilde); //Add a groundwater boundary GroundWaterBoundary gwb = new GroundWaterBoundary(Vedsted, 1e-5, 1, 46, (XYPolygon)Vedsted.Geometry); DateTime Start = new DateTime(2007, 1, 1); //Add the chemicals Chemical cl = ChemicalFactory.Instance.GetChemical(ChemicalNames.Cl); //Tell the lake to log the chemicals Vedsted.Output.LogChemicalConcentration(ChemicalFactory.Instance.GetChemical(ChemicalNames.IsotopeFraction)); Vedsted.Output.LogChemicalConcentration(cl); IsotopeWater Iw = new IsotopeWater(1); Iw.SetIsotopeRatio(10); Iw.AddChemical(cl, 0.1); Precip.WaterSample = Iw.DeepClone(); //Evaporate some of the water to get realistic initial conditions Iw.Evaporate(Iw.Volume / 2); Vedsted.SetState("Initial", Start, Iw.DeepClone()); Kilde.WaterSample = Iw.DeepClone(); Iw.Evaporate(Iw.Volume / 2); gwb.WaterSample = Iw.DeepClone(); //Add to an engine Model Engine = new Model(); Engine.Name = "Vedsted-opsætning"; Engine._waterBodies.Add(Vedsted); //Set initial state Engine.SetState("Initial", Start, new WaterPacket(1)); Engine.Save(@"c:\temp\setup.xml"); }
public TimestampSeriesGrid(TimestampSeries timestampSeries) : this() { this.dataGridView1.DataSource = timestampSeries; this.timeSeriesData = timestampSeries; }
public void AddChemicalConcentrationSeries(Chemical C, TimestampSeries Concentration) { _concentrations.Add(C, Concentration); }
public void BuildConcFromCSV() { TimeSeriesGroup tsg = new TimeSeriesGroup(); TimestampSeries ts1 = new TimestampSeries(); ts1.Name = "Alkalinitet"; TimestampSeries ts2 = new TimestampSeries(); ts2.Name = "Nitrate"; TimestampSeries ts3 = new TimestampSeries(); ts3.Name = "Total nitrogen"; TimestampSeries ts4 = new TimestampSeries(); ts4.Name = "Chlorid"; TimestampSeries ts5 = new TimestampSeries(); ts5.Name = "Phosphor"; TimestampSeries ts6 = new TimestampSeries(); ts6.Name = "Suspenderet stof"; tsg.Items.Add(ts1); tsg.Items.Add(ts2); tsg.Items.Add(ts3); tsg.Items.Add(ts4); tsg.Items.Add(ts5); tsg.Items.Add(ts6); using (StreamReader sr = new StreamReader(@"..\..\..\TestData\gjeller_analyse.csv")) { sr.ReadLine(); sr.ReadLine(); sr.ReadLine(); sr.ReadLine(); sr.ReadLine(); sr.ReadLine(); while (!sr.EndOfStream) { var arr = sr.ReadLine().Split(';'); DateTime date = DateTime.Parse(arr[0]); double d; if (double.TryParse(arr[9], out d)) { ts6.AddSiValue(date, d); } if (double.TryParse(arr[15], out d)) { ts1.AddSiValue(date, d); } if (double.TryParse(arr[23], out d)) { ts2.AddSiValue(date, d); } if (double.TryParse(arr[25], out d)) { ts3.AddSiValue(date, d); } if (double.TryParse(arr[29], out d)) { ts4.AddSiValue(date, d); } if (double.TryParse(arr[31], out d)) { ts5.AddSiValue(date, d); } } } tsg.Save(@"..\..\..\TestData\GjellerObservations.xts"); }
public override IValueSet GetValues(ITime time, string LinkID) { if (!initializeWasInvoked) { throw new Exception("Method \"GetValues\" in LinkableTimeSeriesGroup class was invoked before the Initialize method was invoked"); } ILink link = this.GetLink(LinkID); SendSourceAfterGetValuesCallEvent(time, link); // -- handle incoming links (where this component is the target) if (!isBusy) //avoiding deadlocks { isBusy = true; foreach (ILink acceptingLink in _acceptingLinks) { if (((TsQuantity)acceptingLink.TargetQuantity).BaseTimeSeries is TimestampSeries) { TimestampSeries timestampSeries = (TimestampSeries)((TsQuantity)acceptingLink.TargetQuantity).BaseTimeSeries; foreach (TimestampValue timestampValue in timestampSeries.Items) { TimeStamp getValuesTime = new TimeStamp(timestampValue.Time); SendTargetBeforeGetValuesCall(getValuesTime, acceptingLink); IValueSet valueSet = acceptingLink.SourceComponent.GetValues(getValuesTime, acceptingLink.ID); timestampValue.Value = ((IScalarSet)valueSet).GetScalar(0); SendTargetAfterGetValuesReturn(timestampValue.Value, acceptingLink); } } else if (((TsQuantity)acceptingLink.TargetQuantity).BaseTimeSeries is TimespanSeries) { TimespanSeries timespanSeries = (TimespanSeries)((TsQuantity)acceptingLink.TargetQuantity).BaseTimeSeries; foreach (TimespanValue timespanValue in timespanSeries.Items) { HydroNumerics.OpenMI.Sdk.Backbone.TimeSpan timeSpan = new HydroNumerics.OpenMI.Sdk.Backbone.TimeSpan(new HydroNumerics.OpenMI.Sdk.Backbone.TimeStamp(timespanValue.StartTime), new HydroNumerics.OpenMI.Sdk.Backbone.TimeStamp(timespanValue.EndTime)); SendTargetBeforeGetValuesCall(timeSpan, acceptingLink); IValueSet valueSet = acceptingLink.SourceComponent.GetValues(timeSpan, acceptingLink.ID); timespanValue.Value = ((IScalarSet)valueSet).GetScalar(0); SendTargetAfterGetValuesReturn(timespanValue.Value, acceptingLink); } } else { throw new Exception("Unexpected exception : Undefined timeseries type (occured in HydroNumerics.Time.OpenMI.LinkableTimeSeriesGroup class)"); } } isBusy = false; } // -- handle outgoing links (where this component is the source) HydroNumerics.Core.Unit toUnit = new HydroNumerics.Core.Unit(); toUnit.ConversionFactorToSI = link.TargetQuantity.Unit.ConversionFactorToSI; toUnit.OffSetToSI = link.TargetQuantity.Unit.OffSetToSI; if (time is ITimeStamp) { HydroNumerics.OpenMI.Sdk.Backbone.TimeStamp t = new TimeStamp((ITimeStamp)time); double x = ((TsQuantity)link.SourceQuantity).BaseTimeSeries.GetValue(t.ToDateTime(), toUnit); ScalarSet scalarSet = new ScalarSet(new double[] { x }); SendSourceBeforeGetValuesReturn(x, link); return(scalarSet); } else { HydroNumerics.OpenMI.Sdk.Backbone.TimeStamp start = new TimeStamp(((ITimeSpan)time).Start); HydroNumerics.OpenMI.Sdk.Backbone.TimeStamp end = new TimeStamp(((ITimeSpan)time).End); double x = ((TsQuantity)link.SourceQuantity).BaseTimeSeries.GetValue(start.ToDateTime(), end.ToDateTime(), toUnit); ScalarSet scalarSet = new ScalarSet(new double[] { x }); SendSourceBeforeGetValuesReturn(x, link); return(scalarSet); } }
public void GetValue02() // GetValue(DateTime fromTime, DateTime toTime) { //-- Expected exception when GetValues is invoked on an empty timeseries. -- TimestampSeries timeSeries = new TimestampSeries(); try { timeSeries.GetValue(new DateTime(2010, 1, 1, 0, 0, 0), new DateTime(2010, 1, 2, 0, 0, 0)); } catch (Exception ex) { Assert.IsTrue(ex.GetType() == typeof(Exception)); } timeSeries.Items.Add(new TimestampValue(new DateTime(2010, 1, 1, 0, 0, 0), 3.0)); //Testing when only one record in timeseries Assert.AreEqual(3.0, timeSeries.GetValue(new DateTime(2010, 11, 1, 0, 0, 0), new DateTime(2010, 12, 1, 0, 0, 0))); timeSeries.Items.Add(new TimestampValue(new DateTime(2010, 1, 2, 0, 0, 0), 6.0)); timeSeries.Items.Add(new TimestampValue(new DateTime(2010, 1, 3, 0, 0, 0), 6.0)); timeSeries.Items.Add(new TimestampValue(new DateTime(2010, 1, 4, 0, 0, 0), 4.0)); timeSeries.RelaxationFactor = 1.0; try { timeSeries.GetValue(new DateTime(2010, 1, 1, 0, 0, 0), new DateTime(2010, 1, 1, 0, 0, 0)); } catch (Exception ex) { //Testing invalid argument for timespan Assert.IsTrue(ex.GetType() == typeof(Exception)); } try { timeSeries.GetValue(new DateTime(2010, 1, 2, 0, 0, 0), new DateTime(2010, 1, 1, 0, 0, 0)); } catch (Exception ex) { //Testing invalid argument for timespan Assert.IsTrue(ex.GetType() == typeof(Exception)); } timeSeries.RelaxationFactor = 0.0; // v--------------------------------------V // |------------|------------|------------| // 3 6 6 4 Assert.AreEqual(15.5 / 3.0, timeSeries.GetValue(new DateTime(2010, 1, 1, 0, 0, 0), new DateTime(2010, 1, 4, 0, 0, 0))); //interval same as the full timeseries // v-----------v // |------------|------------|------------| Assert.AreEqual(5.625, timeSeries.GetValue(new DateTime(2010, 1, 1, 12, 0, 0), new DateTime(2010, 1, 2, 12, 0, 0))); // v-------------------------v // |------------|------------|------------| Assert.AreEqual(11.375 / 2.0, timeSeries.GetValue(new DateTime(2010, 1, 1, 12, 0, 0), new DateTime(2010, 1, 3, 12, 0, 0))); // v----v // |------------|------------|------------| Assert.AreEqual(4.5, timeSeries.GetValue(new DateTime(2010, 1, 1, 6, 0, 0), new DateTime(2010, 1, 1, 18, 0, 0))); // v--------------------------------------------------------------v // ------------|------------|------------|------------|------------ Assert.AreEqual(4.0, timeSeries.GetValue(new DateTime(2009, 12, 31, 0, 0, 0), new DateTime(2010, 1, 5, 0, 0, 0))); //Extrapolating outside timeseries }
public DemoViewModel(string Name, XYPolygon SurfaceArea, TimespanSeries Evaporation, TimespanSeries Precipitation) { Calibration = 1; _lake = new Lake(Name, SurfaceArea); _lake.Depth = 5; _lake.WaterLevel = 45.7; //Create and add precipitation boundary SinkSourceBoundary Precip = new SinkSourceBoundary(Precipitation); Precip.ContactGeometry = _lake.SurfaceArea; _lake.Sources.Add(Precip); //Create and add evaporation boundary EvaporationRateBoundary eva = new EvaporationRateBoundary(Evaporation); eva.ContactGeometry = _lake.SurfaceArea; _lake.EvaporationBoundaries.Add(eva); //Create and add a discharge boundary Discharge = new TimestampSeries(); Discharge.AddSiValue(new DateTime(2007, 3, 12), 6986 / TimeSpan.FromDays(365).TotalSeconds); Discharge.AddSiValue(new DateTime(2007, 4, 3), 5894 / TimeSpan.FromDays(365).TotalSeconds); Discharge.AddSiValue(new DateTime(2007, 4, 25), 1205 / TimeSpan.FromDays(365).TotalSeconds); Discharge.RelaxationFactor = 1; Discharge.AllowExtrapolation = true; Discharge.Name = "Inflow"; SinkSourceBoundary Kilde = new SinkSourceBoundary(Discharge); _lake.Sources.Add(Kilde); //Add a groundwater boundary GroundWaterBoundary gwb = new GroundWaterBoundary(_lake, 1e-7, 1, 46, (XYPolygon)_lake.Geometry); _lake.GroundwaterBoundaries.Add(gwb); DateTime Start = new DateTime(2007, 1, 1); //Add to an engine Engine = new Model(); Engine._waterBodies.Add(_lake); //Set initial state Engine.SetState("Initial", Start, new WaterPacket(1)); //Add the chemicals Chemical cl = ChemicalFactory.Instance.GetChemical(ChemicalNames.Cl); //Tell the lake to log the chemicals _lake.Output.LogChemicalConcentration(ChemicalFactory.Instance.GetChemical(ChemicalNames.IsotopeFraction)); _lake.Output.LogChemicalConcentration(cl); IsotopeWater Iw = new IsotopeWater(1); Iw.SetIsotopeRatio(0.2); Iw.AddChemical(cl, 0.1); Precip.WaterSample = Iw.DeepClone(); //Evaporate some of the water to get realistic initial conditions Iw.Evaporate(Iw.Volume / 2); _lake.SetState("Initial", Start, Iw.DeepClone(_lake.Volume)); Kilde.WaterSample = Iw.DeepClone(); Iw.Evaporate(Iw.Volume / 2); gwb.WaterSample = Iw.DeepClone(); }
public void TestMethod1() { List <TimestampValue> _list = new List <TimestampValue>(); DateTime Start = DateTime.Now; int n = 100000; for (int i = 0; i < n; i++) { _list.Add(new TimestampValue(Start.AddSeconds(i), i)); } Stopwatch sw = new Stopwatch(); SortedList <DateTime, double> _sortedList = new SortedList <DateTime, double>(); sw.Start(); for (int i = n - 1; i > 0; i--) { _sortedList.Add(_list[i].Time, _list[i].Value); } sw.Stop(); Console.WriteLine("SortedList:" + sw.Elapsed); SortedDictionary <DateTime, double> _sortedDictionary = new SortedDictionary <DateTime, double>(); sw.Reset(); sw.Start(); for (int i = n - 1; i > 0; i--) { _sortedDictionary.Add(_list[i].Time, _list[i].Value); } sw.Stop(); Console.WriteLine("SortedDictionary:" + sw.Elapsed); TimestampSeries ts = new TimestampSeries(); sw.Reset(); sw.Start(); for (int i = n - 1; i > 0; i--) { ts.AddValue(_list[i].Time, _list[i].Value); } sw.Stop(); Console.WriteLine("TimestampSeries:" + sw.Elapsed); List <TimestampValue> _listAndSort = new List <TimestampValue>(); sw.Reset(); sw.Start(); for (int i = n - 1; i > 0; i--) { _listAndSort.Add(_list[i]); } _listAndSort.Sort((var, var2) => var.Time.CompareTo(var2.Time)); sw.Stop(); Console.WriteLine("_listAndSort:" + sw.Elapsed); sw.Reset(); sw.Start(); _listAndSort.Sort((var, var2) => var.Time.CompareTo(var2.Time)); sw.Stop(); Console.WriteLine("Sort sorted list:" + sw.Elapsed); }