This function samples the mean square displacement of a molecule group in a pore in both axial and radial direction separated in radial bins.
First a centre of mass-list is filled with \(w\cdot s\) frames with window length \(w\) and stepsize \(s\). Each following frame removes the first com of the list and a new added to the end of it. This way only one loop over the frames is needed, since each frame is only needed for \(w\cdot s\) frames in total.
All molecule com’s are sampled each window if they are inside the bounds of the pore minus an entry length on both sides. Once the com leaves the boundary, it is no longer sampled for this specific window. Additionally, the radial bin index is checked for each frame. If the molecule com stays in the pore for the whole window length and in the same starting bin plus an allowed offset, the msd is added to it is added to a the corresponding window starting radial bin. The sub volumes, or rather bins, of the radial distance are calculated by
with \(r\) of bin \(i\) and pore length \(z_\text{pore}\).
Once the first com-list is filled, the mean square displacement (msd) is sampled each frame. The axial diffusion only considers the deviation in \(z\) direction
with time \(t\) and normalization \(M\) at bin \(i\). The radial diffusion only considers the radial components \(x\) and \(y\)
Data dictionary containing bins for axial and radial diffusion
Indicator wether molecule is inside or outside pore
Distance of center of mass to pore surface area
List of dictionaries containing coms of all molecules for each frame
List of dictionaries containing bin id of all molecules for each frame
Current residue id
Center of mass of current molecule