Hi all, I have a little bit of trouble understanding how the "images" section works for Freud MSD, especially if I use Hoomd to get that image.
For example, when I normally do MSD code by hand, I check to see if a particle coordinate has changed by a distance of more than L/2 between two consecutive trajectory dump readouts, if it has I will instead subtract out a distance of L to make the coordinates "unwrapped"
When using Freud and the box.get_Images, is that what it is doing? Or is there some hidden way Hoomd keeps track of when a particle crosses a boundary behind the hood.
A lot of this stems from the fact that I would like to take fewer trajectory readouts (say every 1e5 timesteps instead of every 1e3), but if I do that I run into the unlikely scenario that a particle has actually traversed more than L/2 distance without going around the boundary and I just missed it.
##### MSD Code I found for Freud, where snapshots are Hoomd Snapshots read by gsd ####
box1 = t0snapshot.configuration.box
positions = np.zeros((NumSnaps, NumParticles ,3))
msdclassxyz = freud.msd.MSD(box1,'window')
boxF = msdclass.box
t0_tstep = t0snapshot.configuration.step
time_list = np.zeros(NumSnaps)
for snapind in range(NumSnaps):
currentsnap = snapshot_list[snapind]
current_tstep = currentsnap.configuration.step
time_list[snapind] = (current_tstep - t0_tstep)*(1e-3)
curr_raj = currentsnap.particles.position
positions[snapind, : , : ] = curr_traj
### Get MSD
last_frame = positions[0]
cumulative_img = 0
wrapped_pos = [ ]
images = [ ]
for frame in positions:
delta = frame - last_frame
images.append(cumulative_img - boxF.get_images(delta))
wrapped_pos.append(frame)
last_frame = frame
cumulative_img = images[-1]
msdclassxyz.compute(wrapped_pos,images)