shnitsel-tools documentation

Getting started

First install,

pip install shnitsel-tools

then import.

import shnitsel as st
import shnitsel.xarray # Activate accessors

Reading data from…

…trajectories:

# One of the following:
ds = st.read_trajs('path/to/Singlet_1/', kind='sharc')
ds = st.read_trajs('path/to/Newton-X/', kind='nx')
ds = st.read_trajs('path/to/PyRAI2MD/', kind='pyrai2md')

# And then:
ds = ds.sh.setup_frames()

…ASE databases:

# One of the following:
ds = st.read_ase('path/to/ase.db', kind='spainn')
ds = st.read_ase('path/to/ase.db', kind='schnet')
ds = st.read_ase('path/to/geometries_only.db', kind=None)

…SHNITSEL-style NetCDF4:

ds = st.open_frames('path/to/dataset.nc')

Saving data to…

…NetCDF4:

ds.sh.save_frames('path/to/dataset.nc')

…ASE:

ds = st.write_ase('path/to/ase.db', kind='spainn')
# see above for other kinds

Select…

…a variable:

ds['energy'] # ...or:
ds.energy

…a trajectory:

ds.sel(trajid=1)

…a point in time:

ds.sel(time=1)

Derive…

…bond lengths: TODO

Reference