CronoSeries
0.1.*
A fork of Cronos with a focus on being a Time Series class library.
|
Public Member Functions | |
DateTime | TimeStamp (int idx) |
int | IndexAtOrBefore (DateTime time, out bool exact) |
void | InsertInMiddle (DateTime time, T value, bool forceOverwrite) |
inserts a new point into the time series. if the datetime already has a value, then it either replaces it or throws an exception More... | |
TimeSeriesBase< T > | GetSubrange (DateTime t0, DateTime t1) |
T | ValueAtTime (DateTime time) |
does a binary search for the appropriate index, interpolating using a step-function. if earlier or later than first or last observation, the first/last value is returned. More... | |
T | ValueAtTime (DateTime time, out bool gotExactTime) |
does a binary search for the appropriate index, interpolating using a step-function. if earlier or later than first or last observation, the first/last value is returned. this function sets an output flag indicating whether or not there was an exact time match. More... | |
void | DeletePoint (DateTime time) |
void | DeleteBefore (DateTime time, bool keepOne) |
removes all points strictly before the specified time More... | |
void | SetValue (int idx, T value) |
DateTime | GetFirstTime () |
DateTime | GetLastTime () |
TimeSpan | GetCommonSamplingInterval () |
void | Add (TimeSeriesBase< T > otherTS, bool forceOverwrite) |
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) More... | |
void | Add (DateTime time, T value, bool forceOverwrite) |
adds a value to the time series. works most efficiently if it comes at the end chronologically. if the timestamp already exists, then it either throws an exception or overwrites the existing value. More... | |
void | RemoveFirst () |
void | RemoveLast () |
Public Attributes | |
int | Count => values.Count |
T | this[int i] => values[i] |
Static Public Attributes | |
static readonly double | ticksPerDay = new TimeSpan(24, 0, 0).Ticks |
Protected Attributes | |
List< DateTime > | times |
List< T > | values |
Properties | |
int | Dimension [get, set] |
string | Title [get, set] |
string | Description [get, set] |
|
inline |
adds a value to the time series. works most efficiently if it comes at the end chronologically. if the timestamp already exists, then it either throws an exception or overwrites the existing value.
time | time of new point |
value | value to add |
forceOverwrite | if timestamp already exists, determines whether to throw an exception or overwrite existing value |
|
inline |
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)
otherTS | |
forceOverwrite |
|
inline |
removes all points strictly before the specified time
time | |
keepOne | true if one extra point should be kept |
|
inline |
inserts a new point into the time series. if the datetime already has a value, then it either replaces it or throws an exception
time | time at which value is to be inserted |
value | value to be inserted |
forceOverwrite | determines whether exception is thrown when point alread exists |
|
inline |
does a binary search for the appropriate index, interpolating using a step-function. if earlier or later than first or last observation, the first/last value is returned.
|
inline |
does a binary search for the appropriate index, interpolating using a step-function. if earlier or later than first or last observation, the first/last value is returned. this function sets an output flag indicating whether or not there was an exact time match.
time | |
gotExactTime |