Skip to main content

PyPI version License Python Version

pyDWS - Expanding the reach of diffusing wave spectroscopy and tracer bead microrheology

Welcome to the repository for pyDWS, a Python package implementing the two-cell Echo diffusing wave spectroscopy (DWS) scheme.

This package provides:

  • A calibration-free method to blend and merge Echo and two-cell DWS data

  • Exponential spectrum fitting to enhance data quality, particularly at very short times

  • Stable corrections for bead and fluid inertia, significantly improving microrheology data quality at high frequencies

pyDWS is based on:

M. Helfer, C. Zhang, and F. Scheffold, "Expanding the reach of diffusing wave spectroscopy and tracer bead microrheology," arXiv:2502.14973 (2025), https://doi.org/10.1103/k34t-ghws.

Introduction

Diffusing Wave Spectroscopy (DWS) is an extension of standard dynamic light scattering (DLS), applied to soft materials that are turbid or opaque. The propagation of light is modeled using light diffusion, characterized by a light diffusion coefficient that depends on the transport mean free path l* of the medium. DWS is highly sensitive to small particle displacements or other local fluctuations in the scattering properties and can probe subnanometer displacements. Analyzing the motion of beads in a viscoelastic matrix, known as one-bead microrheology, is one of the most common applications of DWS. Despite significant advancements since its invention in 1987, including two-cell and multi-speckle DWS, challenges such as merging single and multi-speckle data and limited accuracy for short correlation times persist.

With this package, we address these key challenges in the implementation of the two-cell Echo DWS measurement scheme and propose two major improvements.

First, we introduce a calibration-free method to blend and merge Echo and two-cell DWS measurements. Second, we show that an unbiased fit of the intensity correlation function (ICF) at short times significantly improves data quality in this regime.

Building on this approach, we also demonstrate that a stable correction for bead and fluid inertia can be applied, further enhancing the reliability of microrheology data at short times.

Requirements

This package is compatible with Python ≥ 3.10 and depends on the following libraries:

  • matplotlib >= 3.4.3
  • numpy >= 1.21.0
  • pandas >= 1.3.0
  • scikit-learn >= 1.0.0
  • scipy >= 1.7.0
  • statsmodels >= 0.14.5

Installation

You can install pyDWS directly from PyPI using pip:

pip install pyDWS

Examples

We provide example workflows for wormlike micellar and microgel samples via Jupyter notebooks in the examples folder, illustrating how this package can be used.

The example datasets are available in the data folder. All measurements were performed using the following setup:
DWS Setup

From the intensity fluctuations, the correlator outputs the intensity correlation function (ICF), g₂(t) - 1.
The two-cell measurements were performed at a frequency of 13 mHz, and the echo measurements at 25 Hz, both with an amplitude of 3 Vᵣₘₛ. The actual frequency during the Echo measurement is 24.9997 Hz, which is slightly lower than the set frequency because of the inertia of the oscillator.

  • Wormlike micellar sample:

    Parameters Values
    Sample An aqueous solution of cetylpyridinium chloride and sodium salicylate (100 mM CPyCl–60 mM NaSal). The sample is mixed with polystyrene beads to a final concentration slightly below 1% by volume.
    l* 330 μm
    n_water 1.33
    λ 633 nm
    L (Cuvette thickness) 2 mm
    a (bead radius) 210 nm
    ρ_b (bead density) 1050 kg/m³ (polystyrene bead mass density)
    ρ (medium density) 1000 kg/m³ (water)
    T 20 °C
  • Microgel sample:

    Parameters Values
    Sample pNIPAM microgel in MilliQ water with 1.5 mol% crosslinker BIS
    φ ~18 wt%
    l* 157 μm
    n_water 1.33
    λ 633 nm
    L (Cuvette thickness) 5 mm
    a (bead radius) 293 nm (size of the microgel itself)
    T 28 °C

Reference

If you use pyDWS in your research, please cite:

M. Helfer, C. Zhang, and F. Scheffold,
"Expanding the reach of diffusing wave spectroscopy and tracer bead microrheology,"
Phys. Rev. Research 7, 043274 (2025).
https://doi.org/10.1103/k34t-ghws

Metadata

Release files for pyDWS 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyDWS 1.1.2
File Size Uploaded Provenance Actions
pydws-1.1.2.tar.gz 22.6 kB Without provenance Details for pydws-1.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyDWS 1.1.2
File Interpreter ABI Platform Actions
pydws-1.1.2-py3-none-any.whl Python 3 none any Details for pydws-1.1.2-py3-none-any.whl

Total release size: 46.0 kB

Release files / pydws-1.1.2.tar.gz

Download URL pydws-1.1.2.tar.gz
Size 22.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a2843efcc32a7ea862517341275d43bab80c45e16d9633fe78084b56243447e7
BLAKE2b-256 checksum
How to use checksums
8be151d54c0b90ea34540d5a6cf384e0f3e22160d1715561b6e03740b6bb38e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / pydws-1.1.2-py3-none-any.whl

Download URL pydws-1.1.2-py3-none-any.whl
Size 23.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a0c108b2d1b3570f9b07c1a65381a89839869a7fdd10b5d94322d7d5203d903
BLAKE2b-256 checksum
How to use checksums
110ec9c1cc9ac8a7d9b6d00b01262e7c503b3540cac6d6e73f2f10ef16de10e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for pyDWS 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page