Getting started#
Prerequisites#
You need Python version 3.8 or later. Versions up to and including 3.11 are tested, version 3.12 is not tested on deployment with Github Actions but successfully tested locally.
You can install Python from https://www.python.org or https://www.anaconda.com.
Installation#
QATS is installed from PyPI by using pip:
$ python -m pip install qats
Now you should be able to import the package in the Python console
>>> import qats
>>> help(qats)
Help on package qats:
NAME
qats - Library for efficient processing and visualization of time series.
PACKAGE CONTENTS
app (package)
cli
fatigue
gumbel
gumbelmin
rainflow
readers (package)
signal
stats
ts
tsdb
weibull
...
...
>>>
and run the command line interface (CLI).
$ qats -h
usage: qats [-h] [--version] {app,config} ...
QATS is a library and desktop application for time series analysis
optional arguments:
-h, --help show this help message and exit
--version Package version
Commands:
{app,config}
app Launch the desktop application
config Configure the package
Note
As of version 5.0.0, qats installs the Qt binding PySide6.
Although not recommended, you can choose a different qt binding yourself by installing the package and setting the
environmental variable QT_API
. Accepted values include pyqt6
(to use PyQt6) and pyside6
(PySide6). For more details,
see README file for qtpy.
Note
As of version 4.11.0, the CLI is also available through the python -m
switch, for example:
$ python -m qats -h
$ python -m qats app
Launching the GUI#
The GUI is launched via the CLI:
$ qats app
If using qats on Windows, you may add a shortcut for launching the qats GUI to your Windows Start menu and on the Desktop by running the command:
C:\> qats config --link-app
Your first script#
Import the time series database, load data to it from file and plot it all.
1"""
2Example of using the time series database class
3"""
4import os
5
6from qats import TsDB
7
8db = TsDB()
9
10# locate time series file
11file_name = os.path.join("..", "..", "..", "data", "mooring.ts")
12
13# load time series from file
14db.load([file_name])
15
16# plot everything on the file
17db.plot()
Take a look at Code examples and the API Reference to learn how to use qats
and build it into your code.