sportran.i_o.read_lammps_dump.LAMMPS_Dump¶
- class sportran.i_o.read_lammps_dump.LAMMPS_Dump(*args, **kwargs)¶
Bases:
object
A LAMMPS_Dump file that can be read in blocks. example:
traj = LAMMPS_Dump(filename, preload=False) –>> do not preload list of steps (suggested if the file is big) traj.read_timesteps(10, start_step=0, select_ckeys=[‘id,xu,yu,vu’]) –>> Read first 10 timesteps, only the specified columns traj.read_timesteps(10, select_ckeys=[‘id,xu,yu,vu’]) –>> Read the next 10 timesteps, only the specified columns (DELTA_TIMESTEP is assumed) traj.read_timesteps((10,30)) –>> Read from TIMESTEP 10 to 30 traj.read_timesteps((10,30,2)) –>> Read every 2 steps from TIMESTEP 10 to 30 print(traj.data)
- __init__(*args, **kwargs)¶
Methods
__init__
(*args, **kwargs)gototimestep
(start_step[, fast_check])Go to the start_step-th line in the time series (assumes step=1).
read_timesteps
(selection[, start_step, ...])Read selected keys of file, within the provided range. Examples: read_timesteps(10, start_step=0, select_ckeys=['id,xu,yu,vu']) -->> Read first 10 timesteps, only the specified columns read_timesteps(10, select_ckeys=['id,xu,yu,vu']) -->> Read the next 10 timesteps, only the specified columns (DELTA_TIMESTEP is assumed) read_timesteps((10,30)) -->> Read from TIMESTEP 10 to 30 read_timesteps((10,30,2)) -->> Read every 2 steps from TIMESTEP 10 to 30.
- gototimestep(start_step, fast_check=True)¶
- Go to the start_step-th line in the time series (assumes step=1).
- start_step = -1 –> ignore, continue from current step
0 –> go to FIRST timestep N –> go to N-th timestep
- fast_check = True –> assumes the TIMESTEP are a monotonously increasing.
If the the start_step is passed and not found then stop.
- read_timesteps(selection, start_step=- 1, select_ckeys=None, fast_check=True)¶
Read selected keys of file, within the provided range. Examples:
read_timesteps(10, start_step=0, select_ckeys=[‘id,xu,yu,vu’]) –>> Read first 10 timesteps, only the specified columns read_timesteps(10, select_ckeys=[‘id,xu,yu,vu’]) –>> Read the next 10 timesteps, only the specified columns (DELTA_TIMESTEP is assumed) read_timesteps((10,30)) –>> Read from TIMESTEP 10 to 30 read_timesteps((10,30,2)) –>> Read every 2 steps from TIMESTEP 10 to 30