mdse.md.visualize
Visualization tools for post-processing molecular dynamics simulation results.
This module provides the VisualizeResult class, which is designed to take a list of ResultMD objects and generate various comparative plots. It allows for the visualization of properties like Mean Squared Displacement (MSD), Density of States (DOS), and energy evolution across multiple simulations. It also supports creating scatter plots and histograms to analyze relationships between different calculated properties.
Classes
|
A class for visualizing and comparing results from multiple simulations. |
- class mdse.md.visualize.VisualizeResult(data)
Bases:
objectA class for visualizing and comparing results from multiple simulations.
This class takes a list of ResultMD objects and provides methods to generate various plots, such as MSD, DOS, energy profiles, scatter plots, and histograms, allowing for easy comparison across different simulation runs.
- plot_DOS()
Plot the Density of States (DOS) for all stored simulations.
This method calculates and plots the DOS vs. angular frequency for each ResultMD object on a single graph, labeling each curve with the simulation’s name.
- plot_MSD()
Plot the Mean Squared Displacement (MSD) for all stored simulations.
This method iterates through each ResultMD object, calculates the MSD for the x, y, and z directions, and plots them on a single graph. Each simulation is distinguished by color.
- plot_energy(energy_type='kin')
Plot the evolution of energy over time for all stored simulations.
- Parameters:
energy_type (str, optional) –
The type of energy to plot. Valid options are:
”kin”: Kinetic energy (default)
”pot”: Potential energy
”tot”: Total energy
- plot_histogram(prop1, bins=100)
Plot a histogram for a single property across all simulations.
- Parameters:
prop1 (str) – The name of the property to be plotted.
bins (int, optional) – The number of bins to use in the histogram. Defaults to 100.
- plot_scatter(prop1, prop2, prop3, size=30)
Create a 3D scatter plot from three calculated properties.
This method generates a scatter plot where the x and y axes represent two properties, and a third property is represented by the color of the data points.
- Parameters:
prop1 (str) – The name of the property for the x-axis.
prop2 (str) – The name of the property for the y-axis.
prop3 (str) – The name of the property for the color scale.
size (int, optional) – The size of the markers in the scatter plot. Defaults to 30.