shnitsel.core¶
Submodules¶
Functions¶
|
Opens a NetCDF4 file saved by shnitsel-tools, specially interpreting certain attributes. |
|
Save a |
|
Calculate all dihedral angles between the atoms specified. |
|
|
|
|
|
|
|
Package Contents¶
- open_frames(path)¶
Opens a NetCDF4 file saved by shnitsel-tools, specially interpreting certain attributes.
- Parameters:
path – The path of the file to open.
- Return type:
An
xarray.Dataset
with any MultiIndex restored.- Raises:
FileNotFoundError – If there is is nothing at
path
, orpath
is not a file.ValueError (or other exception) – Raised by the underlying h5netcdf engine if the file is corrupted.
- save_frames(frames, path, complevel=9)¶
Save a
Dataset
, presumably (but not necessarily) consisting of frames of trajectories, to a file atpath
.- Parameters:
accessor) (frames (omit if using) – The
Dataset
to savepath – The path at which to save it
complevel – The level of
gzip
compression which will be applied to all variables in theDataset
, by default 9optional – The level of
gzip
compression which will be applied to all variables in theDataset
, by default 9
Notes
This function/accessor method wraps
xarray.Dataset.to_netcdf()
but notnumpy.any()
.
- dihedral(atXYZ, i, j, k, l, *, deg=False, full=False)¶
Calculate all dihedral angles between the atoms specified. The atoms specified needed be bonded.
- Parameters:
atXYZ (AtXYZ) – A
DataArray
of coordinates, withatom
anddirection
dimensionsi (int) – The four atom indices
j (int) – The four atom indices
k (int) – The four atom indices
l (int) – The four atom indices
deg (bool) – Whether to return angles in degrees (True) or radians (False), by default False
full (bool) – Whether to return signed angles between -180° and 180° (True) or unsigned angles between 0 and 180° (False), by default False
- Return type:
A
DataArray
containing dihedral angles
- get_per_state(frames)¶
- Parameters:
frames (Frames)
- Return type:
PerState
- get_inter_state(frames)¶
- Parameters:
frames (Frames)
- Return type:
InterState
- assign_fosc(ds)¶
- Parameters:
ds (xarray.Dataset)
- Return type:
- spectra_all_times(inter_state)¶
- Parameters:
inter_state (xarray.Dataset)