Skip to main content

A Python library to parse MD trajectories from LAMMPS and ASE and measure the contact angle through different methods

Project description

wetting-angle-kit

tests docs code coverage pypi version Python versions License: BSD 3-Clause Documentation

wetting-angle-kit provides modular tools to parse MD trajectories (LAMMPS dump, XYZ, ASE) and compute droplet contact angles using two complementary approaches:

  1. Slicing Method (per-frame circle fit) – robust against transient shape changes.
  2. Binning Density Method – averages frames into a density field for a single representative angle.

The documentation is available here, you can find examples and tutorials.

Installation

Prerequisites

Before installing wetting-angle-kit, ensure you have the following prerequisites:

  1. Python 3.10 or higher: Make sure you have Python 3.10 or higher installed on your system.
  2. Conda: Ensure you have Conda installed. If not, you can install it from here.

Core (only to analyse simple xyz trajectories):

pip install wetting-angle-kit

With OVITO:

pip install wetting-angle-kit[ovito]

With ASE:

pip install wetting-angle-kit[ase]

All optional:

pip install wetting-angle-kit[all]

Install OVITO

OVITO must be installed first in the conda environment and using the following Conda command:

conda install --strict-channel-priority -c https://conda.ovito.org -c conda-forge ovito=3.11.3

Quick Start

from wetting_angle_kit.analysis import (
    BinningTrajectoryAnalyzer,
    SlicingTrajectoryAnalyzer,
)
from wetting_angle_kit.parsers import XYZParser, XYZWaterFinder

trajectory_file = "trajectory.xyz"

# Identify water oxygen atoms by neighbor count. ``particle_type_wall``
# lists the symbols of the substrate atoms so they are excluded.
finder = XYZWaterFinder(trajectory_file, particle_type_wall=["C"])
oxygen_ids = finder.get_water_oxygen_indices(frame_index=0)

parser = XYZParser(trajectory_file)

slicing = SlicingTrajectoryAnalyzer(
    parser,
    atom_indices=oxygen_ids,
    droplet_geometry="spherical",
    delta_gamma=5,
)
results = slicing.analyze(frame_range=range(0, 50))
print(results.mean_angle, results.std_angle)

binning = BinningTrajectoryAnalyzer(
    parser,
    atom_indices=oxygen_ids,
    droplet_geometry="spherical",
)
results_binning = binning.analyze(frame_range=range(0, 200))
print(results_binning.mean_angle, results_binning.std_angle)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wetting_angle_kit-1.0.3.tar.gz (51.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wetting_angle_kit-1.0.3-py3-none-any.whl (55.6 kB view details)

Uploaded Python 3

File details

Details for the file wetting_angle_kit-1.0.3.tar.gz.

File metadata

  • Download URL: wetting_angle_kit-1.0.3.tar.gz
  • Upload date:
  • Size: 51.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wetting_angle_kit-1.0.3.tar.gz
Algorithm Hash digest
SHA256 364ffc75bb2a65b3227cfcd90c27e98f8b883a1d2f4ae9a7db0cea40383b2556
MD5 69ea8be138a168a54347ca7273182dd8
BLAKE2b-256 848ac35f765a75cf7a7ce21fdc4252aff14a8ef1cc31d0fe81eaaa9fac14afbf

See more details on using hashes here.

File details

Details for the file wetting_angle_kit-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for wetting_angle_kit-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 becb6dc74a8f7075da58717994136365a2a0d588f6f0698febd18ff158e7fd0b
MD5 04ac4ec9719613bc13de65864ef12a2d
BLAKE2b-256 38804414b6fa5738efd4907fdc9c0c78648e26be722959cea80e9fc0810a897c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page