dailyAlignedBar#

swordfish.function.dailyAlignedBar()#

Determine windows based on the starting time (specified by timeOffset), window length (specified by n), and possibly ending time (specified by timeEnd). For each element of X, return the starting time of the window it belongs to. Specifically, return X-((X-timeOffset)%n) for each element of X and return a vector with the same length as X.

Parameters:
  • X (Constant) – A temporal vector of type SECOND, TIME, NANOTIME, DATETIME, TIMESTAMP or NANOTIMESTAMP.

  • timeOffset (Constant) – A scalar/vector of type SECOND, TIME or NANOTIME with the same accuracy of X indicating the left boundary of session(s). If it is a vector, it must be increasing.

  • n (Constant) – A positive integer or DURATION type data indicating the window length. If n is a positive integer, its unit is the minimum accuracy of timeOffset. If n is a DURATION type data, its unit cannot be y, M, w, d, B.

  • timeEnd (Constant, optional) – Is of the same type and length of timeOffset indicating the right boundary of session(s).

  • mergeSessionEnd (Constant, optional) – A Boolean value. When the right boundary of a session (as specified in timeEnd) is also the right boundary of a window, if mergeSessionEnd=true, the right boundary of the session is merged into the previous window.