A software package for the analysis of dynamic measurements
PyDynamic – Python package for the analysis of dynamic measurements
The goal of this package is to provide a starting point for users in metrology and related areas who deal with time-dependent i.e., dynamic, measurements. The initial version of this software was developed as part of a joint research project of the national metrology institutes from Germany and the UK, i.e. Physikalisch-Technische Bundesanstalt and the National Physical Laboratory.
PyDynamic offers propagation of uncertainties for
- application of the discrete Fourier transform and its inverse
- filtering with an FIR or IIR filter with uncertain coefficients
- design of a FIR filter as the inverse of a frequency response with uncertain coefficients
- design on an IIR filter as the inverse of a frequency response with uncertain coefficients
- deconvolution in the frequency domain by division
- multiplication in the frequency domain
- transformation from amplitude and phase to a representation by real and imaginary parts
- 1-dimensional interpolation
For the validation of the propagation of uncertainties, the Monte-Carlo method can be applied using a memory-efficient implementation of Monte-Carlo for digital filtering.
The documentation for PyDynamic can be found on ReadTheDocs
The fundamental structure of PyDynamic is shown in the following figure.
However, imports should generally be possible without explicitly naming all packages and modules in the path, so that for example the following import statements are all equivalent.
from PyDynamic.uncertainty.interpolate import make_equidistant from PyDynamic.uncertainty import make_equidistant from PyDynamic import make_equidistant
Quick setup (not recommended)
If you just want to use the software as quick as possible, run from your system's command line
pip install --user PyDynamic
This will download the latest version from the Python package repository and copy it into your local folder of third-party libraries. Note that PyDynamic runs with Python versions 3.6 to 3.9. Usage in any Python environment on your computer is then possible by
or, for example, for the module containing the Fourier domain uncertainty methods:
from PyDynamic.uncertainty import propagate_DFT
Updating to the newest version
Updates can then be installed via
pip install --user --upgrade PyDynamic
Proper Python setup with virtual environment (recommended)
The setup described above allows the quick and easy use of PyDynamic, but it also has its downsides. When working with Python, we should rather always work in so-called virtual environments. These allow to satisfy project specific dependencies without polluting or breaking other projects' dependencies.
Create a virtual environment and install requirements
Creating a virtual environment with Python built-in tools is easy and explained in more detail in the official docs of Python itself.
It boils down to creating an environment anywhere on your computer, then activate it and finally install PyDynamic and its dependencies.
venv creation and installation in Windows
In your Windows command prompt execute the following:
> py -3 -m venv LOCAL\PATH\TO\ENVS\PyDynamic_venv > LOCAL\PATH\TO\ENVS\PyDynamic_venv\Scripts\activate.bat (PyDynamic_venv) > pip install PyDynamic
venv creation and installation on Mac and Linux
In your terminal execute the following:
$ python3 -m venv /LOCAL/PATH/TO/ENVS/PyDynamic_venv $ /LOCAL/PATH/TO/ENVS/PyDynamic_venv/bin/activate (PyDynamic_venv) $ pip install PyDynamic
Updating to the newest version
Updates can then be installed on all platforms after activating the virtual environment via:
(PyDynamic_venv) $ pip install --upgrade PyDynamic
Optional Jupyter Notebook dependencies
If you are familiar with Jupyter Notebooks, you find some examples in the examples
subfolder of the source code repository. To execute these you need additional
dependencies which you get by appending
[examples] to PyDynamic in all
the above, e.g.
(PyDynamic_venv) $ pip install PyDynamic[examples]
Install known to work dependencies' versions
In case errors arise within PyDynamic, the first thing you can try is installing the
known to work configuration of dependencies against which we run our test suite. This
you can easily achieve with our version specific requirements files. First you need
to install our dependency management package pip-tools, then find the Python
version you are using with PyDynamic. Finally, you install the provided dependency
versions for your specific Python version. This is all done with the following
sequence of commands after activating. Change the suffix
-py38 according to the
Python version you find after executing
(PyDynamic_venv) $ python --version:
(PyDynamic_venv) $ pip install --upgrade pip-tools Collecting pip-tools [...] Successfully installed pip-tools-5.2.1 (PyDynamic_venv) $ python --version Python 3.8.8 (PyDynamic_venv) $ pip-sync requirements/dev-requirements-py38.txt requirements/requirements-py38.txt Collecting [...] [...] Successfully installed [...] (PyDynamic_venv) $
Contributing to PyDynamic
If you want to contribute code to the project you find additional set up and related information in our Contribution advices and tips.
If you have a feature request please take a look at the roadmap, and the links provided there to find out more about planned and ongoing developments. If you have the feeling, something is missing, let us know by opening an issue.
If you have downloaded this software, we would be very thankful for letting us know. You may, for instance, drop an email to one of the authors (e.g. Sascha Eichstädt, Björn Ludwig or Maximilian Gruber )
We have collected extended material for an easier introduction to PyDynamic in the package examples. Detailed assistance on getting started you can find in the corresponding sections of the docs:
In various Jupyter Notebooks and scripts we demonstrate the use of the provided methods to aid the first steps in PyDynamic. New features are introduced with an example from the beginning if feasible. We are currently moving this supporting collection to an external repository on GitHub. They will be available at github.com/PTB-M4D/PyDynamic_tutorials in the near future.
- Implementation of robust measurement (sensor) models
- Extension to more complex noise and uncertainty models
- Introducing uncertainty propagation for Kalman filters
If you publish results obtained with the help of PyDynamic, please use the above linked Zenodo DOI for the code itself or cite
Sascha Eichstädt, Clemens Elster, Ian M. Smith, and Trevor J. Esward Evaluation of dynamic measurement uncertainty – an open-source software package to bridge theory and practice J. Sens. Sens. Syst., 6, 97-105, 2017, DOI: 10.5194/jsss-6-97-2017
Part of this work is developed as part of the Joint Research Project 17IND12 Met4FoF of the European Metrology Programme for Innovation and Research (EMPIR).
This work was part of the Joint Support for Impact project 14SIP08 of the European Metrology Programme for Innovation and Research (EMPIR). The EMPIR is jointly funded by the EMPIR participating countries within EURAMET and the European Union.
This software is developed at Physikalisch-Technische Bundesanstalt (PTB). The software is made available "as is" free of cost. PTB assumes no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, safety, suitability or any other characteristic. In no event will PTB be liable for any direct, indirect or consequential damage arising in connection with the use of this software.
PyDynamic is distributed under the LGPLv3 license except for the module
impinvar. py in the package
misc, which is distributed under the GPLv3 license.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size PyDynamic-1.11.0-py3-none-any.whl (677.4 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size PyDynamic-1.11.0.tar.gz (2.2 MB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for PyDynamic-1.11.0-py3-none-any.whl