This module contains string constants used in timeseries properties.
Attribute name for sample aggregation over steps
AGGREGATION value: Period max
AGGREGATION value: Period min
AGGREGATION value: Period mean
AGGREGATION value: Accumulation
AGGREGATION value: Instantaneous values
TIMESTAMP value: Attribute name for time stamping convention
TIMESTAMP value: Stamped at beginning of period
TIMESTAMP value: Stamped at end of period
Generate a Gaussian ARMA(p,q) series. This was obtained from stack exchange and is not written in terms of a time series ... however it can be used as an ingredient in a time series providing correlated random noise
Parameters:  phi : array An array of length p with the AR coefficients (the AR part of the ARMA model). : theta : array An array of length q with the MA coefficients (the MA part of the ARMA model). : sigma : float Standard deviation of the Gaussian noise. : n : Length of the returned series. discard: Number of data points that are going to be discarded (the higher :


Returns:  Numpy array from an ARMA(p,q) process : 
flow rate of old river at head with 15 minutes interval
Sea surface level at Point Reyes from NOAA downsampled to 1hour interval from 11/01/201311/08/2013
Sea surface level at Point Reyes from NOAA with 6 min interval from 11/24/201311/25/2013
Sea surface level at Point Reys with gaps of different length”
Return a week long synthetic tide
Time series module Module contains the TimeSeries class and the factory functions for creating regular and irregular time series, as well as some helper functions.
Bases: object
Fundamental class for both regular and irregular time series. The preferred way to create a time series is with the rts or its factory functions, not with the constructor. The member attributes include the times and data in the series (which are paired) as well as methods of querying the time series properties (start, end, interval) of the time series.
Methods
Return a time series with times centered between the timestamps of the original series.
Parameters:  copy_data : boolean,optional
neaten : boolean, optional 

Returns:  result : TimeSeries

Perform a copy of this series, optionally with clipped start and end
Parameters:  start : datetime.datetime
end : datetime.datetime
left : boolean, optional
right : boolean, optional


Returns:  result : TimeSeries

See also
Data component of series (for all time)
Time at last element of series
find out if timeseries has nan data
return the indexes of the time series at/after points given by tm.
Input tm maybe a single datetime or list/array datetime, or single ticks or list/array of ticks. Accordingly, return will be a single index or array of indexes
If points are found, corresponding indexes will be return, if not, indexes whose time are directly after points will be returned.
Performance of this method is better if tm is given by ticks if this is convenient; otherwise, if given a sequence of times, the method will convert the sequence to ticks automatically.
Return the index of the time series at point tm
Returns true if the time series is regular A regular series is considered regular if it has a sampling interval. This interval may or may not be calendar dependent.
Dictionary containing attributes, metadata and user properties
Return a time series with data replaced by input ts or constant
Parameters:  ts : TimeSeries or constant
start : datetime.datetime
end : datetime.datetime


Returns:  result : TimeSeries

Return a time series with the timestamps shifted by a interval.
Parameters:  interval : dateutil.relativedelta, datetime.timedelta, string copy_data : boolean,optional


Returns:  result : TimeSeries

Time at first element of series
Array of long integer ticks representing the time index of the series
Array of datetimes represented by series
Provide a sharedmemory ts (shared data and props) with a reduced time window
Note
if left=True, the first time point will be at or before the given start time otherwise, the first time will be at or after the given start. same for right.
Parameters:  start : datetime.datetime
end : datetime.datetime
left : boolean, optional
right : boolean, optional


Returns:  result : TimeSeries

See also
Bases: object
Time point in long integer ticks of element
Time at element
Value at element
Extend a regular time series with newer start/end
Parameters:  start : datetime.datetime
end : datetime.datetime
method : :string
val : float


Returns:  result : TimeSeries

Return the integer index of a time sequence that is on or after tm
Parameters:  seq : time_sequence The sequence whose index will be searched : tm : datetime.datetime Time whose index is sought : 

Returns:  The integer index in the sequence that fall on or after tm. : 
Return the integer index of a time sequence that is on or before tm
Parameters:  seq : time_sequence The sequence whose index will be searched : tm : datetime.datetime Time whose index is sought : 

Returns:  The integer index in the sequence that fall on or before tm. : 
Parameters:  seq : time_sequence The sequence whose index will be searched : tm : list of datetime.datetime List of times whose index is sought : 

Create an irregular time series from time and data sequences
Parameters:  times : time_sequence
data : array or list of values


Returns:  result : TimeSeries

Convert an irregular time series to a regular.
This function assumes observations were taken at “almost regular” intervals with some variation due to clocks/recording. It nudges the time to “neat” time points to obtain the corresponding regular index, allowing gaps. There is no correctness checking, The dates are stored at the original “imperfect” time points if original_dates == True, otherwise at the “nudged” regular times.
Parameters:  its : TimeSeries


Returns:  result : TimeSeries

Create data for timealigned op binary operation between two series Returns data holders and selections required to carry out indexaligned binary operations on two series. Mostly of interest to programmers.
Parameters:  ts1,ts2 : TimeSeries


Returns:  seq : time_sequence
start : py:class:datetime.datetime
slice0 : slice
slice1 : slice
slice2 : slice

Intersection of time ranges of two series.
Note
may return result with union_start > union_end, in which case there is no intersection.
Parameters:  ts0,ts1 : TimeSeries


Returns:  range : (datetime.datetime, datetime.datetime)

Union of time ranges of two series.
Parameters:  ts0,ts1 : TimeSeries


Returns:  range : (datetime.datetime, datetime.datetime)

Create a regular or calendar time series from data and time parameters
Parameters:  data : array_like
start : datetime.datetime
interval : time_interval


Returns:  result : TimeSeries

Create a regular or calendar time series filled with constant value
Parameters:  start : datetime.datetime
end : datetime.datetime
interval : time_interval
val : float,int


Returns:  result : TimeSeries

Time series module Module contains the TimeSeries class and the factory functions for creating regular and irregular time series, as well as some helper functions.
Bases: object
Fundamental class for both regular and irregular time series. The preferred way to create a time series is with the rts or its factory functions, not with the constructor. The member attributes include the times and data in the series (which are paired) as well as methods of querying the time series properties (start, end, interval) of the time series.
Methods
Return a time series with times centered between the timestamps of the original series.
Parameters:  copy_data : boolean,optional
neaten : boolean, optional 

Returns:  result : TimeSeries

Perform a copy of this series, optionally with clipped start and end
Parameters:  start : datetime.datetime
end : datetime.datetime
left : boolean, optional
right : boolean, optional


Returns:  result : TimeSeries

See also
Data component of series (for all time)
Time at last element of series
find out if timeseries has nan data
return the indexes of the time series at/after points given by tm.
Input tm maybe a single datetime or list/array datetime, or single ticks or list/array of ticks. Accordingly, return will be a single index or array of indexes
If points are found, corresponding indexes will be return, if not, indexes whose time are directly after points will be returned.
Performance of this method is better if tm is given by ticks if this is convenient; otherwise, if given a sequence of times, the method will convert the sequence to ticks automatically.
Return the index of the time series at point tm
Returns true if the time series is regular A regular series is considered regular if it has a sampling interval. This interval may or may not be calendar dependent.
Dictionary containing attributes, metadata and user properties
Return a time series with data replaced by input ts or constant
Parameters:  ts : TimeSeries or constant
start : datetime.datetime
end : datetime.datetime


Returns:  result : TimeSeries

Return a time series with the timestamps shifted by a interval.
Parameters:  interval : dateutil.relativedelta, datetime.timedelta, string copy_data : boolean,optional


Returns:  result : TimeSeries

Time at first element of series
Array of long integer ticks representing the time index of the series
Array of datetimes represented by series
Provide a sharedmemory ts (shared data and props) with a reduced time window
Note
if left=True, the first time point will be at or before the given start time otherwise, the first time will be at or after the given start. same for right.
Parameters:  start : datetime.datetime
end : datetime.datetime
left : boolean, optional
right : boolean, optional


Returns:  result : TimeSeries

See also
Bases: object
Time point in long integer ticks of element
Time at element
Value at element
Extend a regular time series with newer start/end
Parameters:  start : datetime.datetime
end : datetime.datetime
method : :string
val : float


Returns:  result : TimeSeries

Return the integer index of a time sequence that is on or after tm
Parameters:  seq : time_sequence The sequence whose index will be searched : tm : datetime.datetime Time whose index is sought : 

Returns:  The integer index in the sequence that fall on or after tm. : 
Return the integer index of a time sequence that is on or before tm
Parameters:  seq : time_sequence The sequence whose index will be searched : tm : datetime.datetime Time whose index is sought : 

Returns:  The integer index in the sequence that fall on or before tm. : 
Parameters:  seq : time_sequence The sequence whose index will be searched : tm : list of datetime.datetime List of times whose index is sought : 

Create an irregular time series from time and data sequences
Parameters:  times : time_sequence
data : array or list of values


Returns:  result : TimeSeries

Convert an irregular time series to a regular.
This function assumes observations were taken at “almost regular” intervals with some variation due to clocks/recording. It nudges the time to “neat” time points to obtain the corresponding regular index, allowing gaps. There is no correctness checking, The dates are stored at the original “imperfect” time points if original_dates == True, otherwise at the “nudged” regular times.
Parameters:  its : TimeSeries


Returns:  result : TimeSeries

Create data for timealigned op binary operation between two series Returns data holders and selections required to carry out indexaligned binary operations on two series. Mostly of interest to programmers.
Parameters:  ts1,ts2 : TimeSeries


Returns:  seq : time_sequence
start : py:class:datetime.datetime
slice0 : slice
slice1 : slice
slice2 : slice

Intersection of time ranges of two series.
Note
may return result with union_start > union_end, in which case there is no intersection.
Parameters:  ts0,ts1 : TimeSeries


Returns:  range : (datetime.datetime, datetime.datetime)

Union of time ranges of two series.
Parameters:  ts0,ts1 : TimeSeries


Returns:  range : (datetime.datetime, datetime.datetime)

Create a regular or calendar time series from data and time parameters
Parameters:  data : array_like
start : datetime.datetime
interval : time_interval


Returns:  result : TimeSeries

Create a regular or calendar time series filled with constant value
Parameters:  start : datetime.datetime
end : datetime.datetime
interval : time_interval
val : float,int


Returns:  result : TimeSeries

Basic ops for creating, testing and manipulating times and time intervals. This module contains factory and helper functions for working with times and time intervals.
The module will import the name datetime and is designed to work exclusively with python datetimes. In addition, datetimes are convertible to long integer timestamps called ticks. The resolution of 1 tick in ticks per second may be obtained using the resolution() function or certain utility constants such as ticks_per_day. Never code with hard wired numbers.
For time intervals (or deltas), VTools requires a time and time interval system that is consistent (e.g. time+n*interval makes sense) and that can be applied to both calendar dependent and calendarindependent intervals. Because this requirement is not met by any one implementation it is recommended that you always use the factory functions in this module for creating intervals or testing whether an interval is valid.
Finds a neat time point that is calendar aligned with the given interval either to the right (+1) or the left (1) of the arg timepoint. E.g., align(01Jan1992 00:
Create a time interval representing d days
Create a time interval representing h hours
Increment a time by an interval. Safely increment time by interval ninterval times. This function helps resolve a bug in dateutil. Arguments:
time: time to be incremented interval: the interval to use nintvl: number of times to increment it
Infer a time interval from a time sequence using differences
Parameters:  time_sequence : time_sequence sequence to be analyzed : fraction : float fraction of intervals in the sample that must conform once times are : rounded to one minute. For instance, if four times are input, : this will create three differences, so a fraction=0.67 would require that two out : of three agree. : standard : list of standard intervals. If None, any noncalendar interval is accepted as is an interval of one month. Otherwise, this argument should be a list and : a ValueError is generated if the interval isn’t on the list. : 

Returns:  interval : time_interval

Determine whether the input is a calendar dependent time interval. Returns true if the length of the interval does not depend on the calendar, currently implemented by determining whether the interval includes months or years.
Determine whether the argument is a time interval. This is the safe way to determine whether the input is a time interval class understood by Vtools.
Create a time interval representing m minutes
Create a time interval representing m months
Calculate the number of intervals dt between start and end time. The result is the max number_intervals such that
start + number_intervals*dt <= end.
Parse interval expressed as string and return a valid time interval
Parameters:  interval_string : string


Returns:  interval : time_interval

Given a input as ticks or string try to return its datetime equivalent.
Tickbased version of round_time in seconds, for use with vectors ticks : ticks representing seconds interval: interval to round to (noncalendar dependent)
Round a datetime object to an interval dtime : datetime.datetime object, default now. interval: interval to round to (noncalendar dependent) returns rounded time and offset in seconds between input time and rounded time
Create a time interval representing s seconds
Convert a datetime to a long integer. The long integer is a number of units since a time base. The actual value depends on resolution.
Convert a number of ticks to a time interval.
Convert a number of ticks to a datetime
Create a time interval. Create a time interval representing the inputs that is appropriate for VTools. This function is the ‘hard way’ to create a time interval. However, it is useful when the interval is not known in advanced and must be created programatically.
Create ticks sequence based on provided start datetime, and timedelta/relativedelta dt start must be instance of datetime. input:
start: must be a instance of datetime, dt: maybe timedelta or relativedelta. n: number of time points, not number of intervals.
Create a time interval representing y years