polypy.read¶
Read functions of polypy. Herein contains classes to read DL_POLY HISTORY / CONFIG files and DL_MONTE ARCHIVE files. All of the data that is extracted from these files is stored in a trajectory class that is compatible with all three file types.
-
class
polypy.read.
Archive
(file, atom_list)[source]¶ Bases:
object
The
polypy.read.Trajectory
class evaluates the positions of all atoms in a ARCHIVE.Parameters: - atom_list (
list
) – List of unique atom names in trajectory. - datatype (
str
) – Datatype of the original dataset e.g. DL_MONTE ARCHIVE.
-
read_archive
()[source]¶ Read a DL_MONTE ARCHIVE file line by line and updates a
polypy.read.Trajectory
object.
- atom_list (
-
class
polypy.read.
Config
(file, atom_list)[source]¶ Bases:
object
The
polypy.read.Trajectory
class evaluates the positions of all atoms in a CONFIG.Parameters: - atom_list (
list
) – List of unique atom names in trajectory. - datatype (
str
) – Datatype of the original dataset e.g. DL_POLY CONFIG.
-
read_config
()[source]¶ Read a DL_POLY HISTORY file line by line and updates a
polypy.read.Trajectory
object.
- atom_list (
-
class
polypy.read.
History
(file, atom_list)[source]¶ Bases:
object
The
polypy.read.Trajectory
class evaluates the positions of all atoms in the simulation.Parameters: - atom_list (
list
) – List of unique atom names in trajectory. - datatype (
str
) – Datatype of the original dataset e.g. DL_POLY HISTORY.
-
read_history
()[source]¶ Reads a DL_POLY HISTORY file line by line and updates a
polypy.read.Trajectory
object.
- atom_list (
-
class
polypy.read.
Trajectory
(atom_list, datatype)[source]¶ Bases:
object
The
polypy.read.Trajectory
class evaluates the positions of all atoms in the simulation.Parameters: - atom_list (
list
) – List of unique atom names in trajectory. - datatype (
str
) – Datatype of the original dataset - DL_POLY HISTORY or CONFIG. (e.g.) –
-
get_atom
(atom)[source]¶ Isolates the trajectory for a specific atom type.
Parameters: atom ( str
) – Atom label.Returns: Trajectory object for desired atom. Return type: atom_trajectory ( polypy.read.Trajectory
)
-
get_config
(timestep)[source]¶ Isolates a specific DL_POLY CONFIG from a HISTORY file.
Parameters: timestep ( int
) – Timestep of desired CONFIG.Returns: Trajectory object for desired CONFIG. Return type: config_trajectory ( polypy.read.Trajectory
)
-
remove_final_timesteps
(timesteps_to_exclude)[source]¶ Removes timesteps from the end of a simulation
Parameters: timesteps_to_exclude ( int
) – Number of timesteps to excludeReturns: Trajectory object. Return type: new_trajectory ( polypy.read.Trajectory
)
-
remove_initial_timesteps
(timesteps_to_exclude)[source]¶ Removes timesteps from the beggining of a simulation
Parameters: timesteps_to_exclude ( int
) – Number of timesteps to excludeReturns: Trajectory object. Return type: new_trajectory ( polypy.read.Trajectory
)
- atom_list (