pytimber.LoggingDB.get
- LoggingDB.get(pattern_or_list: Union[str, Iterable[str]], t1: Union[str, datetime, datetime64, timedelta, int, int64, float], t2: Optional[Union[str, datetime, datetime64, timedelta, int, int64, float]] = None, fundamentals: Optional[Union[str, Fundamentals]] = None, unixtime: bool = True, fundamental: Optional[str] = None) Dict[str, Tuple[Tuple[ndarray, ndarray], ndarray]]
Query for a list of variables or for variables whose name matches a pattern (string) in a time window from t1 to t2 and return corresponding variable(s) data.
- Parameters:
pattern_or_list – A pattern or list of names to search for variables.
t1 – The start time of the time window, as a str, datetime, datetime64, timedelta, int, int64.
t2 –
The optional end time of the time window, as a str, datetime, datetime64, timedelta, int, int64 or strategy: last or next.
If t2 is missing, None, “last”, the last data point before t1 is given If t2 is “last”, the last data point before t1 is given. If t2 is “next”, the first data point after t1 is given. If t2 is a timestamp or a datetime object, the data within the time window [t1, t2] is returned. Default value is None.
fundamentals –
A fundamentals object, to filter data points based on the fundamentals
If neither pattern nor Fundamentals objects is provided for the fundamental all the data is returned.
If a fundamentals value is provided, the end of the time window has to be explicitly provided.
fundamental –
pattern used for the fundamental filtering.
This parameter is deprecated, fundamentals should be used instead.
unix_time – Whether to return POSIX timestamps as float values. If True, return POSIX timestamps. If False, return datetime objects. Default value is True.
- Returns:
A dictionary of data points, with variable names as keys and tuple of arrays as values. If unix_time is True, the timestamps are in POSIX format. Otherwise, they are datetime objects. If the query has no result, an empty dictionary is returned.