Skip to main content

tools for md or dft

Project description

MD 轨迹分析脚本

mdtool 提供了多种工具

密度分布

氢键

单个水分子

氢键分布

角度

与表面法向量夹角分布

ion - O - ion 夹角分布

$\cos \phi \rho_{H_2 O}$ 分布

RDF

位置归一化

wrap用于将轨迹文件中的原子位置进行归一化处理, 如将[FILENAME]中的原子位置归一化到晶胞中, 并输出为wrapped.xyz, 默认从cp2k的输出文件input_inp中读取ABCALPHA_BETA_GAMMA信息作为晶胞参数:

mdtool wrap [FILENAME] 

或指定cp2k的输入文件:

mdtool wrap [FILENAME] --cp2k_input_file setting.inp

或指定晶胞参数:

mdtool wrap [FILENAME] --cell 10,10,10

默认的[FILENAME]*-pos-1.xyz

DFT 性质分析脚本

PDOS

静电势

电荷差分

其他

轨迹提取

extract用于提取轨迹文件中的特定的帧, 如从frames.xyz中提取第 1000 帧到第 2000 帧的轨迹文件, 并输出为1000-2000.xyz, -r选项的参数与Python的切片语法一致:

mdtool extract frames.xyz -r 1000:2000 -o 1000-2000.xyz

或从cp2k的默认输出的轨迹文件*-pos-1.xyz文件中提取最后一帧输出为extracted.xyz(extract的默认行为):

mdtool extract

或每50帧输出一个结构到./coord目录中, 同时调整输出格式为cp2k@INCLUDE coord.xyz的形式:

mdtool extract -cr ::50

结构文件转换

convert用于将结构文件从一种格式转换为另一种格式, 如将structure.xyz转换为out.cif(默认文件名为out), 对于不储存周期性边界条件的文件, 可以使用--cell选项指定PBC:

mdtool convert -c structure.xyz --cell 10,10,10

structure.cif转换为POSCAR:

mdtool convert -v structure.cif

structure.cif转换为structure_xyz.xyz:

mdtool convert -c structure.cif -o structure_xyz

数据处理

data用于对数据进行处理如:

  1. --nor: 对数据进行归一化处理
  2. --gaus: 对数据进行高斯过滤
  3. --fold: 堆数据进行折叠平均
  4. --err: 计算数据的误差棒 等

绘图工具

plot用于绘制数据图, plot需要读取yaml格式的配置文件进行绘图, yaml文件的形式如下:

# plot mode 1
figure1:
  data:
    legend1: ./data1.dat
    legend2: ./data2.dat
  x:
    0: x-axis
  y:
    1: y-axis
  x_range: 
    - 5
    - 15

# plot mode 2
figure2:
  data:
    y-xais: ./data.dat
  x:
    0: x-axis
  y:
    1: legend1
    2: legend2
    3: legend3
    4: legend4
    5: legend5
  y_range:
    - 0.5
    - 6
  legend_fontsize: 12

# plot mode error
12_dp_e_error:
  data:
    legend: ./error.dat
  x:
    0: x-axis
  y:
    1: y-axis
  fold: dp
  legend_fontsize: 12

如上plot支持三种绘图模式, mode 1, mode 2mode error. mode 1用于绘制多组数据文件的同一列数据对比, mode 2用于绘制同一数据文件的不同列数据对比, mode error用于绘制均方根误差图.

plot可以同时处理多个yaml文件, 每个yaml文件可以包含多个绘图配置, mode 1mode 2的绘图配置可以自动识别, 但是error模式需要而外指定, 如:

mdtool plot *.yaml

和:

mdtool plot *.yaml --error

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

mdtool-0.1.6.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

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

mdtool-0.1.6-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file mdtool-0.1.6.tar.gz.

File metadata

  • Download URL: mdtool-0.1.6.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.11.9 Windows/10

File hashes

Hashes for mdtool-0.1.6.tar.gz
Algorithm Hash digest
SHA256 2196fcc890e767202d60855fc08624454cce26d248e8737e9b7a7fb3d873f1ef
MD5 84ebd4614dc6c3849a48e4c1ec2b09d1
BLAKE2b-256 9cf4fec45687e6e2b09739d4c29b86e3da2f769df04208347773af9c2b6a9b64

See more details on using hashes here.

File details

Details for the file mdtool-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: mdtool-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.11.9 Windows/10

File hashes

Hashes for mdtool-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1b8fddd0e0992cbaca6216795876fcad98609e1a99f1a4ecc392ddb037d8b5b6
MD5 f0d37202ab3318fb0729052a4a7a2097
BLAKE2b-256 efb82b7f01951578f77456712917a66be7c4603966cdeb75f917205db9383462

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