<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://chemwiki.ch.ic.ac.uk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ia2514</id>
	<title>ChemWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://chemwiki.ch.ic.ac.uk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ia2514"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Ia2514"/>
	<updated>2026-04-05T19:19:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=734185</id>
		<title>Mod:Hunt Research Group/Python scripts for cube files</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=734185"/>
		<updated>2018-06-25T15:43:41Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:ia2514_small_gif.gif|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Getting Started&amp;lt;/b&amp;gt;&lt;br /&gt;
*go here for initial set-up [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CubePy_setup getting started]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;The latest version of &amp;lt;code&amp;gt;CubePy&amp;lt;/code&amp;gt;, along with a test cube file can be found [[:Media:CubePy_v1.1.zip|here]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CubePy encompasses six modules that can be used to read, save, manipulate and visualise data from cube files:&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py ReadCube.py] - used to extract data from cube files and return it in convenient python formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py] - used to save data from cube files in convenient formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py CalculateCube.py] - used to manipulate data from cube files&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] - used to plot data from cube files (using [https://matplotlib.org Matplotlib])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] - used to plot data from cube files (using [http://docs.enthought.com/mayavi/mayavi/ Mayavi])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] - used to manipulate data &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; from cube files, but from files produced by the scripts above&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to save data from cube files&amp;lt;/b&amp;gt;&lt;br /&gt;
* for saving the values from the cube files, use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py]&lt;br /&gt;
* for saving histogram data, use the function &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] with &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;br /&gt;
* for saving a short summary file of the minimum, maximum and lowest curvature points on the van der Waals surface, use &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt; when running &amp;lt;code&amp;gt;PlotSurface&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot surfaces, isosurfaces, slices&amp;lt;/b&amp;gt;&lt;br /&gt;
* use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]. They are faster and better at 3D plotting than the equivalent functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]&lt;br /&gt;
&lt;br /&gt;
If you want to generate static figures you can also consider using the 3D plotting functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]. These are especially recommended when wanting to display atoms as they look better than their [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] equivalents. However, keep in mind that Matplotlib sometimes fails at 3D rendering, which generates &amp;quot;incorrect&amp;quot; plots (i.e. elements that should be behind the rest of the plot appear at the front). Therefore, plots created using function from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] should be double-checked (by comparing them with plots from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py], by example).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot histograms and KDEs&amp;lt;/b&amp;gt;&lt;br /&gt;
* use &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] to plot a histogram and/or KDE directly from cube files&lt;br /&gt;
* use &amp;lt;code&amp;gt;OverlapKDEs&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] to plot histograms and KDEs from files written by &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] when &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:CubePy_v1.1.zip&amp;diff=734184</id>
		<title>File:CubePy v1.1.zip</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:CubePy_v1.1.zip&amp;diff=734184"/>
		<updated>2018-06-25T15:43:20Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py&amp;diff=734183</id>
		<title>Mod:Hunt Research Group/AdditionalFunctions.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py&amp;diff=734183"/>
		<updated>2018-06-25T15:31:25Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* PlotHistogram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AdditionalFunctions.py&amp;lt;/code&amp;gt; is a collection of functions that do not work directly with cube files, but with data produced by the other scripts.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python AdditionalFunctions.py function_name file_path1 file_path2... arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==OverlapKDEs==&lt;br /&gt;
[[File:ia2514_fig10.png|400px|right|thumb|Figure 1. Plot generated by OverlapKDEs]]&lt;br /&gt;
This function plots overlapping KDEs as read from _kde.out files written by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py#PlotHistogram &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt;] from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py &amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt;] (when &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; is True).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fpaths&amp;lt;/code&amp;gt; (string) = paths for _kde.out files&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python AdditionalFunctions.py OverlapKDEs NH3CH2Cl_esp_kde.out NH3CH2OH_esp_kde.out NH3CH2BH2_esp_kde.out xlim=[2,10]&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
This function plots one KDE and/or one histogram as read from _kde.out and _hist.out files written by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py#PlotHistogram &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt;] from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py &amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt;] (when &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; is True).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 2. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;fpaths&amp;lt;/code&amp;gt; (string) = paths for _kde.out and _hist.out files (should be one of each at most)&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_sym&amp;lt;/code&amp;gt; (boolean, default=False) = if True, the colour bar limits are chosen to be symmetric around 0 (&amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt;, if specified, overrides &amp;lt;code&amp;gt;cb_sym&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
* the function only works for one histogram file and/or one KDE file. If multiple files of either type are specified as arguments, the execution of the program is stopped and a warning is printed.&lt;br /&gt;
* the data in the files specified as arguments must be in the same units. If that is not the case, the execution of the program is stopped and a warning is printed.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python AdditionalFunctions.py PlotHistogram test_emim_oac_esp_kde.out test_emim_oac_esp_hist.out&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=734182</id>
		<title>Mod:Hunt Research Group/PlotCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=734182"/>
		<updated>2018-06-25T15:31:06Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* PlotHistogram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files. &lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
