OO bond analysis from VASP XDATCAR trajectory Author: Yuansheng Shi Date: [2025-09-16]
This script analyzes O–O distances from an AIMD trajectory (XDATCAR). Outputs:
- OO_pair_records.csv — per-frame O–O distances
- OO_distance_histogram.csv — histogram data (distance vs probability)
- OO_min_distance_vs_frame.csv — min O–O distance per frame
- OO_pdf.csv — pair distribution function g(r)
- Figures: histogram, time series, PDF
Usage:
- Place
XDATCAR(from VASP AIMD run) in the same folder. - Run: python oo_analysis.py
- Outputs will be written in the same directory.
Dependencies:
- Python >= 3.8
- numpy, pandas, matplotlib, pymatgen, scipy
Notes:
- BOND_THRESH is set to 1.45 Å (approximate O–O bonding cutoff).
- DIST_BINS and PDF_BIN_WIDTH can be adjusted.
- The script assumes XDATCAR includes oxygen atoms.
Citation: Please cite our work if you use this script in your research project or publication: