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:
db = st.read('path/to/Singlet_1/', kind='sharc')
db = st.read('path/to/Newton-X/', kind='nx')
db = st.read('path/to/PyRAI2MD/', kind='pyrai2md')
db = st.read('path/to/ase.db')

…SHNITSEL-style NetCDF4:

db = st.read('path/to/dataset.nc')

Converting to other data-layouts…#

ds = db.as_stacked  # All trajectories along the same axis
# or:
ds = db.as_layered  # Separate axes for trajectory and time

Saving data to…#

…NetCDF4:

ds.st.write_shnitsel_file('path/to/dataset.nc')

Select…#

…a variable:

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

…a trajectory:

ds.sel(trajectory=1)

…a point in time:

ds.sel(time=1)

Reference#