* NumPy&lt;br /&gt;
* scipy&lt;br /&gt;
* [https://gist.github.com/jdiscar/9144764 gistfile1]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotMesh==&lt;br /&gt;
This function creates an interactive plot of the cube file values.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the x values (by default all the x values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the y values (by default all the y values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;zlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the z values (by default all the z values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=0.1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=0.05) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;lower_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the lower limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;upper_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider for the minima and maxima (i.e. ±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:Fig1.png|400px|right|thumb|Figure 1. Plot generated by PlotMesh]]&lt;br /&gt;
* lower cutoff value&lt;br /&gt;
* upper cutoff value&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* SLOW&lt;br /&gt;
* ONLY WORKS FOR ORTHONORMAL GRIDS&lt;br /&gt;
* If you click on a point, it will be highlighted and its value will be displayed in the upper right corner.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotMesh test_emim_oac_esp.cube colour=&#039;plasma&#039; axes=True&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
* &amp;lt;code&amp;gt;grey_surf&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a grey surface just below the van der Waals surface&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig2.png|400px|right|thumb|Figure 2. Plot generated by PlotSurface]]&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSurface test_emim_oac_esp.cube bkg=[0.2,0.2,0.3] &amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot, shown after changing the alpha and zoom values using the slider, is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig3.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* value&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotIsosurface test_emim_oac_esp.cube iso=0.01 iso_range=0.02&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot after rotation is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig4.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSlice test_emim_oac_esp.cube colour=&#039;plasma&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;bins&amp;lt;/code&amp;gt; (integer/None/string, default=30) = the number of bins in the histogram (see [https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.histogram.html here] for details)&lt;br /&gt;
* &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots the histogram; if False, it does not plot the histogram (only the KDE)&lt;br /&gt;
* &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots a gaussian kernel density estimate (KDE = a way to estimate the probability density function of a variable); if False, it does not plot the KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_freq&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a histogram with normalised frequency (without KDE, because the KDE has a normalised area, not normalised bin heights)&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it normalises the histogram (i.e. integral=1) - this happens by default for plots including KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 5. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=True) = if True: if &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_hist.out is created, containing the bin edges values and the frequency for each bin as shown in the histogram; if &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_kde.out is created, containing the range of values used for plotting the KDE and the corresponding KDE value. The file ends with two separate sections: peak values and minimum values&lt;br /&gt;
* &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only plots the histogram and/or KDE for the points that correspond to the cation (the condition for which atoms belong to the cation has to be changed manually inside [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only plots the histogram and/or KDE for the points that correspond to the anion (the condition for which atoms belong to the cation has to be changed manually inside [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;]; the atoms belonging to the anion are the remaining ones)&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_sym&amp;lt;/code&amp;gt; (boolean, default=False) = if True, the colour bar limits are chosen to be symmetric around 0 (&amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt;, if specified, overrides &amp;lt;code&amp;gt;cb_sym&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotHistogram test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 5.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=734181</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=734181"/>
		<updated>2018-06-25T15:30:42Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
* &amp;lt;code&amp;gt;min_colour&amp;lt;/code&amp;gt; (list, default=[0,255,0]) = the RGB colour code of the minima (format: [float_red, float_green, float_blue] where float_red, float_green, float_blue are float numbers between 0 and 255)&lt;br /&gt;
* &amp;lt;code&amp;gt;max_colour&amp;lt;/code&amp;gt; (list, default=[255,0,252]) = the RGB colour code of the maxima (format: [float_red, float_green, float_blue] where float_red, float_green, float_blue are float numbers between 0 and 255)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_sym&amp;lt;/code&amp;gt; (boolean, default=False) = if True, the colour bar limits are chosen to be symmetric around 0 (&amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt;, if specified, overrides &amp;lt;code&amp;gt;cb_sym&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider when selecting the points (i.e. iso±0.05 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_sym&amp;lt;/code&amp;gt; (boolean, default=False) = if True, the colour bar limits are chosen to be symmetric around 0 (&amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt;, if specified, overrides &amp;lt;code&amp;gt;cb_sym&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. iso±0.01 by default)&lt;br /&gt;
[[File:ia2514_fig7.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
* &amp;lt;code&amp;gt;min_colour&amp;lt;/code&amp;gt; (list, default=[0,255,0]) = the RGB colour code of the minima (format: [float_red, float_green, float_blue] where float_red, float_green, float_blue are float numbers between 0 and 255)&lt;br /&gt;
* &amp;lt;code&amp;gt;max_colour&amp;lt;/code&amp;gt; (list, default=[255,0,252]) = the RGB colour code of the maxima (format: [float_red, float_green, float_blue] where float_red, float_green, float_blue are float numbers between 0 and 255)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_sym&amp;lt;/code&amp;gt; (boolean, default=False) = if True, the colour bar limits are chosen to be symmetric around 0 (&amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt;, if specified, overrides &amp;lt;code&amp;gt;cb_sym&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
* &amp;lt;code&amp;gt;min_colour&amp;lt;/code&amp;gt; (list, default=[0,255,0]) = the RGB colour code of the minima (format: [float_red, float_green, float_blue] where float_red, float_green, float_blue are float numbers between 0 and 255)&lt;br /&gt;
* &amp;lt;code&amp;gt;max_colour&amp;lt;/code&amp;gt; (list, default=[255,0,252]) = the RGB colour code of the maxima (format: [float_red, float_green, float_blue] where float_red, float_green, float_blue are float numbers between 0 and 255)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_sym&amp;lt;/code&amp;gt; (boolean, default=False) = if True, the colour bar limits are chosen to be symmetric around 0 (&amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt;, if specified, overrides &amp;lt;code&amp;gt;cb_sym&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=734180</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=734180"/>
		<updated>2018-06-25T15:27:03Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
* &amp;lt;code&amp;gt;min_colour&amp;lt;/code&amp;gt; (list, default=[0,255,0]) = the RGB colour code of the minima (format: [float_red, float_green, float_blue] where float_red, float_green, float_blue are float numbers between 0 and 255)&lt;br /&gt;
* &amp;lt;code&amp;gt;max_colour&amp;lt;/code&amp;gt; (list, default=[255,0,252]) = the RGB colour code of the maxima (format: [float_red, float_green, float_blue] where float_red, float_green, float_blue are float numbers between 0 and 255)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider when selecting the points (i.e. iso±0.05 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. iso±0.01 by default)&lt;br /&gt;
[[File:ia2514_fig7.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
* &amp;lt;code&amp;gt;min_colour&amp;lt;/code&amp;gt; (list, default=[0,255,0]) = the RGB colour code of the minima (format: [float_red, float_green, float_blue] where float_red, float_green, float_blue are float numbers between 0 and 255)&lt;br /&gt;
* &amp;lt;code&amp;gt;max_colour&amp;lt;/code&amp;gt; (list, default=[255,0,252]) = the RGB colour code of the maxima (format: [float_red, float_green, float_blue] where float_red, float_green, float_blue are float numbers between 0 and 255)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
* &amp;lt;code&amp;gt;min_colour&amp;lt;/code&amp;gt; (list, default=[0,255,0]) = the RGB colour code of the minima (format: [float_red, float_green, float_blue] where float_red, float_green, float_blue are float numbers between 0 and 255)&lt;br /&gt;
* &amp;lt;code&amp;gt;max_colour&amp;lt;/code&amp;gt; (list, default=[255,0,252]) = the RGB colour code of the maxima (format: [float_red, float_green, float_blue] where float_red, float_green, float_blue are float numbers between 0 and 255)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py&amp;diff=734179</id>
		<title>Mod:Hunt Research Group/AdditionalFunctions.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py&amp;diff=734179"/>
		<updated>2018-06-25T15:23:11Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AdditionalFunctions.py&amp;lt;/code&amp;gt; is a collection of functions that do not work directly with cube files, but with data produced by the other scripts.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python AdditionalFunctions.py function_name file_path1 file_path2... arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==OverlapKDEs==&lt;br /&gt;
[[File:ia2514_fig10.png|400px|right|thumb|Figure 1. Plot generated by OverlapKDEs]]&lt;br /&gt;
This function plots overlapping KDEs as read from _kde.out files written by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py#PlotHistogram &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt;] from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py &amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt;] (when &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; is True).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fpaths&amp;lt;/code&amp;gt; (string) = paths for _kde.out files&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python AdditionalFunctions.py OverlapKDEs NH3CH2Cl_esp_kde.out NH3CH2OH_esp_kde.out NH3CH2BH2_esp_kde.out xlim=[2,10]&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
This function plots one KDE and/or one histogram as read from _kde.out and _hist.out files written by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py#PlotHistogram &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt;] from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py &amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt;] (when &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; is True).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 2. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;fpaths&amp;lt;/code&amp;gt; (string) = paths for _kde.out and _hist.out files (should be one of each at most)&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
* the function only works for one histogram file and/or one KDE file. If multiple files of either type are specified as arguments, the execution of the program is stopped and a warning is printed.&lt;br /&gt;
* the data in the files specified as arguments must be in the same units. If that is not the case, the execution of the program is stopped and a warning is printed.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python AdditionalFunctions.py PlotHistogram test_emim_oac_esp_kde.out test_emim_oac_esp_hist.out&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=734178</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=734178"/>
		<updated>2018-06-25T15:22:36Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider when selecting the points (i.e. iso±0.05 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. iso±0.01 by default)&lt;br /&gt;
[[File:ia2514_fig7.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=734177</id>
		<title>Mod:Hunt Research Group/PlotCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=734177"/>
		<updated>2018-06-25T15:21:55Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files. &lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
* NumPy&lt;br /&gt;
* scipy&lt;br /&gt;
* [https://gist.github.com/jdiscar/9144764 gistfile1]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotMesh==&lt;br /&gt;
This function creates an interactive plot of the cube file values.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the x values (by default all the x values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the y values (by default all the y values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;zlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the z values (by default all the z values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=0.1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=0.05) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;lower_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the lower limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;upper_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider for the minima and maxima (i.e. ±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:Fig1.png|400px|right|thumb|Figure 1. Plot generated by PlotMesh]]&lt;br /&gt;
* lower cutoff value&lt;br /&gt;
* upper cutoff value&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* SLOW&lt;br /&gt;
* ONLY WORKS FOR ORTHONORMAL GRIDS&lt;br /&gt;
* If you click on a point, it will be highlighted and its value will be displayed in the upper right corner.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotMesh test_emim_oac_esp.cube colour=&#039;plasma&#039; axes=True&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
* &amp;lt;code&amp;gt;grey_surf&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a grey surface just below the van der Waals surface&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig2.png|400px|right|thumb|Figure 2. Plot generated by PlotSurface]]&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSurface test_emim_oac_esp.cube bkg=[0.2,0.2,0.3] &amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot, shown after changing the alpha and zoom values using the slider, is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig3.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* value&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotIsosurface test_emim_oac_esp.cube iso=0.01 iso_range=0.02&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot after rotation is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig4.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSlice test_emim_oac_esp.cube colour=&#039;plasma&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;bins&amp;lt;/code&amp;gt; (integer/None/string, default=30) = the number of bins in the histogram (see [https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.histogram.html here] for details)&lt;br /&gt;
* &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots the histogram; if False, it does not plot the histogram (only the KDE)&lt;br /&gt;
* &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots a gaussian kernel density estimate (KDE = a way to estimate the probability density function of a variable); if False, it does not plot the KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_freq&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a histogram with normalised frequency (without KDE, because the KDE has a normalised area, not normalised bin heights)&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it normalises the histogram (i.e. integral=1) - this happens by default for plots including KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 5. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=True) = if True: if &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_hist.out is created, containing the bin edges values and the frequency for each bin as shown in the histogram; if &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_kde.out is created, containing the range of values used for plotting the KDE and the corresponding KDE value. The file ends with two separate sections: peak values and minimum values&lt;br /&gt;
* &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only plots the histogram and/or KDE for the points that correspond to the cation (the condition for which atoms belong to the cation has to be changed manually inside [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only plots the histogram and/or KDE for the points that correspond to the anion (the condition for which atoms belong to the cation has to be changed manually inside [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;]; the atoms belonging to the anion are the remaining ones)&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
* &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it saves a .log file of the command used to run the functions (the command is tidied-up before saving i.e. unnecessary spaces are removed, argument values are converted to their usual uppercase/lowercase versions, file lists are explicit - instead of using wildcard symbols such as *)&lt;br /&gt;
* &amp;lt;code&amp;gt;logfile&amp;lt;/code&amp;gt; (string, default=None) = the name of the log file (if &amp;lt;code&amp;gt;log&amp;lt;/code&amp;gt; is True); by default the file name is the input file name followed by the function name&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotHistogram test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 5.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=734176</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=734176"/>
		<updated>2018-06-25T15:14:51Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider when selecting the points (i.e. iso±0.05 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. iso±0.01 by default)&lt;br /&gt;
[[File:ia2514_fig7.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=734175</id>
		<title>Mod:Hunt Research Group/PlotCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=734175"/>
		<updated>2018-06-25T15:13:54Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files. &lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
* NumPy&lt;br /&gt;
* scipy&lt;br /&gt;
* [https://gist.github.com/jdiscar/9144764 gistfile1]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotMesh==&lt;br /&gt;
This function creates an interactive plot of the cube file values.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the x values (by default all the x values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the y values (by default all the y values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;zlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the z values (by default all the z values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=0.1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=0.05) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;lower_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the lower limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;upper_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider for the minima and maxima (i.e. ±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:Fig1.png|400px|right|thumb|Figure 1. Plot generated by PlotMesh]]&lt;br /&gt;
* lower cutoff value&lt;br /&gt;
* upper cutoff value&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* SLOW&lt;br /&gt;
* ONLY WORKS FOR ORTHONORMAL GRIDS&lt;br /&gt;
* If you click on a point, it will be highlighted and its value will be displayed in the upper right corner.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotMesh test_emim_oac_esp.cube colour=&#039;plasma&#039; axes=True&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
* &amp;lt;code&amp;gt;grey_surf&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a grey surface just below the van der Waals surface&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig2.png|400px|right|thumb|Figure 2. Plot generated by PlotSurface]]&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSurface test_emim_oac_esp.cube bkg=[0.2,0.2,0.3] &amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot, shown after changing the alpha and zoom values using the slider, is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig3.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* value&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotIsosurface test_emim_oac_esp.cube iso=0.01 iso_range=0.02&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot after rotation is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig4.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSlice test_emim_oac_esp.cube colour=&#039;plasma&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;bins&amp;lt;/code&amp;gt; (integer/None/string, default=30) = the number of bins in the histogram (see [https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.histogram.html here] for details)&lt;br /&gt;
* &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots the histogram; if False, it does not plot the histogram (only the KDE)&lt;br /&gt;
* &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots a gaussian kernel density estimate (KDE = a way to estimate the probability density function of a variable); if False, it does not plot the KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_freq&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a histogram with normalised frequency (without KDE, because the KDE has a normalised area, not normalised bin heights)&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it normalises the histogram (i.e. integral=1) - this happens by default for plots including KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 5. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=True) = if True: if &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_hist.out is created, containing the bin edges values and the frequency for each bin as shown in the histogram; if &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_kde.out is created, containing the range of values used for plotting the KDE and the corresponding KDE value. The file ends with two separate sections: peak values and minimum values&lt;br /&gt;
* &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only plots the histogram and/or KDE for the points that correspond to the cation (the condition for which atoms belong to the cation has to be changed manually inside [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only plots the histogram and/or KDE for the points that correspond to the anion (the condition for which atoms belong to the cation has to be changed manually inside [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;]; the atoms belonging to the anion are the remaining ones)&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotHistogram test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 5.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/ReadCube.py&amp;diff=734174</id>
		<title>Mod:Hunt Research Group/ReadCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/ReadCube.py&amp;diff=734174"/>
		<updated>2018-06-25T15:12:37Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* GetVdWPoints */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt; is a collection of functions that extract data from cube files and return it in convenient python formats. These are the main functions used by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py &amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt;], [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py &amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt;], [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py &amp;lt;code&amp;gt;SaveCube.py&amp;lt;/code&amp;gt;] and [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;].&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
If you want to use the functions in &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt; to extract data from cube files in Python, you will need to write a Python script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import ReadCube as rc&lt;br /&gt;
var1 = rc.function_name(arg1=val1, arg2=val2,...)&lt;br /&gt;
&amp;lt;do something with var1: print it, save it to file, etc.&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Python script can be written and ran in different ways:&lt;br /&gt;
* as a new .py file using Spyder (Spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; File &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; New file... &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; [write the file] &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Save As... [make sure you save the file in the same directory as &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;] &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Run &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Run [the file will be run in the iPython console]&lt;br /&gt;
* in the IPython console in Spyder: write the Python commands directly in the console, but make sure that the current working directory is the one containing &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;&lt;br /&gt;
* in the terminal window: type &amp;lt;code&amp;gt;ipython&amp;lt;/code&amp;gt;, then write the Python commands directly in the terminal, but make sure that the current working directory is the one containing &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import ReadCube as rc&lt;br /&gt;
at = rc.Atoms(fpath=&#039;test_emim_oac_esp.cube&#039;)&lt;br /&gt;
print([i[0] for i in at])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This example prints the atomic numbers of all the constituent atoms:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[7, 6, 1, 1, 1, 6, 1, 7, 6, 1, 1, 6, 1, 1, 1, 6, 6, 1, 1, 6, 8, 8, 6, 1, 1, 1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==ExtractData==&lt;br /&gt;
This function extracts all the data from the cube file.&lt;br /&gt;
&lt;br /&gt;
===Required parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
    &lt;br /&gt;
===Optional parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
  &lt;br /&gt;
===Returns===&lt;br /&gt;
a list of: the number of atoms, a list of the coordinates of the origin, the number of values recorded at each point, the number of voxels along x axis, a list of the coordinates of the increment vector for the x axis, the number of voxels along y axis, a list of the coordinates of the increment vector for the y axis, the number of voxels along z axis, a list of the coordinates of the increment vector for the z axis, a list of lists containing the atomic number, the nuclear charge and coordinates for each atom, a list of MO indices, a 3D array of all the values in the cube file, a list of all the values in the cube file, value units (in order)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Atoms==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = value type&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of a number of natoms lists, each list component containing the atomic number, nuclear charge and coordinates of each atom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Axes==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;origin&amp;lt;/code&amp;gt; (list, default=None) = a list of the x, y and z coordinates of the origin&lt;br /&gt;
* &amp;lt;code&amp;gt;n_x&amp;lt;/code&amp;gt; (integer, default=None) = number of voxels along x axis&lt;br /&gt;
* &amp;lt;code&amp;gt;x_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the x direction&lt;br /&gt;
* &amp;lt;code&amp;gt;n_y&amp;lt;/code&amp;gt; (integer, default=None) = number of voxels along y axis&lt;br /&gt;
* &amp;lt;code&amp;gt;y_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the y direction&lt;br /&gt;
* &amp;lt;code&amp;gt;n_z&amp;lt;/code&amp;gt; (integer, default=None) = number of voxels along z axis&lt;br /&gt;
* &amp;lt;code&amp;gt;z_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the z direction&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of three lists representing the x, y and z coordinates, respectively of the grid points&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;origin, n_x, x_vector, n_y, y_vector, n_z, z_vector&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==ValuesAsMatrix==&lt;br /&gt;
&lt;br /&gt;
===Parameters=== &lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a 3D array of all the values in the cube file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ValuesAsList==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of all the values in the cube file (in the order in which they appear)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ValuesAsDictionary==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;vals&amp;lt;/code&amp;gt; (list, default=None) = a list of all the values in the cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;axes_list&amp;lt;/code&amp;gt; (list, default=None) = a list of three lists representing the x, y and z coordinates, respectively of all the sampling points (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;origin&amp;lt;/code&amp;gt; (list, default=None) = a list of the x, y and z coordinates of the origin&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value and an ordered dictionary of each grid point (represented through a tuple of its indices) and its corresponding value&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;vals, axes_list, origin&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==Minimum==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;gridpts&amp;lt;/code&amp;gt; (dictionary, default=None) = an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value (the first element in the list generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;vals&amp;lt;/code&amp;gt; (list, default=None) = a list of all the values in the cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list the coordinates of all the grid points that have the minimum value&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;gridpts, vals&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==Maximum==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;gridpts&amp;lt;/code&amp;gt; (dictionary, default=None) = an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value (the first element in the list generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;vals&amp;lt;/code&amp;gt; (list, default=None) = a list of all the values in the cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Returns=== &lt;br /&gt;
a list the coordinates of all the grid points that have the maximum value&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;gridpts, vals&amp;lt;/code&amp;gt;   &lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==GetVdWPoints==&lt;br /&gt;
This function returns all the points that are close to the surface defined in terms of the Van der Waals radii of the constituent atoms.&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;axes_list&amp;lt;/code&amp;gt; (list, default=None) = a list of three lists representing the x, y and z coordinates, respectively of all the sampling points (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;gridpts&amp;lt;/code&amp;gt; (dictionary, default=None) = an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value (the first element in the list generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms_list&amp;lt;/code&amp;gt; (list, default=None) = a list of a number of natoms lists, each list component containing the atomic number, nuclear charge and coordinates of each atom (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Atoms &amp;lt;code&amp;gt;Atoms&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;x_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the x direction&lt;br /&gt;
* &amp;lt;code&amp;gt;y_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the y direction&lt;br /&gt;
* &amp;lt;code&amp;gt;z_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the z direction&lt;br /&gt;
* &amp;lt;code&amp;gt;origin&amp;lt;/code&amp;gt; (list, default=None) = a list of the x, y and z coordinates of the origin&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only selects the points that correspond to the cation (the condition for which atoms belong to the cation has to be changed manually inside the code)&lt;br /&gt;
* &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only selects the points that correspond to the anion (the condition for which atoms belong to the cation has to be changed manually inside the code; the atoms belonging to the anion are the remaining ones)&lt;br /&gt;
* &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt; (float, default=0.3) = represents the fractional thickness of the van der Waals surface (by default, the points that are within 0.3=30% of the surface defined by the van der Waals radii of the constituent atoms are selected as part of the van der Waals surface)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of three lists: the first one contains the x, y, z coordinates and the value of each point on the VdW surface, the second one contains the indices and the value of each point on the VdW surface and the third one contains the coordinates and values of all the points that are on or inside the VdW surface&lt;br /&gt;
 &lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units, factor&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;axes_list, gridpts, atoms_list, x_vector, y_vector, z_vector, origin, factor&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
* the points that reside on the VdW surface are chosen to be within plus/minus a distance of the surface defined by the Van der Waals radii of the constituent atoms (the distance is given by the distance between two diagonally adjacent points in the grid multiplied by &amp;lt;code&amp;gt;thickness&amp;lt;/code&amp;gt;)&lt;br /&gt;
* if you want to only select certain points from the van der Waals surface, you can change this manually inside the code; this also applies for only selecting points which belong to either the cation or the anion (for which there are the parameters &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt;, respectively)&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=734173</id>
		<title>Mod:Hunt Research Group/Python scripts for cube files</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=734173"/>
		<updated>2018-06-25T14:53:06Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:ia2514_small_gif.gif|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Getting Started&amp;lt;/b&amp;gt;&lt;br /&gt;
*go here for initial set-up [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CubePy_setup getting started]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;The latest version of &amp;lt;code&amp;gt;CubePy&amp;lt;/code&amp;gt;, along with a test cube file can be found [[:Media:CubePy_v1.zip|here]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CubePy encompasses six modules that can be used to read, save, manipulate and visualise data from cube files:&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py ReadCube.py] - used to extract data from cube files and return it in convenient python formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py] - used to save data from cube files in convenient formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py CalculateCube.py] - used to manipulate data from cube files&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] - used to plot data from cube files (using [https://matplotlib.org Matplotlib])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] - used to plot data from cube files (using [http://docs.enthought.com/mayavi/mayavi/ Mayavi])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] - used to manipulate data &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; from cube files, but from files produced by the scripts above&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to save data from cube files&amp;lt;/b&amp;gt;&lt;br /&gt;
* for saving the values from the cube files, use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py]&lt;br /&gt;
* for saving histogram data, use the function &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] with &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;br /&gt;
* for saving a short summary file of the minimum, maximum and lowest curvature points on the van der Waals surface, use &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt; when running &amp;lt;code&amp;gt;PlotSurface&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot surfaces, isosurfaces, slices&amp;lt;/b&amp;gt;&lt;br /&gt;
* use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]. They are faster and better at 3D plotting than the equivalent functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]&lt;br /&gt;
&lt;br /&gt;
If you want to generate static figures you can also consider using the 3D plotting functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]. These are especially recommended when wanting to display atoms as they look better than their [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] equivalents. However, keep in mind that Matplotlib sometimes fails at 3D rendering, which generates &amp;quot;incorrect&amp;quot; plots (i.e. elements that should be behind the rest of the plot appear at the front). Therefore, plots created using function from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] should be double-checked (by comparing them with plots from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py], by example).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot histograms and KDEs&amp;lt;/b&amp;gt;&lt;br /&gt;
* use &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] to plot a histogram and/or KDE directly from cube files&lt;br /&gt;
* use &amp;lt;code&amp;gt;OverlapKDEs&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] to plot histograms and KDEs from files written by &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] when &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=734172</id>
		<title>Mod:Hunt Research Group/Python scripts for cube files</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=734172"/>
		<updated>2018-06-25T14:50:32Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;Getting Started&amp;lt;/b&amp;gt;&lt;br /&gt;
*go here for initial set-up [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CubePy_setup getting started]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;The latest version of &amp;lt;code&amp;gt;CubePy&amp;lt;/code&amp;gt;, along with a test cube file can be found [[:Media:CubePy_v1.zip|here]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:ia2514_small_gif.gif|400px|right|thumb|Click on this gif to see a 360° plot generated using PlotSurface from PlotCube_mayavi]]&lt;br /&gt;
&lt;br /&gt;
CubePy encompasses six modules that can be used to read, save, manipulate and visualise data from cube files:&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py ReadCube.py] - used to extract data from cube files and return it in convenient python formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py] - used to save data from cube files in convenient formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py CalculateCube.py] - used to manipulate data from cube files&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] - used to plot data from cube files (using [https://matplotlib.org Matplotlib])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] - used to plot data from cube files (using [http://docs.enthought.com/mayavi/mayavi/ Mayavi])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] - used to manipulate data &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; from cube files, but from files produced by the scripts above&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to save data from cube files&amp;lt;/b&amp;gt;&lt;br /&gt;
* for saving the values from the cube files, use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py]&lt;br /&gt;
* for saving histogram data, use the function &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] with &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;br /&gt;
* for saving a short summary file of the minimum, maximum and lowest curvature points on the van der Waals surface, use &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt; when running &amp;lt;code&amp;gt;PlotSurface&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot surfaces, isosurfaces, slices&amp;lt;/b&amp;gt;&lt;br /&gt;
* use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]. They are faster and better at 3D plotting than the equivalent functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]&lt;br /&gt;
&lt;br /&gt;
If you want to generate static figures you can also consider using the 3D plotting functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]. These are especially recommended when wanting to display atoms as they look better than their [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] equivalents. However, keep in mind that Matplotlib sometimes fails at 3D rendering, which generates &amp;quot;incorrect&amp;quot; plots (i.e. elements that should be behind the rest of the plot appear at the front). Therefore, plots created using function from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] should be double-checked (by comparing them with plots from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py], by example).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot histograms and KDEs&amp;lt;/b&amp;gt;&lt;br /&gt;
* use &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] to plot a histogram and/or KDE directly from cube files&lt;br /&gt;
* use &amp;lt;code&amp;gt;OverlapKDEs&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] to plot histograms and KDEs from files written by &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] when &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=734171</id>
		<title>Mod:Hunt Research Group/Python scripts for cube files</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=734171"/>
		<updated>2018-06-25T14:48:27Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;Getting Started&amp;lt;/b&amp;gt;&lt;br /&gt;
*go here for initial set-up [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CubePy_setup getting started]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;The latest version of &amp;lt;code&amp;gt;CubePy&amp;lt;/code&amp;gt;, along with a test cube file can be found [[:Media:CubePy_v1.zip|here]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:ia2514_small_gif.gif|400px|right|thumb]]&lt;br /&gt;
&lt;br /&gt;
CubePy encompasses six modules that can be used to read, save, manipulate and visualise data from cube files:&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py ReadCube.py] - used to extract data from cube files and return it in convenient python formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py] - used to save data from cube files in convenient formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py CalculateCube.py] - used to manipulate data from cube files&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] - used to plot data from cube files (using [https://matplotlib.org Matplotlib])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] - used to plot data from cube files (using [http://docs.enthought.com/mayavi/mayavi/ Mayavi])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] - used to manipulate data &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; from cube files, but from files produced by the scripts above&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to save data from cube files&amp;lt;/b&amp;gt;&lt;br /&gt;
* for saving the values from the cube files, use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py]&lt;br /&gt;
* for saving histogram data, use the function &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] with &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;br /&gt;
* for saving a short summary file of the minimum, maximum and lowest curvature points on the van der Waals surface, use &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt; when running &amp;lt;code&amp;gt;PlotSurface&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot surfaces, isosurfaces, slices&amp;lt;/b&amp;gt;&lt;br /&gt;
* use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]. They are faster and better at 3D plotting than the equivalent functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]&lt;br /&gt;
&lt;br /&gt;
If you want to generate static figures you can also consider using the 3D plotting functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]. These are especially recommended when wanting to display atoms as they look better than their [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] equivalents. However, keep in mind that Matplotlib sometimes fails at 3D rendering, which generates &amp;quot;incorrect&amp;quot; plots (i.e. elements that should be behind the rest of the plot appear at the front). Therefore, plots created using function from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] should be double-checked (by comparing them with plots from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py], by example).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot histograms and KDEs&amp;lt;/b&amp;gt;&lt;br /&gt;
* use &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] to plot a histogram and/or KDE directly from cube files&lt;br /&gt;
* use &amp;lt;code&amp;gt;OverlapKDEs&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] to plot histograms and KDEs from files written by &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] when &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Ia2514_small_gif.gif&amp;diff=734170</id>
		<title>File:Ia2514 small gif.gif</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Ia2514_small_gif.gif&amp;diff=734170"/>
		<updated>2018-06-25T14:47:17Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=734153</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=734153"/>
		<updated>2018-06-13T12:56:24Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider when selecting the points (i.e. iso±0.05 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. iso±0.01 by default)&lt;br /&gt;
[[File:ia2514_fig7.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=734119</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=734119"/>
		<updated>2018-06-11T10:01:39Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider when selecting the points (i.e. iso±0.05 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. iso±0.01 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=718328</id>
		<title>Mod:Hunt Research Group/Python scripts for cube files</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=718328"/>
		<updated>2018-05-17T11:42:19Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;The latest version of &amp;lt;code&amp;gt;CubePy&amp;lt;/code&amp;gt;, along with a test cube file can be found [[:Media:CubePy_v1.zip|here]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CubePy encompasses six modules that can be used to read, save, manipulate and visualise data from cube files:&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py ReadCube.py] - used to extract data from cube files and return it in convenient python formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py] - used to save data from cube files in convenient formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py CalculateCube.py] - used to manipulate data from cube files&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] - used to plot data from cube files (using [https://matplotlib.org Matplotlib])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] - used to plot data from cube files (using [http://docs.enthought.com/mayavi/mayavi/ Mayavi])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] - used to manipulate data &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; from cube files, but from files produced by the scripts above&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to save data from cube files&amp;lt;/b&amp;gt;&lt;br /&gt;
* for saving the values from the cube files, use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py]&lt;br /&gt;
* for saving histogram data, use the function &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] with &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;br /&gt;
* for saving a short summary file of the minimum, maximum and lowest curvature points on the van der Waals surface, use &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt; when running &amp;lt;code&amp;gt;PlotSurface&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot surfaces, isosurfaces, slices&amp;lt;/b&amp;gt;&lt;br /&gt;
* use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]. They are faster and better at 3D plotting than the equivalent functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]&lt;br /&gt;
&lt;br /&gt;
If you want to generate static figures you can also consider using the 3D plotting functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]. These are especially recommended when wanting to display atoms as they look better than their [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] equivalents. However, keep in mind that Matplotlib sometimes fails at 3D rendering, which generates &amp;quot;incorrect&amp;quot; plots (i.e. elements that should be behind the rest of the plot appear at the front). Therefore, plots created using function from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] should be double-checked (by comparing them with plots from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py], by example).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot histograms and KDEs&amp;lt;/b&amp;gt;&lt;br /&gt;
* use &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] to plot a histogram and/or KDE directly from cube files&lt;br /&gt;
* use &amp;lt;code&amp;gt;OverlapKDEs&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] to plot histograms and KDEs from files written by &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] when &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:CubePy_v1.zip&amp;diff=718310</id>
		<title>File:CubePy v1.zip</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:CubePy_v1.zip&amp;diff=718310"/>
		<updated>2018-05-17T11:39:15Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=710454</id>
		<title>Mod:Hunt Research Group/Python scripts for cube files</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=710454"/>
		<updated>2018-05-10T19:11:17Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;The latest version of &amp;lt;code&amp;gt;CubePy&amp;lt;/code&amp;gt;, along with a test cube file can be found [[:Media:CubePy.zip|here]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CubePy encompasses six modules that can be used to read, save, manipulate and visualise data from cube files:&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py ReadCube.py] - used to extract data from cube files and return it in convenient python formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py] - used to save data from cube files in convenient formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py CalculateCube.py] - used to manipulate data from cube files&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] - used to plot data from cube files (using [https://matplotlib.org Matplotlib])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] - used to plot data from cube files (using [http://docs.enthought.com/mayavi/mayavi/ Mayavi])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] - used to manipulate data &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; from cube files, but from files produced by the scripts above&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to save data from cube files&amp;lt;/b&amp;gt;&lt;br /&gt;
* for saving the values from the cube files, use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py]&lt;br /&gt;
* for saving histogram data, use the function &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] with &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;br /&gt;
* for saving a short summary file of the minimum, maximum and lowest curvature points on the van der Waals surface, use &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt; when running &amp;lt;code&amp;gt;PlotSurface&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot surfaces, isosurfaces, slices&amp;lt;/b&amp;gt;&lt;br /&gt;
* use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]. They are faster and better at 3D plotting than the equivalent functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]&lt;br /&gt;
&lt;br /&gt;
If you want to generate static figures you can also consider using the 3D plotting functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]. These are especially recommended when wanting to display atoms as they look better than their [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] equivalents. However, keep in mind that Matplotlib sometimes fails at 3D rendering, which generates &amp;quot;incorrect&amp;quot; plots (i.e. elements that should be behind the rest of the plot appear at the front). Therefore, plots created using function from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] should be double-checked (by comparing them with plots from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py], by example).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot histograms and KDEs&amp;lt;/b&amp;gt;&lt;br /&gt;
* use &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] to plot a histogram and/or KDE directly from cube files&lt;br /&gt;
* use &amp;lt;code&amp;gt;OverlapKDEs&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] to plot histograms and KDEs from files written by &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] when &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:CubePy.zip&amp;diff=710451</id>
		<title>File:CubePy.zip</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:CubePy.zip&amp;diff=710451"/>
		<updated>2018-05-10T19:10:24Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py&amp;diff=709930</id>
		<title>Mod:Hunt Research Group/AdditionalFunctions.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py&amp;diff=709930"/>
		<updated>2018-05-10T16:24:36Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AdditionalFunctions.py&amp;lt;/code&amp;gt; is a collection of functions that do not work directly with cube files, but with data produced by the other scripts.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python AdditionalFunctions.py function_name file_path1 file_path2... arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==OverlapKDEs==&lt;br /&gt;
[[File:ia2514_fig10.png|400px|right|thumb|Figure 1. Plot generated by OverlapKDEs]]&lt;br /&gt;
This function plots overlapping KDEs as read from _kde.out files written by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py#PlotHistogram &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt;] from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py &amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt;] (when &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; is True).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fpaths&amp;lt;/code&amp;gt; (string) = paths for _kde.out files&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python AdditionalFunctions.py OverlapKDEs NH3CH2Cl_esp_kde.out NH3CH2OH_esp_kde.out NH3CH2BH2_esp_kde.out xlim=[2,10]&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
This function plots one KDE and/or one histogram as read from _kde.out and _hist.out files written by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py#PlotHistogram &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt;] from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py &amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt;] (when &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; is True).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 2. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;fpaths&amp;lt;/code&amp;gt; (string) = paths for _kde.out and _hist.out files (should be one of each at most)&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
* the function only works for one histogram file and/or one KDE file. If multiple files of either type are specified as arguments, the execution of the program is stopped and a warning is printed.&lt;br /&gt;
* the data in the files specified as arguments must be in the same units. If that is not the case, the execution of the program is stopped and a warning is printed.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python AdditionalFunctions.py PlotHistogram test_emim_oac_esp_kde.out test_emim_oac_esp_hist.out&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709929</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709929"/>
		<updated>2018-05-10T16:24:27Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider when selecting the points (i.e. iso±0.05 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. iso±0.01 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=709928</id>
		<title>Mod:Hunt Research Group/PlotCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=709928"/>
		<updated>2018-05-10T16:24:16Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files. &lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
* NumPy&lt;br /&gt;
* scipy&lt;br /&gt;
* [https://gist.github.com/jdiscar/9144764 gistfile1]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotMesh==&lt;br /&gt;
This function creates an interactive plot of the cube file values.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the x values (by default all the x values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the y values (by default all the y values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;zlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the z values (by default all the z values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=0.1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=0.05) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;lower_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the lower limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;upper_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider for the minima and maxima (i.e. ±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:Fig1.png|400px|right|thumb|Figure 1. Plot generated by PlotMesh]]&lt;br /&gt;
* lower cutoff value&lt;br /&gt;
* upper cutoff value&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* SLOW&lt;br /&gt;
* ONLY WORKS FOR ORTHONORMAL GRIDS&lt;br /&gt;
* If you click on a point, it will be highlighted and its value will be displayed in the upper right corner.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotMesh test_emim_oac_esp.cube colour=&#039;plasma&#039; axes=True&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
* &amp;lt;code&amp;gt;grey_surf&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a grey surface just below the van der Waals surface&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig2.png|400px|right|thumb|Figure 2. Plot generated by PlotSurface]]&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSurface test_emim_oac_esp.cube bkg=[0.2,0.2,0.3] &amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot, shown after changing the alpha and zoom values using the slider, is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig3.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* value&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotIsosurface test_emim_oac_esp.cube iso=0.01 iso_range=0.02&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot after rotation is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig4.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSlice test_emim_oac_esp.cube colour=&#039;plasma&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;bins&amp;lt;/code&amp;gt; (integer/None/string, default=30) = the number of bins in the histogram (see [https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.histogram.html here] for details)&lt;br /&gt;
* &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots the histogram; if False, it does not plot the histogram (only the KDE)&lt;br /&gt;
* &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots a gaussian kernel density estimate (KDE = a way to estimate the probability density function of a variable); if False, it does not plot the KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_freq&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a histogram with normalised frequency (without KDE, because the KDE has a normalised area, not normalised bin heights)&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it normalises the histogram (i.e. integral=1) - this happens by default for plots including KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 5. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=True) = if True: if &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_hist.out is created, containing the bin edges values and the frequency for each bin as shown in the histogram; if &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_kde.out is created, containing the range of values used for plotting the KDE and the corresponding KDE value. The file ends with two separate sections: peak values and minimum values&lt;br /&gt;
* &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only plots the histogram and/or KDE for the points that correspond to the cation (the condition for which atoms belong to the cation has to be changed manually inside [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only plots the histogram and/or KDE for the points that correspond to the anion (the condition for which atoms belong to the cation has to be changed manually inside [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;]; the atoms belonging to the anion are the remaining ones)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotHistogram test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 5.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py&amp;diff=709924</id>
		<title>Mod:Hunt Research Group/CalculateCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py&amp;diff=709924"/>
		<updated>2018-05-10T16:24:07Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt; is a collection of functions that manipulate data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* NumPy&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
If you want to use the functions in &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt; to extract data from cube files in Python, you will need to write a Python script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import CalculateCube as cc&lt;br /&gt;
var1 = cc.function_name(arg1=val1, arg2=val2,...)&lt;br /&gt;
&amp;lt;do something with var1: print it, save it to file, etc.&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Python script can be written and ran in different ways:&lt;br /&gt;
* as a new .py file using Spyder (Spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; File &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; New file... &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; [write the file] &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Save As... [make sure you save the file in the same directory as &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;] &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Run &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Run [the file will be run in the iPython console]&lt;br /&gt;
* in the IPython console in Spyder: write the Python commands directly in the console, but make sure that the current working directory is the one containing &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;&lt;br /&gt;
* in the terminal window: type &amp;lt;code&amp;gt;ipython&amp;lt;/code&amp;gt;, then write the Python commands directly in the terminal, but make sure that the current working directory is the one containing &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==Derivative==&lt;br /&gt;
This function returns the Nth derivative of the value matrix from a cube file.&lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;x_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the x direction&lt;br /&gt;
* &amp;lt;code&amp;gt;y_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the y direction&lt;br /&gt;
* &amp;lt;code&amp;gt;z_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the z direction&lt;br /&gt;
* &amp;lt;code&amp;gt;val&amp;lt;/code&amp;gt; (list, default=None) = a matrix of all the values&lt;br /&gt;
* &amp;lt;code&amp;gt;order&amp;lt;/code&amp;gt; (integer, default=1) = the order of the derivative&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]; if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of two lists: the first one of three arrays corresponding to the derivatives of the value matrix with respect to x, y and z (each array has the same shape as the original matrix) and the second one of the dx, dy and dz values (i.e. the lengths of the x, y and z increment vectors)&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, order, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;x_vector, y_vector, z_vector, val, order&amp;lt;/code&amp;gt;   &lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import CalculateCube as cc&lt;br /&gt;
d2 = cc.Derivative(fpath=&#039;test_emim_oac_esp.cube&#039;,order=2)&lt;br /&gt;
print(d2[0][0][0][0][0])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example calculates the second order derivative for the values in &amp;lt;i&amp;gt;test_emim_oac_esp.cube&amp;lt;/i&amp;gt; and prints the first one to screen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;-0.0022345003728754002&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Laplacian==&lt;br /&gt;
This function calculates the Laplacian by summing the second order derivative with respect to x, y and z as obtained using [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#Derivative &amp;lt;code&amp;gt;Derivative&amp;lt;/code&amp;gt;] for each data point.&lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;x_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the x direction&lt;br /&gt;
* &amp;lt;code&amp;gt;y_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the y direction&lt;br /&gt;
* &amp;lt;code&amp;gt;z_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the z direction&lt;br /&gt;
* &amp;lt;code&amp;gt;val&amp;lt;/code&amp;gt; (list, default=None) = a matrix of all the values&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#Derivative &amp;lt;code&amp;gt;Derivative&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a matrix of the Laplacian for every data point from a cube file&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, order, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;x_vector, y_vector, z_vector, val, order&amp;lt;/code&amp;gt;   &lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import CalculateCube as cc&lt;br /&gt;
l = cc.Laplacian(fpath=&#039;test_emim_oac_esp.cube&#039;)&lt;br /&gt;
print(l[0][0][0])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example calculates the Laplacian for the values in &amp;lt;i&amp;gt;test_emim_oac_esp.cube&amp;lt;/i&amp;gt; and prints the first one to screen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;-0.000563911766024&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==VdWLaplacian==&lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;axes_list&amp;lt;/code&amp;gt; (list, default=None) = a list of three lists representing the x, y and z coordinates, respectively of all the sampling points (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;gridpts&amp;lt;/code&amp;gt; (dictionary, default=None) = an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value (the first element in the list generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms_list&amp;lt;/code&amp;gt; (list, default=None) = a list of a number of natoms lists, each list component containing the atomic number, nuclear charge and coordinates of each atom (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Atoms &amp;lt;code&amp;gt;Atoms&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;x_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the x direction&lt;br /&gt;
* &amp;lt;code&amp;gt;y_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the y direction&lt;br /&gt;
* &amp;lt;code&amp;gt;z_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the z direction&lt;br /&gt;
* &amp;lt;code&amp;gt;val&amp;lt;/code&amp;gt; (list, default=None) = a matrix of all the values&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;vdw_ind&amp;lt;/code&amp;gt; (list, default=None) = a list of lists containing the indices and the values of the points close to the van der Waals surface&lt;br /&gt;
* &amp;lt;code&amp;gt;vdw_pts&amp;lt;/code&amp;gt; (list, default=None) = a list of lists containing the coordinates and the values of the points close to the van der Waals surface&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]; if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]; if either &amp;lt;code&amp;gt;vdw_ind&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;vdw_pts&amp;lt;/code&amp;gt; is not specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]; if either &amp;lt;code&amp;gt;vdw_ind&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;vdw_pts&amp;lt;/code&amp;gt; is not specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]; if either &amp;lt;code&amp;gt;vdw_ind&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;vdw_pts&amp;lt;/code&amp;gt; is not specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#Laplacian &amp;lt;code&amp;gt;Laplacian&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
two lists: one containing coordinates + Laplacian for each data point on the van der Waals surface and one containing indices + Laplacian for each data point on the van der Waals surface&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with &amp;lt;code&amp;gt;fpath, factor, au, density, value_type, units&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;fpath, factor, vdw_ind, vdw_pts, au, density, value_type, units&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;axes_list, gridpts, atoms_list, x_vector, y_vector, z_vector, val, factor&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;axes_list, gridpts, atoms_list, x_vector, y_vector, z_vector, val, factor, vdw_ind, vdw_pts&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import CalculateCube as cc&lt;br /&gt;
vdwl = cc.VdWLaplacian(fpath=&#039;test_emim_oac_esp.cube&#039;)&lt;br /&gt;
print(vdwl[0][0][3])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example calculates the Laplacian for the van der Waals surface values in &amp;lt;i&amp;gt;test_emim_oac_esp.cube&amp;lt;/i&amp;gt; and prints the first one to screen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;2.5970251494598204&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Hessian==&lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;x_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the x direction&lt;br /&gt;
* &amp;lt;code&amp;gt;y_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the y direction&lt;br /&gt;
* &amp;lt;code&amp;gt;z_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the z direction&lt;br /&gt;
* &amp;lt;code&amp;gt;val&amp;lt;/code&amp;gt; (list, default=None) = a matrix of all the values&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#Derivative &amp;lt;code&amp;gt;Derivative&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a matrix of the Hessian for every data point from a cube file&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, order, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;x_vector, y_vector, z_vector, val, order&amp;lt;/code&amp;gt;   &lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import CalculateCube as cc&lt;br /&gt;
h = cc.Hessian(fpath=&#039;test_emim_oac_esp.cube&#039;, density=3)&lt;br /&gt;
for i in range(3):&lt;br /&gt;
    print([h[0][0][0][i][j] for j in range(3)])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example calculates the hessian for the values in &amp;lt;i&amp;gt;test_emim_oac_esp.cube&amp;lt;/i&amp;gt; at a reduced density and prints the first one to screen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[-0.002701294001419571, 0.0068108009963301665, 0.006906352712240404]&lt;br /&gt;
[0.0068108009963301708, 0.0013040459589339015, 0.01042453556361086]&lt;br /&gt;
[0.0069063527122403996, 0.010424535563610851, -0.00046992647168781301]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==VdWHessian==&lt;br /&gt;
===Arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;axes_list&amp;lt;/code&amp;gt; (list, default=None) = a list of three lists representing the x, y and z coordinates, respectively of all the sampling points (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;gridpts&amp;lt;/code&amp;gt; (dictionary, default=None) = an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value (the first element in the list generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms_list&amp;lt;/code&amp;gt; (list, default=None) = a list of a number of natoms lists, each list component containing the atomic number, nuclear charge and coordinates of each atom (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Atoms &amp;lt;code&amp;gt;Atoms&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;x_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the x direction&lt;br /&gt;
* &amp;lt;code&amp;gt;y_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the y direction&lt;br /&gt;
* &amp;lt;code&amp;gt;z_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the z direction&lt;br /&gt;
* &amp;lt;code&amp;gt;val&amp;lt;/code&amp;gt; (list, default=None) = a matrix of all the values* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = * &amp;lt;code&amp;gt;vdw_ind&amp;lt;/code&amp;gt; (list, default=None) = a list of lists containing the indices and the values of the points close to the van der Waals surface* &amp;lt;code&amp;gt;vdw_pts&amp;lt;/code&amp;gt; (list, default=None) = a list of lists containing the coordinates and the values of the points close to the van der Waals surface&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]; if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]; if either &amp;lt;code&amp;gt;vdw_ind&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;vdw_pts&amp;lt;/code&amp;gt; is not specified)* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]; if either &amp;lt;code&amp;gt;vdw_ind&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;vdw_pts&amp;lt;/code&amp;gt; is not specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]; if either &amp;lt;code&amp;gt;vdw_ind&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;vdw_pts&amp;lt;/code&amp;gt; is not specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#Hessian &amp;lt;code&amp;gt;Hessian&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&lt;br /&gt;
two lists: one containing coordinates + Hessian matrix for each data point on the van der Waals surface and one containing indices + Hessian matrix for each data point on the van der Waals surface&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with &amp;lt;code&amp;gt;fpath, factor, au, density, value_type, units&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;fpath, factor, vdw_ind, vdw_pts, au, density, value_type, units&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;axes_list, gridpts, atoms_list, x_vector, y_vector, z_vector, val, factor&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;axes_list, gridpts, atoms_list, x_vector, y_vector, z_vector, val, factor, vdw_ind, vdw_pts&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import CalculateCube as cc&lt;br /&gt;
vdwh = cc.VdWHessian(fpath=&#039;test_emim_oac_esp.cube&#039;)&lt;br /&gt;
print(vdwh[0][0][3])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example calculates the hessian for the van der Waals surface values in &amp;lt;i&amp;gt;test_emim_oac_esp.cube&amp;lt;/i&amp;gt; and prints the first one to screen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[[6.2995640717272767, 3.0272898269372841, -0.043632672896223364],&lt;br /&gt;
[3.0272898269372845, -1.268343295247532, 0.057448511163856956],&lt;br /&gt;
 [-0.043632672896223711, 0.057448511163856707, -2.4341956270199243]]&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/SaveCube.py&amp;diff=709921</id>
		<title>Mod:Hunt Research Group/SaveCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/SaveCube.py&amp;diff=709921"/>
		<updated>2018-05-10T16:23:56Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SaveCube.py&amp;lt;/code&amp;gt; is a collection of functions that save the data from cube files in convenient formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [https://pandas.pydata.org pandas]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
The saving functions can be run from the terminal window by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;python SaveCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==SaveAll==&lt;br /&gt;
This function writes the x, y, z coordinates and the values from a cube file to a new file (4 columns).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;outfile&amp;lt;/code&amp;gt; (string, default=None) = path for the output file (if None, the script used the input filename with the extension &amp;quot;.csv&amp;quot;&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* &amp;lt;b&amp;gt;very slow&amp;lt;/b&amp;gt; if run for all the points in a cube file&lt;br /&gt;
* the script predicts the size of the file (which is also an indication of the running time) and it allows the user to:&lt;br /&gt;
# Proceed&lt;br /&gt;
# Reduce the number of points then proceed&lt;br /&gt;
# Abort&lt;br /&gt;
* if the user selects option number 2, they will be asked to input an integer number n so that only every nth value is saved to the file. Afterwards, the scripts prints the new predicted size and allows the user to once again select between options 1, 2 and 3.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python SaveCube.py SaveAll test_emim_oac_esp.cube outfile=&#039;emim_oac_all.csv&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example will raise the follow message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Your file size will be 34MB. Options: 1. Proceed 2. Reduce the number of points then proceed 3. Abort. Pick an option [1/2/3]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user chooses to reduce the number of points (by typing in 2 then enter), a new message will be printed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Please input an integer number n so that only every n value is saved to the file:&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user inputs the number 100 (by typing 100 then enter), the new message will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Your file size will be 340KB. Options: 1. Proceed 2. Reduce the number of points then proceed 3. Abort. Pick an option [1/2/3]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user chooses to proceed (by typing in 1 then enter), the new &amp;lt;i&amp;gt;emim_oac_all.csv&amp;lt;/i&amp;gt; file should be:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       X coord/A       Y coord/A       Z coord/A            Value/V&lt;br /&gt;
       -6.342285       -6.155011       -3.804660        1.98280E-01&lt;br /&gt;
       -6.342285       -6.016080        2.169381        2.57662E-01&lt;br /&gt;
       -6.342285       -5.738218        0.224345        3.08147E-01&lt;br /&gt;
       -6.342285       -5.460355       -1.720692        2.99211E-01&lt;br /&gt;
       -6.342285       -5.182493       -3.665729        2.39004E-01&lt;br /&gt;
       ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SaveVdW==&lt;br /&gt;
This function writes the x, y, z coordinates and the values of all the points that lie on a surface defined by the van der Waals radii of the atoms to a new file (4 columns).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;outfile&amp;lt;/code&amp;gt; (string, default=None) = path for the output file (if None, the script used the input filename with the extension &amp;quot;.csv&amp;quot;&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* the script predicts the size of the file (which is also an indication of the running time) and it allows the user to:&lt;br /&gt;
# Proceed&lt;br /&gt;
# Reduce the number of points then proceed&lt;br /&gt;
# Abort&lt;br /&gt;
* if the user selects option number 2, they will be asked to input an integer number n so that only every nth value is saved to the file. Afterwards, the scripts prints the new predicted size and allows the user to once again select between options 1, 2 and 3.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python SaveCube.py SaveVdW test_emim_oac_esp.cube outfile=&#039;emim_oac_vdw_dens2.csv&#039; density=2&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example will raise the follow message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Your file size will be 18KB. Options: 1. Proceed 2. Reduce the number of points then proceed 3. Abort. Pick an option [1/2/3]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user chooses to proceed (by typing in 1 then enter), the new &amp;lt;i&amp;gt;emim_oac_vdw_dens2.csv&amp;lt;/i&amp;gt; file should be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       X coord/A       Y coord/A       Z coord/A            Value/V&lt;br /&gt;
       -4.952973       -0.875626        0.085413        1.88899E+00&lt;br /&gt;
       -4.952973       -0.875626        0.363276        1.98856E+00&lt;br /&gt;
       -4.952973       -0.875626        0.641138        1.90018E+00&lt;br /&gt;
       -4.952973       -0.597764       -0.192449        1.72317E+00&lt;br /&gt;
       -4.952973       -0.597764        0.085413        2.00726E+00&lt;br /&gt;
       ...&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/ReadCube.py&amp;diff=709919</id>
		<title>Mod:Hunt Research Group/ReadCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/ReadCube.py&amp;diff=709919"/>
		<updated>2018-05-10T16:23:47Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt; is a collection of functions that extract data from cube files and return it in convenient python formats. These are the main functions used by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py &amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt;], [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py &amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt;], [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py &amp;lt;code&amp;gt;SaveCube.py&amp;lt;/code&amp;gt;] and [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;].&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
If you want to use the functions in &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt; to extract data from cube files in Python, you will need to write a Python script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import ReadCube as rc&lt;br /&gt;
var1 = rc.function_name(arg1=val1, arg2=val2,...)&lt;br /&gt;
&amp;lt;do something with var1: print it, save it to file, etc.&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Python script can be written and ran in different ways:&lt;br /&gt;
* as a new .py file using Spyder (Spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; File &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; New file... &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; [write the file] &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Save As... [make sure you save the file in the same directory as &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;] &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Run &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Run [the file will be run in the iPython console]&lt;br /&gt;
* in the IPython console in Spyder: write the Python commands directly in the console, but make sure that the current working directory is the one containing &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;&lt;br /&gt;
* in the terminal window: type &amp;lt;code&amp;gt;ipython&amp;lt;/code&amp;gt;, then write the Python commands directly in the terminal, but make sure that the current working directory is the one containing &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import ReadCube as rc&lt;br /&gt;
at = rc.Atoms(fpath=&#039;test_emim_oac_esp.cube&#039;)&lt;br /&gt;
print([i[0] for i in at])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This example prints the atomic numbers of all the constituent atoms:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[7, 6, 1, 1, 1, 6, 1, 7, 6, 1, 1, 6, 1, 1, 1, 6, 6, 1, 1, 6, 8, 8, 6, 1, 1, 1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==ExtractData==&lt;br /&gt;
This function extracts all the data from the cube file.&lt;br /&gt;
&lt;br /&gt;
===Required parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
    &lt;br /&gt;
===Optional parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
  &lt;br /&gt;
===Returns===&lt;br /&gt;
a list of: the number of atoms, a list of the coordinates of the origin, the number of values recorded at each point, the number of voxels along x axis, a list of the coordinates of the increment vector for the x axis, the number of voxels along y axis, a list of the coordinates of the increment vector for the y axis, the number of voxels along z axis, a list of the coordinates of the increment vector for the z axis, a list of lists containing the atomic number, the nuclear charge and coordinates for each atom, a list of MO indices, a 3D array of all the values in the cube file, a list of all the values in the cube file, value units (in order)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Atoms==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = value type&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of a number of natoms lists, each list component containing the atomic number, nuclear charge and coordinates of each atom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Axes==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;origin&amp;lt;/code&amp;gt; (list, default=None) = a list of the x, y and z coordinates of the origin&lt;br /&gt;
* &amp;lt;code&amp;gt;n_x&amp;lt;/code&amp;gt; (integer, default=None) = number of voxels along x axis&lt;br /&gt;
* &amp;lt;code&amp;gt;x_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the x direction&lt;br /&gt;
* &amp;lt;code&amp;gt;n_y&amp;lt;/code&amp;gt; (integer, default=None) = number of voxels along y axis&lt;br /&gt;
* &amp;lt;code&amp;gt;y_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the y direction&lt;br /&gt;
* &amp;lt;code&amp;gt;n_z&amp;lt;/code&amp;gt; (integer, default=None) = number of voxels along z axis&lt;br /&gt;
* &amp;lt;code&amp;gt;z_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the z direction&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of three lists representing the x, y and z coordinates, respectively of the grid points&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;origin, n_x, x_vector, n_y, y_vector, n_z, z_vector&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==ValuesAsMatrix==&lt;br /&gt;
&lt;br /&gt;
===Parameters=== &lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a 3D array of all the values in the cube file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ValuesAsList==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of all the values in the cube file (in the order in which they appear)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ValuesAsDictionary==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;vals&amp;lt;/code&amp;gt; (list, default=None) = a list of all the values in the cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;axes_list&amp;lt;/code&amp;gt; (list, default=None) = a list of three lists representing the x, y and z coordinates, respectively of all the sampling points (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;origin&amp;lt;/code&amp;gt; (list, default=None) = a list of the x, y and z coordinates of the origin&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value and an ordered dictionary of each grid point (represented through a tuple of its indices) and its corresponding value&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;vals, axes_list, origin&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==Minimum==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;gridpts&amp;lt;/code&amp;gt; (dictionary, default=None) = an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value (the first element in the list generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;vals&amp;lt;/code&amp;gt; (list, default=None) = a list of all the values in the cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list the coordinates of all the grid points that have the minimum value&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;gridpts, vals&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==Maximum==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;gridpts&amp;lt;/code&amp;gt; (dictionary, default=None) = an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value (the first element in the list generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;vals&amp;lt;/code&amp;gt; (list, default=None) = a list of all the values in the cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Returns=== &lt;br /&gt;
a list the coordinates of all the grid points that have the maximum value&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;gridpts, vals&amp;lt;/code&amp;gt;   &lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==GetVdWPoints==&lt;br /&gt;
This function returns all the points that are close to the surface defined in terms of the Van der Waals radii of the constituent atoms.&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;axes_list&amp;lt;/code&amp;gt; (list, default=None) = a list of three lists representing the x, y and z coordinates, respectively of all the sampling points (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;gridpts&amp;lt;/code&amp;gt; (dictionary, default=None) = an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value (the first element in the list generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms_list&amp;lt;/code&amp;gt; (list, default=None) = a list of a number of natoms lists, each list component containing the atomic number, nuclear charge and coordinates of each atom (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Atoms &amp;lt;code&amp;gt;Atoms&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;x_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the x direction&lt;br /&gt;
* &amp;lt;code&amp;gt;y_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the y direction&lt;br /&gt;
* &amp;lt;code&amp;gt;z_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the z direction&lt;br /&gt;
* &amp;lt;code&amp;gt;origin&amp;lt;/code&amp;gt; (list, default=None) = a list of the x, y and z coordinates of the origin&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only selects the points that correspond to the cation (the condition for which atoms belong to the cation has to be changed manually inside the code)&lt;br /&gt;
* &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only selects the points that correspond to the anion (the condition for which atoms belong to the cation has to be changed manually inside the code; the atoms belonging to the anion are the remaining ones)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of three lists: the first one contains the x, y, z coordinates and the value of each point on the VdW surface, the second one contains the indices and the value of each point on the VdW surface and the third one contains the coordinates and values of all the points that are on or inside the VdW surface&lt;br /&gt;
 &lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units, factor&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;axes_list, gridpts, atoms_list, x_vector, y_vector, z_vector, origin, factor&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
* the points that reside on the VdW surface are chosen to be within plus/minus a fractional distance of the surface defined by the Van der Waals radii of the constituent atoms (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid)&lt;br /&gt;
* if you want to only select certain points from the van der Waals surface, you can change this manually inside the code; this also applies for only selecting points which belong to either the cation or the anion (for which there are the parameters &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt;, respectively)&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=709915</id>
		<title>Mod:Hunt Research Group/Python scripts for cube files</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=709915"/>
		<updated>2018-05-10T16:23:13Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;The latest version of &amp;lt;code&amp;gt;CubePy&amp;lt;/code&amp;gt;, along with a test cube file can be found [[:Media:OxanaAndriuc_23Apr_2018_Code.zip|here]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;CubePy is under [https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode CC BY-NC-SA license]&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CubePy encompasses six modules that can be used to read, save, manipulate and visualise data from cube files:&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py ReadCube.py] - used to extract data from cube files and return it in convenient python formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py] - used to save data from cube files in convenient formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py CalculateCube.py] - used to manipulate data from cube files&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] - used to plot data from cube files (using [https://matplotlib.org Matplotlib])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] - used to plot data from cube files (using [http://docs.enthought.com/mayavi/mayavi/ Mayavi])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] - used to manipulate data &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; from cube files, but from files produced by the scripts above&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to save data from cube files&amp;lt;/b&amp;gt;&lt;br /&gt;
* for saving the values from the cube files, use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py]&lt;br /&gt;
* for saving histogram data, use the function &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] with &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;br /&gt;
* for saving a short summary file of the minimum, maximum and lowest curvature points on the van der Waals surface, use &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt; when running &amp;lt;code&amp;gt;PlotSurface&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot surfaces, isosurfaces, slices&amp;lt;/b&amp;gt;&lt;br /&gt;
* use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]. They are faster and better at 3D plotting than the equivalent functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]&lt;br /&gt;
&lt;br /&gt;
If you want to generate static figures you can also consider using the 3D plotting functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]. These are especially recommended when wanting to display atoms as they look better than their [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] equivalents. However, keep in mind that Matplotlib sometimes fails at 3D rendering, which generates &amp;quot;incorrect&amp;quot; plots (i.e. elements that should be behind the rest of the plot appear at the front). Therefore, plots created using function from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] should be double-checked (by comparing them with plots from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py], by example).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot histograms and KDEs&amp;lt;/b&amp;gt;&lt;br /&gt;
* use &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] to plot a histogram and/or KDE directly from cube files&lt;br /&gt;
* use &amp;lt;code&amp;gt;OverlapKDEs&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] to plot histograms and KDEs from files written by &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] when &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=709635</id>
		<title>Mod:Hunt Research Group/PlotCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=709635"/>
		<updated>2018-05-10T15:43:01Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Optional arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files. &lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
* NumPy&lt;br /&gt;
* scipy&lt;br /&gt;
* [https://gist.github.com/jdiscar/9144764 gistfile1]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotMesh==&lt;br /&gt;
This function creates an interactive plot of the cube file values.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the x values (by default all the x values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the y values (by default all the y values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;zlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the z values (by default all the z values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=0.1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=0.05) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;lower_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the lower limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;upper_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider for the minima and maxima (i.e. ±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:Fig1.png|400px|right|thumb|Figure 1. Plot generated by PlotMesh]]&lt;br /&gt;
* lower cutoff value&lt;br /&gt;
* upper cutoff value&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* SLOW&lt;br /&gt;
* ONLY WORKS FOR ORTHONORMAL GRIDS&lt;br /&gt;
* If you click on a point, it will be highlighted and its value will be displayed in the upper right corner.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotMesh test_emim_oac_esp.cube colour=&#039;plasma&#039; axes=True&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
* &amp;lt;code&amp;gt;grey_surf&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a grey surface just below the van der Waals surface&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig2.png|400px|right|thumb|Figure 2. Plot generated by PlotSurface]]&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSurface test_emim_oac_esp.cube bkg=[0.2,0.2,0.3] &amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot, shown after changing the alpha and zoom values using the slider, is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig3.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* value&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotIsosurface test_emim_oac_esp.cube iso=0.01 iso_range=0.02&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot after rotation is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig4.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSlice test_emim_oac_esp.cube colour=&#039;plasma&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;bins&amp;lt;/code&amp;gt; (integer/None/string, default=30) = the number of bins in the histogram (see [https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.histogram.html here] for details)&lt;br /&gt;
* &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots the histogram; if False, it does not plot the histogram (only the KDE)&lt;br /&gt;
* &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots a gaussian kernel density estimate (KDE = a way to estimate the probability density function of a variable); if False, it does not plot the KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_freq&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a histogram with normalised frequency (without KDE, because the KDE has a normalised area, not normalised bin heights)&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it normalises the histogram (i.e. integral=1) - this happens by default for plots including KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 5. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=True) = if True: if &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_hist.out is created, containing the bin edges values and the frequency for each bin as shown in the histogram; if &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_kde.out is created, containing the range of values used for plotting the KDE and the corresponding KDE value. The file ends with two separate sections: peak values and minimum values&lt;br /&gt;
* &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only plots the histogram and/or KDE for the points that correspond to the cation (the condition for which atoms belong to the cation has to be changed manually inside [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only plots the histogram and/or KDE for the points that correspond to the anion (the condition for which atoms belong to the cation has to be changed manually inside [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;]; the atoms belonging to the anion are the remaining ones)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotHistogram test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 5.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709634</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709634"/>
		<updated>2018-05-10T15:42:59Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Optional arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider when selecting the points (i.e. iso±0.05 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. iso±0.01 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709595</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709595"/>
		<updated>2018-05-10T15:37:54Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Calls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider when selecting the points (i.e. iso±0.05 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. iso±0.01 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709575</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709575"/>
		<updated>2018-05-10T15:36:24Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Calls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider when selecting the points (i.e. iso±0.05 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. iso±0.01 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709562</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709562"/>
		<updated>2018-05-10T15:34:43Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Optional arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider when selecting the points (i.e. iso±0.05 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. iso±0.01 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709496</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709496"/>
		<updated>2018-05-10T15:28:01Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Optional arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider when selecting the points (i.e. iso±0.05 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = &lt;br /&gt;
[[File:ia2514_fig7.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709491</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709491"/>
		<updated>2018-05-10T15:27:03Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Calls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
*iso (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
*iso_range (float, default=0.05) = the value range to consider when selecting the points (i.e. iso±0.05 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = &lt;br /&gt;
[[File:ia2514_fig7.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709466</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709466"/>
		<updated>2018-05-10T15:23:47Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Optional arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
*iso (float, default=None) = the value of the points to be plotted in colour&lt;br /&gt;
*iso_range (float, default=0.05) = the value range to consider when selecting the points (i.e. iso±0.05 by default)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = &lt;br /&gt;
[[File:ia2514_fig7.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709423</id>
		<title>Mod:Hunt Research Group/PlotCube mayavi.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py&amp;diff=709423"/>
		<updated>2018-05-10T15:18:17Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Optional arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files.&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [http://docs.enthought.com/mayavi/mayavi/ mayavi]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain mayavi is by installing [https://www.enthought.com/product/canopy/ Canopy].&lt;br /&gt;
&lt;br /&gt;
Open Canopy &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Tools &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Canopy Terminal&lt;br /&gt;
&lt;br /&gt;
Using the Canopy Terminal allows the user to use the Canopy Python without making it the default one.&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the Canopy terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interacting with the plot==&lt;br /&gt;
Once the Mayavi Scene window is open, you can change plot settings by clicking on &#039;View the Mayavi pipeline&#039;. This will open a new window where you will be able to see and modify the different layers of the plot. &lt;br /&gt;
&lt;br /&gt;
===Changing the colour scheme===&lt;br /&gt;
Find the desired layer within the list, click on Colors and legends &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Scalar LUT &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Out mode&lt;br /&gt;
&lt;br /&gt;
===Changing the transparency===&lt;br /&gt;
Click on the desired element in the list &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Actor &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Opacity&lt;br /&gt;
&lt;br /&gt;
===Showing/Hiding an element===&lt;br /&gt;
This can be done either by changing the opacity or by right-clicking on the desired element &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Hide/Show&lt;br /&gt;
&lt;br /&gt;
===Displaying the value of a point===&lt;br /&gt;
Double click on the desired point; it will be highlighted and its value will be displayed in the upper right corner&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates a plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
[[File:ia2514_fig6.png|400px|right|thumb|Figure 1. Plot generated by PlotSurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSurface test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsoVdW==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid). The points within &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±&amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; in their corresponding colours and the others in grey.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.01) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = &lt;br /&gt;
* &amp;lt;code&amp;gt;grey_surf&amp;lt;/code&amp;gt; (boolean, default=False) = &lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
[[File:ia2514_fig8.png|400px|right|thumb|Figure 2. Plot generated by PlotIsoVdW]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotIsoVdW test_emim_oac_esp.cube iso=1.1 iso_range=0.5&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = &lt;br /&gt;
[[File:ia2514_fig7.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* Iso slider&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube_mayavi.py PlotIsosurface NH3CH2Cl_esp.cube colour=&#039;plasma&#039; minmax=True iso=0.2&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
[[File:ia2514_fig9.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube_mayavi.py PlotSlice test_emim_oac_esp.cube a=0.2 b=0.3 c=0.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=696429</id>
		<title>Mod:Hunt Research Group/Python scripts for cube files</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/Python_scripts_for_cube_files&amp;diff=696429"/>
		<updated>2018-04-30T15:17:35Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The latest version of the Python scripts, along with a test cube file can be found [[:Media:OxanaAndriuc_23Apr_2018_Code.zip|here]].&lt;br /&gt;
&lt;br /&gt;
The following scripts can be used to read, save, manipulate and visualise data from cube files:&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py ReadCube.py] - used to extract data from cube files and return it in convenient python formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py] - used to save data from cube files in convenient formats&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py CalculateCube.py] - used to manipulate data from cube files&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] - used to plot data from cube files (using [https://matplotlib.org Matplotlib])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] - used to plot data from cube files (using [http://docs.enthought.com/mayavi/mayavi/ Mayavi])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] - used to manipulate data &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; from cube files, but from files produced by the scripts above&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to save data from cube files&amp;lt;/b&amp;gt;&lt;br /&gt;
* for saving the values from the cube files, use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py SaveCube.py]&lt;br /&gt;
* for saving histogram data, use the function &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] with &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;br /&gt;
* for saving a short summary file of the minimum, maximum and lowest curvature points on the van der Waals surface, use &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt; when running &amp;lt;code&amp;gt;PlotSurface&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot surfaces, isosurfaces, slices&amp;lt;/b&amp;gt;&lt;br /&gt;
* use the functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py]. They are faster and better at 3D plotting than the equivalent functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]&lt;br /&gt;
&lt;br /&gt;
If you want to generate static figures you can also consider using the 3D plotting functions from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py]. These are especially recommended when wanting to display atoms as they look better than their [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py] equivalents. However, keep in mind that Matplotlib sometimes fails at 3D rendering, which generates &amp;quot;incorrect&amp;quot; plots (i.e. elements that should be behind the rest of the plot appear at the front). Therefore, plots created using function from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] should be double-checked (by comparing them with plots from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py PlotCube_mayavi.py], by example).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;If you want to plot histograms and KDEs&amp;lt;/b&amp;gt;&lt;br /&gt;
* use &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] to plot a histogram and/or KDE directly from cube files&lt;br /&gt;
* use &amp;lt;code&amp;gt;OverlapKDEs&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/AdditionalFunctions.py AdditionalFunctions.py] to plot histograms and KDEs from files written by &amp;lt;code&amp;gt;PlotHistogram&amp;lt;/code&amp;gt; from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py PlotCube.py] when &amp;lt;code&amp;gt;save=True&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/SaveCube.py&amp;diff=696424</id>
		<title>Mod:Hunt Research Group/SaveCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/SaveCube.py&amp;diff=696424"/>
		<updated>2018-04-28T12:10:17Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;SaveCube.py&amp;lt;/code&amp;gt; is a collection of functions that save the data from cube files in convenient formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [https://pandas.pydata.org pandas]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
The saving functions can be run from the terminal window by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;python SaveCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==SaveAll==&lt;br /&gt;
This function writes the x, y, z coordinates and the values from a cube file to a new file (4 columns).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;outfile&amp;lt;/code&amp;gt; (string, default=None) = path for the output file (if None, the script used the input filename with the extension &amp;quot;.csv&amp;quot;&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* &amp;lt;b&amp;gt;very slow&amp;lt;/b&amp;gt; if run for all the points in a cube file&lt;br /&gt;
* the script predicts the size of the file (which is also an indication of the running time) and it allows the user to:&lt;br /&gt;
# Proceed&lt;br /&gt;
# Reduce the number of points then proceed&lt;br /&gt;
# Abort&lt;br /&gt;
* if the user selects option number 2, they will be asked to input an integer number n so that only every nth value is saved to the file. Afterwards, the scripts prints the new predicted size and allows the user to once again select between options 1, 2 and 3.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python SaveCube.py SaveAll test_emim_oac_esp.cube outfile=&#039;emim_oac_all.csv&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example will raise the follow message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Your file size will be 34MB. Options: 1. Proceed 2. Reduce the number of points then proceed 3. Abort. Pick an option [1/2/3]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user chooses to reduce the number of points (by typing in 2 then enter), a new message will be printed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Please input an integer number n so that only every n value is saved to the file:&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user inputs the number 100 (by typing 100 then enter), the new message will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Your file size will be 340KB. Options: 1. Proceed 2. Reduce the number of points then proceed 3. Abort. Pick an option [1/2/3]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user chooses to proceed (by typing in 1 then enter), the new &amp;lt;i&amp;gt;emim_oac_all.csv&amp;lt;/i&amp;gt; file should be:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       X coord/A       Y coord/A       Z coord/A            Value/V&lt;br /&gt;
       -6.342285       -6.155011       -3.804660        1.98280E-01&lt;br /&gt;
       -6.342285       -6.016080        2.169381        2.57662E-01&lt;br /&gt;
       -6.342285       -5.738218        0.224345        3.08147E-01&lt;br /&gt;
       -6.342285       -5.460355       -1.720692        2.99211E-01&lt;br /&gt;
       -6.342285       -5.182493       -3.665729        2.39004E-01&lt;br /&gt;
       ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SaveVdW==&lt;br /&gt;
This function writes the x, y, z coordinates and the values of all the points that lie on a surface defined by the van der Waals radii of the atoms to a new file (4 columns).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;outfile&amp;lt;/code&amp;gt; (string, default=None) = path for the output file (if None, the script used the input filename with the extension &amp;quot;.csv&amp;quot;&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* the script predicts the size of the file (which is also an indication of the running time) and it allows the user to:&lt;br /&gt;
# Proceed&lt;br /&gt;
# Reduce the number of points then proceed&lt;br /&gt;
# Abort&lt;br /&gt;
* if the user selects option number 2, they will be asked to input an integer number n so that only every nth value is saved to the file. Afterwards, the scripts prints the new predicted size and allows the user to once again select between options 1, 2 and 3.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python SaveCube.py SaveVdW test_emim_oac_esp.cube outfile=&#039;emim_oac_vdw_dens2.csv&#039; density=2&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example will raise the follow message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Your file size will be 18KB. Options: 1. Proceed 2. Reduce the number of points then proceed 3. Abort. Pick an option [1/2/3]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user chooses to proceed (by typing in 1 then enter), the new &amp;lt;i&amp;gt;emim_oac_vdw_dens2.csv&amp;lt;/i&amp;gt; file should be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       X coord/A       Y coord/A       Z coord/A            Value/V&lt;br /&gt;
       -4.952973       -0.875626        0.085413        1.88899E+00&lt;br /&gt;
       -4.952973       -0.875626        0.363276        1.98856E+00&lt;br /&gt;
       -4.952973       -0.875626        0.641138        1.90018E+00&lt;br /&gt;
       -4.952973       -0.597764       -0.192449        1.72317E+00&lt;br /&gt;
       -4.952973       -0.597764        0.085413        2.00726E+00&lt;br /&gt;
       ...&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/SaveCube.py&amp;diff=696423</id>
		<title>Mod:Hunt Research Group/SaveCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/SaveCube.py&amp;diff=696423"/>
		<updated>2018-04-28T12:06:43Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;SaveCube.py&amp;lt;/code&amp;gt; is a collection of functions that save the data from cube files in convenient formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* [https://pandas.pydata.org pandas]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
The saving functions can be run from the terminal window by typing:&lt;br /&gt;
&amp;lt;pre&amp;gt;python SaveCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==SaveAll==&lt;br /&gt;
This function writes the x, y, z coordinates and the values from a cube file to a new file (4 columns).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;outfile&amp;lt;/code&amp;gt; (string, default=None) = path for the output file (if None, the script used the input filename with the extension &amp;quot;.csv&amp;quot;&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* &amp;lt;b&amp;gt;very slow&amp;lt;/b&amp;gt; if run for all the points in a cube file&lt;br /&gt;
* the script predicts the size of the file (which is also an indication of the running time) and it allows the user to:&lt;br /&gt;
# Proceed&lt;br /&gt;
# Reduce the density of points then proceed&lt;br /&gt;
# Abort&lt;br /&gt;
* if the user selects option number 2, they will be asked to input an integer number n so that only every nth value is saved to the file. Afterwards, the scripts prints the new predicted size and allows the user to once again select between options 1, 2 and 3.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python SaveCube.py SaveAll test_emim_oac_esp.cube outfile=&#039;emim_oac_all.csv&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example will raise the follow message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Your file size will be 34MB. Options: 1. Proceed 2. Reduce the density of points then proceed 3. Abort. Pick an option [1/2/3]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user chooses to reduce the density of points (by typing in 2 then enter), a new message will be printed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Please input an integer number n so that only every n value is saved to the file:&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This density value is &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; equivalent to the &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; argument of the function. This density &amp;lt;i&amp;gt;m&amp;lt;/i&amp;gt; reduces the total number of points by &amp;lt;i&amp;gt;m&amp;lt;/i&amp;gt; (cf. the &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; parameter which for a value of &amp;lt;i&amp;gt;n&amp;lt;/i&amp;gt;, reduces the number of data points by &amp;lt;i&amp;gt;n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;lt;/i&amp;gt;). If the user selects the new density of 100 (by typing 100 then enter), the new message will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Your file size will be 340KB. Options: 1. Proceed 2. Reduce the density of points then proceed 3. Abort. Pick an option [1/2/3]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user chooses to proceed (by typing in 1 then enter), the new &amp;lt;i&amp;gt;emim_oac_all.csv&amp;lt;/i&amp;gt; file should be:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       X coord/A       Y coord/A       Z coord/A            Value/V&lt;br /&gt;
       -6.342285       -6.155011       -3.804660        1.98280E-01&lt;br /&gt;
       -6.342285       -6.016080        2.169381        2.57662E-01&lt;br /&gt;
       -6.342285       -5.738218        0.224345        3.08147E-01&lt;br /&gt;
       -6.342285       -5.460355       -1.720692        2.99211E-01&lt;br /&gt;
       -6.342285       -5.182493       -3.665729        2.39004E-01&lt;br /&gt;
       ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SaveVdW==&lt;br /&gt;
This function writes the x, y, z coordinates and the values of all the points that lie on a surface defined by the van der Waals radii of the atoms to a new file (4 columns).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;outfile&amp;lt;/code&amp;gt; (string, default=None) = path for the output file (if None, the script used the input filename with the extension &amp;quot;.csv&amp;quot;&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* the script predicts the size of the file (which is also an indication of the running time) and it allows the user to:&lt;br /&gt;
# Proceed&lt;br /&gt;
# Reduce the density of points then proceed&lt;br /&gt;
# Abort&lt;br /&gt;
* if the user selects option number 2, they will be asked to input an integer number n so that only every nth value is saved to the file. Afterwards, the scripts prints the new predicted size and allows the user to once again select between options 1, 2 and 3.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python SaveCube.py SaveVdW test_emim_oac_esp.cube outfile=&#039;emim_oac_vdw_dens2.csv&#039; density=2&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example will raise the follow message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Your file size will be 18KB. Options: 1. Proceed 2. Reduce the density of points then proceed 3. Abort. Pick an option [1/2/3]:&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user chooses to proceed (by typing in 1 then enter), the new &amp;lt;i&amp;gt;emim_oac_vdw_dens2.csv&amp;lt;/i&amp;gt; file should be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;       X coord/A       Y coord/A       Z coord/A            Value/V&lt;br /&gt;
       -4.952973       -0.875626        0.085413        1.88899E+00&lt;br /&gt;
       -4.952973       -0.875626        0.363276        1.98856E+00&lt;br /&gt;
       -4.952973       -0.875626        0.641138        1.90018E+00&lt;br /&gt;
       -4.952973       -0.597764       -0.192449        1.72317E+00&lt;br /&gt;
       -4.952973       -0.597764        0.085413        2.00726E+00&lt;br /&gt;
       ...&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/ReadCube.py&amp;diff=696422</id>
		<title>Mod:Hunt Research Group/ReadCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/ReadCube.py&amp;diff=696422"/>
		<updated>2018-04-27T16:46:59Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Axes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt; is a collection of functions that extract data from cube files and return it in convenient python formats. These are the main functions used by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py &amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt;], [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py &amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt;], [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py &amp;lt;code&amp;gt;SaveCube.py&amp;lt;/code&amp;gt;] and [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;].&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
If you want to use the functions in &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt; to extract data from cube files in Python, you will need to write a Python script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import ReadCube as rc&lt;br /&gt;
var1 = rc.function_name(arg1=val1, arg2=val2,...)&lt;br /&gt;
&amp;lt;do something with var1: print it, save it to file, etc.&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Python script can be written and ran in different ways:&lt;br /&gt;
* as a new .py file using Spyder (Spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; File &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; New file... &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; [write the file] &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Save As... [make sure you save the file in the same directory as &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;] &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Run &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Run [the file will be run in the iPython console]&lt;br /&gt;
* in the IPython console in Spyder: write the Python commands directly in the console, but make sure that the current working directory is the one containing &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;&lt;br /&gt;
* in the terminal window: type &amp;lt;code&amp;gt;ipython&amp;lt;/code&amp;gt;, then write the Python commands directly in the terminal, but make sure that the current working directory is the one containing &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import ReadCube as rc&lt;br /&gt;
at = rc.Atoms(fpath=&#039;test_emim_oac_esp.cube&#039;)&lt;br /&gt;
print([i[0] for i in at])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This example prints the atomic numbers of all the constituent atoms:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[7, 6, 1, 1, 1, 6, 1, 7, 6, 1, 1, 6, 1, 1, 1, 6, 6, 1, 1, 6, 8, 8, 6, 1, 1, 1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==ExtractData==&lt;br /&gt;
This function extracts all the data from the cube file.&lt;br /&gt;
&lt;br /&gt;
===Required parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
    &lt;br /&gt;
===Optional parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
  &lt;br /&gt;
===Returns===&lt;br /&gt;
a list of: the number of atoms, a list of the coordinates of the origin, the number of values recorded at each point, the number of voxels along x axis, a list of the coordinates of the increment vector for the x axis, the number of voxels along y axis, a list of the coordinates of the increment vector for the y axis, the number of voxels along z axis, a list of the coordinates of the increment vector for the z axis, a list of lists containing the atomic number, the nuclear charge and coordinates for each atom, a list of MO indices, a 3D array of all the values in the cube file, a list of all the values in the cube file, value units (in order)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Atoms==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = value type&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of a number of natoms lists, each list component containing the atomic number, nuclear charge and coordinates of each atom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Axes==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;origin&amp;lt;/code&amp;gt; (list, default=None) = a list of the x, y and z coordinates of the origin&lt;br /&gt;
* &amp;lt;code&amp;gt;n_x&amp;lt;/code&amp;gt; (integer, default=None) = number of voxels along x axis&lt;br /&gt;
* &amp;lt;code&amp;gt;x_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the x direction&lt;br /&gt;
* &amp;lt;code&amp;gt;n_y&amp;lt;/code&amp;gt; (integer, default=None) = number of voxels along y axis&lt;br /&gt;
* &amp;lt;code&amp;gt;y_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the y direction&lt;br /&gt;
* &amp;lt;code&amp;gt;n_z&amp;lt;/code&amp;gt; (integer, default=None) = number of voxels along z axis&lt;br /&gt;
* &amp;lt;code&amp;gt;z_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the z direction&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of three lists representing the x, y and z coordinates, respectively of the grid points&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;origin, n_x, x_vector, n_y, y_vector, n_z, z_vector&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==ValuesAsMatrix==&lt;br /&gt;
&lt;br /&gt;
===Parameters=== &lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a 3D array of all the values in the cube file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ValuesAsList==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of all the values in the cube file (in the order in which they appear)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ValuesAsDictionary==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;vals&amp;lt;/code&amp;gt; (list, default=None) = a list of all the values in the cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;axes_list&amp;lt;/code&amp;gt; (list, default=None) = a list of three lists representing the x, y and z coordinates, respectively of all the sampling points (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;origin&amp;lt;/code&amp;gt; (list, default=None) = a list of the x, y and z coordinates of the origin&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value and an ordered dictionary of each grid point (represented through a tuple of its indices) and its corresponding value&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;vals, axes_list, origin&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==Minimum==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;gridpts&amp;lt;/code&amp;gt; (dictionary, default=None) = an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value (the first element in the list generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;vals&amp;lt;/code&amp;gt; (list, default=None) = a list of all the values in the cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list the coordinates of all the grid points that have the minimum value&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;gridpts, vals&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==Maximum==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;gridpts&amp;lt;/code&amp;gt; (dictionary, default=None) = an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value (the first element in the list generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;vals&amp;lt;/code&amp;gt; (list, default=None) = a list of all the values in the cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Returns=== &lt;br /&gt;
a list the coordinates of all the grid points that have the maximum value&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;gridpts, vals&amp;lt;/code&amp;gt;   &lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==GetVdWPoints==&lt;br /&gt;
This function returns all the points that are close to the surface defined in terms of the Van der Waals radii of the constituent atoms.&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;axes_list&amp;lt;/code&amp;gt; (list, default=None) = a list of three lists representing the x, y and z coordinates, respectively of all the sampling points (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;gridpts&amp;lt;/code&amp;gt; (dictionary, default=None) = an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value (the first element in the list generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms_list&amp;lt;/code&amp;gt; (list, default=None) = a list of a number of natoms lists, each list component containing the atomic number, nuclear charge and coordinates of each atom (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Atoms &amp;lt;code&amp;gt;Atoms&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;x_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the x direction&lt;br /&gt;
* &amp;lt;code&amp;gt;y_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the y direction&lt;br /&gt;
* &amp;lt;code&amp;gt;z_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the z direction&lt;br /&gt;
* &amp;lt;code&amp;gt;origin&amp;lt;/code&amp;gt; (list, default=None) = a list of the x, y and z coordinates of the origin&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only selects the points that correspond to the cation (the condition for which atoms belong to the cation has to be changed manually inside the code)&lt;br /&gt;
* &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only selects the points that correspond to the anion (the condition for which atoms belong to the cation has to be changed manually inside the code; the atoms belonging to the anion are the remaining ones)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of three lists: the first one contains the x, y, z coordinates and the value of each point on the VdW surface, the second one contains the indices and the value of each point on the VdW surface and the third one contains the coordinates and values of all the points that are on or inside the VdW surface&lt;br /&gt;
 &lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units, factor&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;axes_list, gridpts, atoms_list, x_vector, y_vector, z_vector, origin, factor&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
* the points that reside on the VdW surface are chosen to be within plus/minus a fractional distance of the surface defined by the Van der Waals radii of the constituent atoms (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid)&lt;br /&gt;
* if you want to only select certain points from the van der Waals surface, you can change this manually inside the code; this also applies for only selecting points which belong to either the cation or the anion (for which there are the parameters &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt;, respectively)&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/ReadCube.py&amp;diff=696421</id>
		<title>Mod:Hunt Research Group/ReadCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/ReadCube.py&amp;diff=696421"/>
		<updated>2018-04-27T16:46:09Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Axes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt; is a collection of functions that extract data from cube files and return it in convenient python formats. These are the main functions used by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube.py &amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt;], [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/PlotCube_mayavi.py &amp;lt;code&amp;gt;PlotCube_mayavi.py&amp;lt;/code&amp;gt;], [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/SaveCube.py &amp;lt;code&amp;gt;SaveCube.py&amp;lt;/code&amp;gt;] and [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;].&lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
If you want to use the functions in &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt; to extract data from cube files in Python, you will need to write a Python script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import ReadCube as rc&lt;br /&gt;
var1 = rc.function_name(arg1=val1, arg2=val2,...)&lt;br /&gt;
&amp;lt;do something with var1: print it, save it to file, etc.&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Python script can be written and ran in different ways:&lt;br /&gt;
* as a new .py file using Spyder (Spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; File &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; New file... &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; [write the file] &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Save As... [make sure you save the file in the same directory as &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;] &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Run &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Run [the file will be run in the iPython console]&lt;br /&gt;
* in the IPython console in Spyder: write the Python commands directly in the console, but make sure that the current working directory is the one containing &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;&lt;br /&gt;
* in the terminal window: type &amp;lt;code&amp;gt;ipython&amp;lt;/code&amp;gt;, then write the Python commands directly in the terminal, but make sure that the current working directory is the one containing &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import ReadCube as rc&lt;br /&gt;
at = rc.Atoms(fpath=&#039;test_emim_oac_esp.cube&#039;)&lt;br /&gt;
print([i[0] for i in at])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This example prints the atomic numbers of all the constituent atoms:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[7, 6, 1, 1, 1, 6, 1, 7, 6, 1, 1, 6, 1, 1, 1, 6, 6, 1, 1, 6, 8, 8, 6, 1, 1, 1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==ExtractData==&lt;br /&gt;
This function extracts all the data from the cube file.&lt;br /&gt;
&lt;br /&gt;
===Required parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
    &lt;br /&gt;
===Optional parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
  &lt;br /&gt;
===Returns===&lt;br /&gt;
a list of: the number of atoms, a list of the coordinates of the origin, the number of values recorded at each point, the number of voxels along x axis, a list of the coordinates of the increment vector for the x axis, the number of voxels along y axis, a list of the coordinates of the increment vector for the y axis, the number of voxels along z axis, a list of the coordinates of the increment vector for the z axis, a list of lists containing the atomic number, the nuclear charge and coordinates for each atom, a list of MO indices, a 3D array of all the values in the cube file, a list of all the values in the cube file, value units (in order)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Atoms==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = value type&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of a number of natoms lists, each list component containing the atomic number, nuclear charge and coordinates of each atom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Axes==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;origin&amp;lt;/code&amp;gt; (list, default=None) = a list of the x, y and z coordinates of the origin&lt;br /&gt;
* &amp;lt;code&amp;gt;n_x&amp;lt;/code&amp;gt; (integer, default=None) = number of voxels along x axis&lt;br /&gt;
* &amp;lt;code&amp;gt;x_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the x direction&lt;br /&gt;
* &amp;lt;code&amp;gt;n_y&amp;lt;/code&amp;gt; (integer, default=None) = number of voxels along y axis&lt;br /&gt;
* &amp;lt;code&amp;gt;y_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the y direction&lt;br /&gt;
* &amp;lt;code&amp;gt;n_z&amp;lt;/code&amp;gt; (integer, default=None) = number of voxels along z axis&lt;br /&gt;
* &amp;lt;code&amp;gt;z_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the z direction&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of three lists representing the x, y and z coordinates, respectively of all the grid points&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;origin, n_x, x_vector, n_y, y_vector, n_z, z_vector&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==ValuesAsMatrix==&lt;br /&gt;
&lt;br /&gt;
===Parameters=== &lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a 3D array of all the values in the cube file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ValuesAsList==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of all the values in the cube file (in the order in which they appear)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ValuesAsDictionary==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;vals&amp;lt;/code&amp;gt; (list, default=None) = a list of all the values in the cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;axes_list&amp;lt;/code&amp;gt; (list, default=None) = a list of three lists representing the x, y and z coordinates, respectively of all the sampling points (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;origin&amp;lt;/code&amp;gt; (list, default=None) = a list of the x, y and z coordinates of the origin&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
*  [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value and an ordered dictionary of each grid point (represented through a tuple of its indices) and its corresponding value&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;vals, axes_list, origin&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==Minimum==&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;gridpts&amp;lt;/code&amp;gt; (dictionary, default=None) = an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value (the first element in the list generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;vals&amp;lt;/code&amp;gt; (list, default=None) = a list of all the values in the cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list the coordinates of all the grid points that have the minimum value&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;gridpts, vals&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==Maximum==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;gridpts&amp;lt;/code&amp;gt; (dictionary, default=None) = an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value (the first element in the list generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;vals&amp;lt;/code&amp;gt; (list, default=None) = a list of all the values in the cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Returns=== &lt;br /&gt;
a list the coordinates of all the grid points that have the maximum value&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;gridpts, vals&amp;lt;/code&amp;gt;   &lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
&lt;br /&gt;
==GetVdWPoints==&lt;br /&gt;
This function returns all the points that are close to the surface defined in terms of the Van der Waals radii of the constituent atoms.&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string, default=None) = path for a cube file&lt;br /&gt;
* &amp;lt;code&amp;gt;axes_list&amp;lt;/code&amp;gt; (list, default=None) = a list of three lists representing the x, y and z coordinates, respectively of all the sampling points (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;gridpts&amp;lt;/code&amp;gt; (dictionary, default=None) = an ordered dictionary of each grid point (represented through a tuple of its coordinates) and its corresponding value (the first element in the list generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms_list&amp;lt;/code&amp;gt; (list, default=None) = a list of a number of natoms lists, each list component containing the atomic number, nuclear charge and coordinates of each atom (as generated by [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Atoms &amp;lt;code&amp;gt;Atoms&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;x_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the x direction&lt;br /&gt;
* &amp;lt;code&amp;gt;y_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the y direction&lt;br /&gt;
* &amp;lt;code&amp;gt;z_vector&amp;lt;/code&amp;gt; (list, default=None) = increment vector in the z direction&lt;br /&gt;
* &amp;lt;code&amp;gt;origin&amp;lt;/code&amp;gt; (list, default=None) = a list of the x, y and z coordinates of the origin&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only selects the points that correspond to the cation (the condition for which atoms belong to the cation has to be changed manually inside the code)&lt;br /&gt;
* &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only selects the points that correspond to the anion (the condition for which atoms belong to the cation has to be changed manually inside the code; the atoms belonging to the anion are the remaining ones)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (if &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; is specified)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
a list of three lists: the first one contains the x, y, z coordinates and the value of each point on the VdW surface, the second one contains the indices and the value of each point on the VdW surface and the third one contains the coordinates and values of all the points that are on or inside the VdW surface&lt;br /&gt;
 &lt;br /&gt;
===Observations===&lt;br /&gt;
* called with either &amp;lt;code&amp;gt;fpath, au, density, value_type, units, factor&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;axes_list, gridpts, atoms_list, x_vector, y_vector, z_vector, origin, factor&amp;lt;/code&amp;gt;&lt;br /&gt;
* if specified, &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; takes priority over the other arguments and [[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;]] is called (i.e. the script reads and goes through the whole cube file).&lt;br /&gt;
* the points that reside on the VdW surface are chosen to be within plus/minus a fractional distance of the surface defined by the Van der Waals radii of the constituent atoms (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid)&lt;br /&gt;
* if you want to only select certain points from the van der Waals surface, you can change this manually inside the code; this also applies for only selecting points which belong to either the cation or the anion (for which there are the parameters &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt;, respectively)&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=696420</id>
		<title>Mod:Hunt Research Group/PlotCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=696420"/>
		<updated>2018-04-26T18:59:15Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* PlotHistogram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files. &lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
* NumPy&lt;br /&gt;
* scipy&lt;br /&gt;
* [https://gist.github.com/jdiscar/9144764 gistfile1]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotMesh==&lt;br /&gt;
This function creates an interactive plot of the cube file values.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the x values (by default all the x values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the y values (by default all the y values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;zlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the z values (by default all the z values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=0.1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=0.05) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;lower_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the lower limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;upper_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider for the minima and maxima (i.e. ±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:Fig1.png|400px|right|thumb|Figure 1. Plot generated by PlotMesh]]&lt;br /&gt;
* lower cutoff value&lt;br /&gt;
* upper cutoff value&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* SLOW&lt;br /&gt;
* ONLY WORKS FOR ORTHONORMAL GRIDS&lt;br /&gt;
* If you click on a point, it will be highlighted and its value will be displayed in the upper right corner.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotMesh test_emim_oac_esp.cube colour=&#039;plasma&#039; axes=True&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
* &amp;lt;code&amp;gt;grey_surf&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a grey surface just below the van der Waals surface&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig2.png|400px|right|thumb|Figure 2. Plot generated by PlotSurface]]&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSurface test_emim_oac_esp.cube bkg=[0.2,0.2,0.3] &amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot, shown after changing the alpha and zoom values using the slider, is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig3.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* value&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotIsosurface test_emim_oac_esp.cube iso=0.01 iso_range=0.02&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot after rotation is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig4.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSlice test_emim_oac_esp.cube colour=&#039;plasma&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;bins&amp;lt;/code&amp;gt; (integer/None/string, default=30) = the number of bins in the histogram (see [https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.histogram.html here] for details)&lt;br /&gt;
* &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots the histogram; if False, it does not plot the histogram (only the KDE)&lt;br /&gt;
* &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots a gaussian kernel density estimate (KDE = a way to estimate the probability density function of a variable); if False, it does not plot the KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_freq&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a histogram with normalised frequency (without KDE, because the KDE has a normalised area, not normalised bin heights)&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it normalises the histogram (i.e. integral=1) - this happens by default for plots including KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 5. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=True) = if True: if &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_hist.out is created, containing the bin edges values and the frequency for each bin as shown in the histogram; if &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_kde.out is created, containing the range of values used for plotting the KDE and the corresponding KDE value. The file ends with two separate sections: peak values and minimum values&lt;br /&gt;
* &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only plots the histogram and/or KDE for the points that correspond to the cation (the condition for which atoms belong to the cation has to be changed manually inside [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only plots the histogram and/or KDE for the points that correspond to the anion (the condition for which atoms belong to the cation has to be changed manually inside [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;]; the atoms belonging to the anion are the remaining ones)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotHistogram test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 5.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=696419</id>
		<title>Mod:Hunt Research Group/PlotCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=696419"/>
		<updated>2018-04-26T18:56:21Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* PlotHistogram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files. &lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
* NumPy&lt;br /&gt;
* scipy&lt;br /&gt;
* [https://gist.github.com/jdiscar/9144764 gistfile1]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotMesh==&lt;br /&gt;
This function creates an interactive plot of the cube file values.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the x values (by default all the x values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the y values (by default all the y values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;zlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the z values (by default all the z values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=0.1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=0.05) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;lower_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the lower limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;upper_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider for the minima and maxima (i.e. ±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:Fig1.png|400px|right|thumb|Figure 1. Plot generated by PlotMesh]]&lt;br /&gt;
* lower cutoff value&lt;br /&gt;
* upper cutoff value&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* SLOW&lt;br /&gt;
* ONLY WORKS FOR ORTHONORMAL GRIDS&lt;br /&gt;
* If you click on a point, it will be highlighted and its value will be displayed in the upper right corner.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotMesh test_emim_oac_esp.cube colour=&#039;plasma&#039; axes=True&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
* &amp;lt;code&amp;gt;grey_surf&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a grey surface just below the van der Waals surface&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig2.png|400px|right|thumb|Figure 2. Plot generated by PlotSurface]]&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSurface test_emim_oac_esp.cube bkg=[0.2,0.2,0.3] &amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot, shown after changing the alpha and zoom values using the slider, is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig3.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* value&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotIsosurface test_emim_oac_esp.cube iso=0.01 iso_range=0.02&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot after rotation is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig4.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSlice test_emim_oac_esp.cube colour=&#039;plasma&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;bins&amp;lt;/code&amp;gt; (integer, default=30) = the number of bins in the histogram&lt;br /&gt;
* &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots the histogram; if False, it does not plot the histogram (only the KDE)&lt;br /&gt;
* &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots a gaussian kernel density estimate (KDE = a way to estimate the probability density function of a variable); if False, it does not plot the KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_freq&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a histogram with normalised frequency (without KDE, because the KDE has a normalised area, not normalised bin heights)&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it normalises the histogram (i.e. integral=1) - this happens by default for plots including KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 5. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=True) = if True: if &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_hist.out is created, containing the bin edges values and the frequency for each bin as shown in the histogram; if &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_kde.out is created, containing the range of values used for plotting the KDE and the corresponding KDE value. The file ends with two separate sections: peak values and minimum values&lt;br /&gt;
* &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only plots the histogram and/or KDE for the points that correspond to the cation (the condition for which atoms belong to the cation has to be changed manually inside [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;])&lt;br /&gt;
* &amp;lt;code&amp;gt;an&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it only plots the histogram and/or KDE for the points that correspond to the anion (the condition for which atoms belong to the cation has to be changed manually inside [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;]; the atoms belonging to the anion are the remaining ones)&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotHistogram test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 5.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=696418</id>
		<title>Mod:Hunt Research Group/PlotCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=696418"/>
		<updated>2018-04-26T18:53:00Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* PlotSlice */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files. &lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
* NumPy&lt;br /&gt;
* scipy&lt;br /&gt;
* [https://gist.github.com/jdiscar/9144764 gistfile1]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotMesh==&lt;br /&gt;
This function creates an interactive plot of the cube file values.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the x values (by default all the x values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the y values (by default all the y values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;zlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the z values (by default all the z values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=0.1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=0.05) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;lower_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the lower limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;upper_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider for the minima and maxima (i.e. ±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:Fig1.png|400px|right|thumb|Figure 1. Plot generated by PlotMesh]]&lt;br /&gt;
* lower cutoff value&lt;br /&gt;
* upper cutoff value&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* SLOW&lt;br /&gt;
* ONLY WORKS FOR ORTHONORMAL GRIDS&lt;br /&gt;
* If you click on a point, it will be highlighted and its value will be displayed in the upper right corner.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotMesh test_emim_oac_esp.cube colour=&#039;plasma&#039; axes=True&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
* &amp;lt;code&amp;gt;grey_surf&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a grey surface just below the van der Waals surface&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig2.png|400px|right|thumb|Figure 2. Plot generated by PlotSurface]]&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSurface test_emim_oac_esp.cube bkg=[0.2,0.2,0.3] &amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot, shown after changing the alpha and zoom values using the slider, is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig3.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* value&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotIsosurface test_emim_oac_esp.cube iso=0.01 iso_range=0.02&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot after rotation is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = the x component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = the y component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = the z component of the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = the x coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = the y coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = the z coordinate of the origin for the normal vector defining the plane&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig4.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSlice test_emim_oac_esp.cube colour=&#039;plasma&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;bins&amp;lt;/code&amp;gt; (integer, default=None) = the number of bins in the histogram&lt;br /&gt;
* &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots the histogram; if False, it does not plot the histogram (only the KDE)&lt;br /&gt;
* &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots a gaussian kernel density estimate (KDE = a way to estimate the probability density function of a variable); if False, it does not plot the KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_freq&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a histogram with normalised frequency (without KDE, because the KDE has a normalised area, not normalised bin heights)&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it normalises the histogram (i.e. integral=1) - this happens by default for plots including KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 5. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=True) = if True: if &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_hist.out is created, containing the bin edges values and the frequency for each bin as shown in the histogram; if &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_kde.out is created, containing the range of values used for plotting the KDE and the corresponding KDE value. The file ends with two separate sections: peak values and minimum values&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotHistogram test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 5.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=696417</id>
		<title>Mod:Hunt Research Group/PlotCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=696417"/>
		<updated>2018-04-26T18:49:46Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* PlotIsosurface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files. &lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
* NumPy&lt;br /&gt;
* scipy&lt;br /&gt;
* [https://gist.github.com/jdiscar/9144764 gistfile1]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotMesh==&lt;br /&gt;
This function creates an interactive plot of the cube file values.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the x values (by default all the x values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the y values (by default all the y values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;zlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the z values (by default all the z values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=0.1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=0.05) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;lower_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the lower limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;upper_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider for the minima and maxima (i.e. ±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:Fig1.png|400px|right|thumb|Figure 1. Plot generated by PlotMesh]]&lt;br /&gt;
* lower cutoff value&lt;br /&gt;
* upper cutoff value&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* SLOW&lt;br /&gt;
* ONLY WORKS FOR ORTHONORMAL GRIDS&lt;br /&gt;
* If you click on a point, it will be highlighted and its value will be displayed in the upper right corner.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotMesh test_emim_oac_esp.cube colour=&#039;plasma&#039; axes=True&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
* &amp;lt;code&amp;gt;grey_surf&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a grey surface just below the van der Waals surface&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig2.png|400px|right|thumb|Figure 2. Plot generated by PlotSurface]]&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSurface test_emim_oac_esp.cube bkg=[0.2,0.2,0.3] &amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot, shown after changing the alpha and zoom values using the slider, is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = how large the plot is displayed with respect to the default size&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None) = the value of the points to be plotted&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider when selecting the points (i.e. &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt;±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig3.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* value&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotIsosurface test_emim_oac_esp.cube iso=0.01 iso_range=0.02&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot after rotation is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig4.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSlice test_emim_oac_esp.cube colour=&#039;plasma&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;bins&amp;lt;/code&amp;gt; (integer, default=None) = the number of bins in the histogram&lt;br /&gt;
* &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots the histogram; if False, it does not plot the histogram (only the KDE)&lt;br /&gt;
* &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots a gaussian kernel density estimate (KDE = a way to estimate the probability density function of a variable); if False, it does not plot the KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_freq&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a histogram with normalised frequency (without KDE, because the KDE has a normalised area, not normalised bin heights)&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it normalises the histogram (i.e. integral=1) - this happens by default for plots including KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 5. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=True) = if True: if &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_hist.out is created, containing the bin edges values and the frequency for each bin as shown in the histogram; if &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_kde.out is created, containing the range of values used for plotting the KDE and the corresponding KDE value. The file ends with two separate sections: peak values and minimum values&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotHistogram test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 5.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=696416</id>
		<title>Mod:Hunt Research Group/PlotCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=696416"/>
		<updated>2018-04-26T18:46:59Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Optional arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files. &lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
* NumPy&lt;br /&gt;
* scipy&lt;br /&gt;
* [https://gist.github.com/jdiscar/9144764 gistfile1]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotMesh==&lt;br /&gt;
This function creates an interactive plot of the cube file values.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the x values (by default all the x values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the y values (by default all the y values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;zlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the z values (by default all the z values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=0.1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=0.05) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;lower_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the lower limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;upper_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider for the minima and maxima (i.e. ±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:Fig1.png|400px|right|thumb|Figure 1. Plot generated by PlotMesh]]&lt;br /&gt;
* lower cutoff value&lt;br /&gt;
* upper cutoff value&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* SLOW&lt;br /&gt;
* ONLY WORKS FOR ORTHONORMAL GRIDS&lt;br /&gt;
* If you click on a point, it will be highlighted and its value will be displayed in the upper right corner.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotMesh test_emim_oac_esp.cube colour=&#039;plasma&#039; axes=True&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
* &amp;lt;code&amp;gt;grey_surf&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a grey surface just below the van der Waals surface&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig2.png|400px|right|thumb|Figure 2. Plot generated by PlotSurface]]&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSurface test_emim_oac_esp.cube bkg=[0.2,0.2,0.3] &amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot, shown after changing the alpha and zoom values using the slider, is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = the value range to consider for the minimum and maximum&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = &lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig3.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* value&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotIsosurface test_emim_oac_esp.cube iso=0.01 iso_range=0.02&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot after rotation is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig4.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSlice test_emim_oac_esp.cube colour=&#039;plasma&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;bins&amp;lt;/code&amp;gt; (integer, default=None) = the number of bins in the histogram&lt;br /&gt;
* &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots the histogram; if False, it does not plot the histogram (only the KDE)&lt;br /&gt;
* &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots a gaussian kernel density estimate (KDE = a way to estimate the probability density function of a variable); if False, it does not plot the KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_freq&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a histogram with normalised frequency (without KDE, because the KDE has a normalised area, not normalised bin heights)&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it normalises the histogram (i.e. integral=1) - this happens by default for plots including KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 5. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=True) = if True: if &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_hist.out is created, containing the bin edges values and the frequency for each bin as shown in the histogram; if &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_kde.out is created, containing the range of values used for plotting the KDE and the corresponding KDE value. The file ends with two separate sections: peak values and minimum values&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotHistogram test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 5.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=696415</id>
		<title>Mod:Hunt Research Group/PlotCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=696415"/>
		<updated>2018-04-26T18:45:58Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* PlotSurface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files. &lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
* NumPy&lt;br /&gt;
* scipy&lt;br /&gt;
* [https://gist.github.com/jdiscar/9144764 gistfile1]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotMesh==&lt;br /&gt;
This function creates an interactive plot of the cube file values.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the x values (by default all the x values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the y values (by default all the y values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;zlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the z values (by default all the z values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=0.1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=0.05) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;lower_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the lower limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;upper_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider for the minima and maxima (i.e. ±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:Fig1.png|400px|right|thumb|Figure 1. Plot generated by PlotMesh]]&lt;br /&gt;
* lower cutoff value&lt;br /&gt;
* upper cutoff value&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* SLOW&lt;br /&gt;
* ONLY WORKS FOR ORTHONORMAL GRIDS&lt;br /&gt;
* If you click on a point, it will be highlighted and its value will be displayed in the upper right corner.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotMesh test_emim_oac_esp.cube colour=&#039;plasma&#039; axes=True&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.05) = the value range to consider for the minima and maxima (i.e. ±0.05 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it saves a .txt file with a summary of the results (minimum, maximum and lowest curvature)&lt;br /&gt;
* &amp;lt;code&amp;gt;grey_surf&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a grey surface just below the van der Waals surface&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig2.png|400px|right|thumb|Figure 2. Plot generated by PlotSurface]]&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSurface test_emim_oac_esp.cube bkg=[0.2,0.2,0.3] &amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot, shown after changing the alpha and zoom values using the slider, is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = &lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig3.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* value&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotIsosurface test_emim_oac_esp.cube iso=0.01 iso_range=0.02&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot after rotation is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig4.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSlice test_emim_oac_esp.cube colour=&#039;plasma&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;bins&amp;lt;/code&amp;gt; (integer, default=None) = the number of bins in the histogram&lt;br /&gt;
* &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots the histogram; if False, it does not plot the histogram (only the KDE)&lt;br /&gt;
* &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots a gaussian kernel density estimate (KDE = a way to estimate the probability density function of a variable); if False, it does not plot the KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_freq&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a histogram with normalised frequency (without KDE, because the KDE has a normalised area, not normalised bin heights)&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it normalises the histogram (i.e. integral=1) - this happens by default for plots including KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 5. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=True) = if True: if &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_hist.out is created, containing the bin edges values and the frequency for each bin as shown in the histogram; if &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_kde.out is created, containing the range of values used for plotting the KDE and the corresponding KDE value. The file ends with two separate sections: peak values and minimum values&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotHistogram test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 5.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=696414</id>
		<title>Mod:Hunt Research Group/PlotCube.py</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/PlotCube.py&amp;diff=696414"/>
		<updated>2018-04-26T18:43:52Z</updated>

		<summary type="html">&lt;p&gt;Ia2514: /* Optional arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;PlotCube.py&amp;lt;/code&amp;gt; is a collection of functions that plot data from cube files. &lt;br /&gt;
&lt;br /&gt;
=Requirements=&lt;br /&gt;
* Python&lt;br /&gt;
* Matplotlib&lt;br /&gt;
* NumPy&lt;br /&gt;
* scipy&lt;br /&gt;
* [https://gist.github.com/jdiscar/9144764 gistfile1]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
An easy way to obtain Python with the required modules is by installing [https://anaconda.org Anaconda].&lt;br /&gt;
&lt;br /&gt;
Anaconda comes with Spyder, which is a Python editor that you can use to write and run Python codes (Applications &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Anaconda Navigator &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; spyder &amp;lt;math&amp;gt;\rightarrow&amp;lt;/math&amp;gt; Launch)&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
==Running the code==&lt;br /&gt;
The plotting functions can be run from the terminal window by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;python ReadCube.py function_name cube_file_path arg1=val1 arg2=val2...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
==PlotMesh==&lt;br /&gt;
This function creates an interactive plot of the cube file values.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the x values (by default all the x values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the y values (by default all the y values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;zlim&amp;lt;/code&amp;gt; (list,default=[None, None]) = a list of two values to be used as the lower and upper limit for the z values (by default all the z values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=0.1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=0.05) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;lower_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the lower limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;upper_cutoff&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the values to be plotted (by default all the values from the cube file are plotted)&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.01) = the value range to consider for the minima and maxima (i.e. ±0.01 by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:Fig1.png|400px|right|thumb|Figure 1. Plot generated by PlotMesh]]&lt;br /&gt;
* lower cutoff value&lt;br /&gt;
* upper cutoff value&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* SLOW&lt;br /&gt;
* ONLY WORKS FOR ORTHONORMAL GRIDS&lt;br /&gt;
* If you click on a point, it will be highlighted and its value will be displayed in the upper right corner.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotMesh test_emim_oac_esp.cube colour=&#039;plasma&#039; axes=True&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot shown in figure 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSurface==&lt;br /&gt;
This function creates an interactive plot of all the points which reside within +/- a fractional distance from the surface defined in terms of the Van der Waals radii of the atoms in the molecule (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=1) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0.01) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=False) = &lt;br /&gt;
* &amp;lt;code&amp;gt;grey_surf&amp;lt;/code&amp;gt; (boolean, default=False) = &lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py#VdWLaplacian &amp;lt;code&amp;gt; VdWLaplacian &amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/CalculateCube.py &amp;lt;code&amp;gt;CalculateCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig2.png|400px|right|thumb|Figure 2. Plot generated by PlotSurface]]&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSurface test_emim_oac_esp.cube bkg=[0.2,0.2,0.3] &amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot, shown after changing the alpha and zoom values using the slider, is shown in figure 2.&lt;br /&gt;
&lt;br /&gt;
==PlotIsosurface==&lt;br /&gt;
This function creates an interactive plot of all the points which are within a specified value range from a given value.&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso&amp;lt;/code&amp;gt; (float, default=None)&lt;br /&gt;
* &amp;lt;code&amp;gt;iso_range&amp;lt;/code&amp;gt; (float, default=0.01) = &lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig3.png|400px|right|thumb|Figure 3. Plot generated by PlotIsosurface]]&lt;br /&gt;
* value&lt;br /&gt;
* azimuth&lt;br /&gt;
* elevation&lt;br /&gt;
* alpha&lt;br /&gt;
* size&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotIsosurface test_emim_oac_esp.cube iso=0.01 iso_range=0.02&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot after rotation is shown in figure 3.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PlotSlice==&lt;br /&gt;
This function generates an interactive plot of all the points which reside within +/- a fractional distance from a plane defined in terms of a normal vector and an origin (the fractional distance represents 30% of the distance between two diagonally adjacent points in the grid).&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;alpha&amp;lt;/code&amp;gt; (float, default=1) = transparency value (between 0 and 1)&lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; (float, default=4) = marker size&lt;br /&gt;
* &amp;lt;code&amp;gt;axes&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show axes; if False, hide axes&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; (tuple/list/string, default=(1, 1, 1)) = background colour (RGB tuple/list or name - each value between 0 and 1, white by default)&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show minima and maxima; if False, hide minima and maxima&lt;br /&gt;
* &amp;lt;code&amp;gt;minmax_range&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
* &amp;lt;code&amp;gt;atoms&amp;lt;/code&amp;gt; (boolean, default=False) = if True, show atoms; if False, hide atoms&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;curvature&amp;lt;/code&amp;gt; (boolean, default=False) = if True, plots curvature points (either based on cv_lim if given, or cv_pts)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_lim&amp;lt;/code&amp;gt; (float, default=None) = the upper limit of the curvature for the low curvature points to be plotted (it overrides cv_pts if given)&lt;br /&gt;
* &amp;lt;code&amp;gt;cv_pts&amp;lt;/code&amp;gt; (integer, default=5) = the number of low curvature points to be plotted (the points will be chosen in increasing order of their absolute curvature&lt;br /&gt;
* &amp;lt;code&amp;gt;zoom&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; (float, default=0) = &lt;br /&gt;
* &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (float, default=1) = &lt;br /&gt;
* &amp;lt;code&amp;gt;x0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;y0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;z0&amp;lt;/code&amp;gt; (float, default=None) = &lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;contour&amp;lt;/code&amp;gt; (boolean, default=True) = if True, show van der Waals contour; if False, hide van der Waals contour&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Sliders===&lt;br /&gt;
[[File:ia2514_fig4.png|400px|right|thumb|Figure 4. Plot generated by PlotSlice]]&lt;br /&gt;
* a&lt;br /&gt;
* b&lt;br /&gt;
* c&lt;br /&gt;
* x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* y&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* z&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
* zoom&lt;br /&gt;
&lt;br /&gt;
===Buttons===&lt;br /&gt;
* axes: on/off&lt;br /&gt;
* minima and maxima: on/off&lt;br /&gt;
* atoms: on/off&lt;br /&gt;
* colour: &#039;rainbow&#039;, &#039;bwr&#039; and the value passed for the &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; parameter (if different from &#039;rainbow&#039; and &#039;bwr&#039;)&lt;br /&gt;
* background colour: &#039;white&#039;, &#039;black&#039; and the value passed for the &amp;lt;code&amp;gt;bkg&amp;lt;/code&amp;gt; parameter (if different from white and black)&lt;br /&gt;
* curvature: on/off&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotSlice test_emim_oac_esp.cube colour=&#039;plasma&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 4.&lt;br /&gt;
&lt;br /&gt;
==PlotHistogram==&lt;br /&gt;
===Required arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;fpath&amp;lt;/code&amp;gt; (string) = path for a cube file&lt;br /&gt;
&lt;br /&gt;
===Optional arguments===&lt;br /&gt;
* &amp;lt;code&amp;gt;factor&amp;lt;/code&amp;gt; (float, default=1) = factor by which to multiply the VdW radii&lt;br /&gt;
* &amp;lt;code&amp;gt;bins&amp;lt;/code&amp;gt; (integer, default=None) = the number of bins in the histogram&lt;br /&gt;
* &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots the histogram; if False, it does not plot the histogram (only the KDE)&lt;br /&gt;
* &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it plots a gaussian kernel density estimate (KDE = a way to estimate the probability density function of a variable); if False, it does not plot the KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_freq&amp;lt;/code&amp;gt; (boolean, default=False) = if True, it plots a histogram with normalised frequency (without KDE, because the KDE has a normalised area, not normalised bin heights)&lt;br /&gt;
* &amp;lt;code&amp;gt;norm_hist&amp;lt;/code&amp;gt; (boolean, default=True) = if True, it normalises the histogram (i.e. integral=1) - this happens by default for plots including KDE&lt;br /&gt;
* &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; (boolean, default=False) = if True, use atomic units (i.e. bohr for coordinates); if False, use Angstroms for coordinates and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; for values&lt;br /&gt;
* &amp;lt;code&amp;gt;density&amp;lt;/code&amp;gt; (integer, default=1) = an integer number n which indicates that the number of points stored along each axis is reduced by the density value n (therefore the total number of points is reduced by n&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; (string, default=&#039;esp&#039;) = can be ‘esp’/’potential’ or ‘dens’/’density’ (or any uppercase version of the aforementioned); used in conjunction with the keywords &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; in order to convert the values to the appropriate units&lt;br /&gt;
* &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; (string, default=None) = the units to be used for the value; currently supports ‘V’ for ESP and ‘A’/‘angstrom’, ’nm’, ’pm’, ’m’ for density (or any lowercase/uppercase version of these). In the case of the density, the actual units are the specified units ^(-3). The keywords &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; override &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;au&amp;lt;/code&amp;gt; is True, the values will be in atomic units regardless of the value passed for &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;value_type&amp;lt;/code&amp;gt; is ‘dens’, the values will be read as density values even if the &amp;lt;code&amp;gt;units&amp;lt;/code&amp;gt; argument has a valid ESP value (such as ‘V’). The default unit for ESP is V and for density 1/Å&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;colour&amp;lt;/code&amp;gt; (string, default=&#039;rainbow&#039;) = colour scheme (&#039;rainbow&#039; by default, change it to &#039;bwr&#039; for blue-white-red) - full list [https://matplotlib.org/users/colormaps.html here]&lt;br /&gt;
* &amp;lt;code&amp;gt;cb_lim&amp;lt;/code&amp;gt; (list, default=None) = limits for the colour bar (list of two floats; if not specified, the limits will be the min and max of the values; if the limits do not cover the whole range of values, a warning is printed)&lt;br /&gt;
[[File:ia2514_fig5.png|400px|right|thumb|Figure 5. Plot generated by PlotHistogram]]&lt;br /&gt;
* &amp;lt;code&amp;gt;xlim&amp;lt;/code&amp;gt; (list, default=None) = x axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;ylim&amp;lt;/code&amp;gt; (list, default=None) = y axis limits&lt;br /&gt;
* &amp;lt;code&amp;gt;save&amp;lt;/code&amp;gt; (boolean, default=True) = if True: if &amp;lt;code&amp;gt;hist&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_hist.out is created, containing the bin edges values and the frequency for each bin as shown in the histogram; if &amp;lt;code&amp;gt;kde&amp;lt;/code&amp;gt; is also True, a file &amp;lt;original_file_name&amp;gt;_kde.out is created, containing the range of values used for plotting the KDE and the corresponding KDE value. The file ends with two separate sections: peak values and minimum values&lt;br /&gt;
&lt;br /&gt;
===Calls===&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ExtractData &amp;lt;code&amp;gt;ExtractData&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#Axes &amp;lt;code&amp;gt;Axes&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#ValuesAsDictionary &amp;lt;code&amp;gt;ValuesAsDictionary&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
* [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py#GetVdWPoints &amp;lt;code&amp;gt;GetVdWPoints&amp;lt;/code&amp;gt;] (from [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/ReadCube.py &amp;lt;code&amp;gt;ReadCube.py&amp;lt;/code&amp;gt;])&lt;br /&gt;
&lt;br /&gt;
===Observations===&lt;br /&gt;
* if you only want to specify one limit for either of the axis, use None for the other (e.g. xlim=[None,3.5])&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;python PlotCube.py PlotHistogram test_emim_oac_esp.cube&amp;lt;/pre&amp;gt;&lt;br /&gt;
The resulting plot is shown in figure 5.&lt;/div&gt;</summary>
		<author><name>Ia2514</name></author>
	</entry>
</feed>