Add functionality to Trajectory
It would be useful to have some additional functionality in the Trajectory
class.
Reset
It would be useful, e.g., handy if one could reset the Trajectory
iterator.
For example, as a user I would like to calculate the correlation functions for different segments of a path through the Brillouin zone and store them into separate Sample
objects.
To this end, I loop over the paths segments followed by calls to compute_dynamic_structure_factors
.
I can of course circumvent this by regenerating the Trajectory
object but it is somewhat inelegant.
I would prefer being able to do something like:
segments = []
for coordinates, labels in path:
q_points, q_labels = get_supercell_qpoints_along_path(coordinates, labels, prim, supercell)
# ** current **
#traj = Trajectory(
# trajectory_filename, trajectory_format='lammps_internal', frame_stop=20000)
# ** preferred **
traj.reset()
sample = compute_dynamic_structure_factors(
traj, q_points, dt=25.0, window_size=500, window_step=50, calculate_currents=True)
segments.append((sample, q_labels))
Current frame and total number of frames
Another useful feature would be if one could retrieve the index of the current frame as well as the total number of frames.
Edited by Paul Erhart