本文整理汇总了C#中Series.Read方法的典型用法代码示例。如果您正苦于以下问题:C# Series.Read方法的具体用法?C# Series.Read怎么用?C# Series.Read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Series
的用法示例。
在下文中一共展示了Series.Read方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
private void Init(int waterYear)
{
qu = new HydrometDailySeries("HEII", "QU");
var t1 = new DateTime(waterYear-1, 10, 1);
var t2 = new DateTime(waterYear, 8, 1);
if (t2 > DateTime.Now && t2.Year != 7100)
{
t2 = DateTime.Now.AddDays(-1);
}
qu.Read(t1, t2);
// find date where (if) 20,000 cfs occurs at heii.
for (int i = 0; i < qu.Count; i++)
{
Point pt = qu[i];
if( !pt.IsMissing && pt.Value >=20000)
{
quDate20000 = pt.DateTime;
break;
}
}
solid = FcPlotDataSet.GetPeriodicSeries("Heii.Solid");
dashed = FcPlotDataSet.GetPeriodicSeries("Heii.Dashed");
}
示例2: SaveProperties
static void SaveProperties(Series s)
{
s.Read();
s.Properties.Set("t1", s.MinDateTime.ToShortDateString());
s.Properties.Set("t2", s.MaxDateTime.ToShortDateString());
s.Properties.Set("count", s.Count.ToString());
s.Properties.Save();
}
示例3: ReadAndShiftData
/// <summary>
/// Read Data and then shift in days or months
/// </summary>
/// <param name="timeOffset"></param>
/// <param name="s"></param>
/// <returns></returns>
public static Series ReadAndShiftData(int timeOffset, Series s, DateTime t1, DateTime t2)
{
if (timeOffset == 0)
{
s.Read(t1, t2);
return s;
}
else
{
if (s.TimeInterval == TimeInterval.Daily)
{
s.Read(t1.AddDays(-timeOffset), t2.AddDays(-timeOffset));
}
else
if (s.TimeInterval == TimeInterval.Monthly)
{
s.Read(t1.AddMonths(-timeOffset), t2.AddMonths(-timeOffset));
}
else
{
throw new ArgumentException(" Error unsupported interval :" + s.TimeInterval);
}
return Math.Shift(s, timeOffset);
}
}
示例4: LoadSeries
/// <summary>
/// Defines the timeseries data (by name) that defines
/// water temperature values, and the corresponding depths
/// of the water temperature sensors
/// </summary>
/// <param name="sensorSeriesNames"></param>
/// <param name="depthSeriesNames"></param>
public void LoadSeries(string[] sensorSeriesNames, string[] depthSeriesNames, string waterSurfaceSeriesName="")
{
if (sensorSeriesNames.Length != depthSeriesNames.Length)
throw new ArgumentException("sensorSeriesNames must have the same number of items as depthSeriesNames");
for (int i = 0; i < sensorSeriesNames.Length; i++)
{
var ss = m_db.GetSeriesFromName(sensorSeriesNames[i]);
var ds = m_db.GetSeriesFromName(depthSeriesNames[i]);
depths.Add(ds);
sensors.Add(ss);
}
if (waterSurfaceSeriesName.Trim() != "")
{
waterSurfaceSeries = m_db.GetSeriesFromName(waterSurfaceSeriesName);
if (waterSurfaceSeries != null)
waterSurfaceSeries.Read();
}
depths.Read();
sensors.Read();
}
示例5: DailyEtKimberlyPenman
public static Series DailyEtKimberlyPenman( Series mm, Series mn, Series mx,
Series ym, Series wr, Series sr, double latitude, double elevation)
{
Series rval = new Series();
rval.TimeInterval = TimeInterval.Daily;
// we need three previous days for average temp
// throw away and re-read mm
if (mm.Count == 0)
{
Console.WriteLine("Error:DailyEtKimberlyPenman MM (max temperature) data not found");
return rval;
}
if (mn.Count == 0)
{
Console.WriteLine("Error:DailyEtKimberlyPenman MN (min temperature) data not found");
return rval;
}
mm.Read(mm[0].DateTime.AddDays(-3), mm[mm.Count - 1].DateTime);
rval.TimeInterval = TimeInterval.Daily;
DateTime t = mn[0].DateTime.Date;
DateTime t2 = mn[mn.Count-1].DateTime.Date;
while ( t <= t2)
{
var pt = Hydromet.KimberlyPenmanEtSeries.Calculate(t, mm, mn, mx, ym, wr, sr, latitude, elevation);
rval.Add(pt);
t = t.AddDays(1);
}
return rval;
}