4.8.2. Linear Density — MDAnalysis.analysis.lineardensity¶
A tool to compute mass and charge density profiles along the three cartesian axes of the simulation cell. Works only for orthorombic, fixed volume cells (thus for simulations in canonical NVT ensemble).
-
class
MDAnalysis.analysis.lineardensity.LinearDensity(select, grouping='atoms', binsize=0.25, **kwargs)[source]¶ Linear density profile
- Parameters
select (AtomGroup) – any atomgroup
grouping (str {'atoms', 'residues', 'segments', 'fragments'}) – Density profiles will be computed on the center of geometry of a selected group of atoms
binsize (float) – Bin width in Angstrom used to build linear density histograms. Defines the resolution of the resulting density profile (smaller –> higher resolution)
verbose (bool (optional)) – Show detailed progress of the calculation if set to
True; the default isFalse.
-
results¶ Keys ‘x’, ‘y’, and ‘z’ for the three directions. Under these keys, find ‘pos’, ‘pos_std’ (mass-weighted density and standard deviation), ‘char’, ‘char_std’ (charge density and its standard deviation), ‘slice_volume’ (volume of bin).
- Type
Example
First create a LinearDensity object by supplying a selection, then use the
run()method:ldens = LinearDensity(selection) ldens.run()
New in version 0.14.0.
Changed in version 1.0.0: Support for the
start,stop, andstepkeywords has been removed. These should instead be passed toLinearDensity.run(). Thesave()method was also removed, you can usenp.savetxt()ornp.save()on theLinearDensity.resultsdictionary contents instead.Changed in version 1.0.0: Changed selection keyword to select
- Parameters
trajectory (mda.Reader) – A trajectory Reader
verbose (bool, optional) – Turn on more logging and debugging, default
False
Changed in version 1.0.0: Support for setting
start,stop, andstephas been removed. These should now be directly passed toAnalysisBase.run().