当前位置: 首页>>代码示例>>C#>>正文


C# Series.Read方法代码示例

本文整理汇总了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");
        }
开发者ID:usbr,项目名称:Pisces,代码行数:25,代码来源:HeiiRuleCurve.cs

示例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();
 }
开发者ID:usbr,项目名称:Pisces,代码行数:8,代码来源:Program.cs

示例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);
     }
 }
开发者ID:usbr,项目名称:Pisces,代码行数:31,代码来源:SeriesExpressionParser.cs

示例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();
        }
开发者ID:usbr,项目名称:Pisces,代码行数:30,代码来源:WaterProfileDatabase.cs

示例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;
        }
开发者ID:usbr,项目名称:Pisces,代码行数:34,代码来源:Math.ET.cs


注:本文中的Series.Read方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。