/// <summary> /// adds a whole additional time series to the end of this one /// (actually it doesn't have to be at the end, but it's most efficient that way) /// </summary> /// <param name="otherTS"></param> /// <param name="forceOverwrite"></param> public void Add(TimeSeriesBase <T> otherTS, bool forceOverwrite) { for (int t = 0; t < otherTS.Count; ++t) { Add(otherTS.TimeStamp(t), otherTS[t], forceOverwrite); } }
public TimeSeriesBase <T> GetSubrange(DateTime t0, DateTime t1) { var retval = new TimeSeriesBase <T>(); bool gotIt0; bool gotIt1; int i0 = IndexAtOrBefore(t0, out gotIt0); int i1 = IndexAtOrBefore(t1, out gotIt1); if (i1 == -1) // there is nothing at or before t1 { return(retval); // empty } if (!gotIt0) { ++i0; } for (int t = i0; t <= i1; ++t) { retval.Add(TimeStamp(t), values[t], false); } return(retval); }