Aliasing effects in density
As discussed a minute ago with @lscalfi, we have an issue in our density calculations. If you calculate the planar density you will obtain aliasing effects (unphysical spikes in the density) for certain bin sizes. This effect will reduce if the bin size is reduced but is always there.
The origin of these spikes are unclear -
at least for me. We bin our data with the get_bins
function and
use np.histogram
for the actual calculation of the distribution: Shown
here
and here.
The only thing we could
improve is that we do not bin with our own code but use the range
option of np.histogram
. Resulting in something like
# Put all atoms in the primary unitcell
pos = selection.atoms.positions[dim] % self._universe.dimensions[dim]
density_ts = np.histogram(pos,
bins=self.n_bins,
range=(self.zmin, self.zmax),
weights=weight(selection, self.dens))[0]
self.zmin
and self.zmax
are already declared by the planar_base
decorator.
Edited by Philip Loche