Add Orientation Correlation Diagram
Evaluate current bond order code, then add whatever the orientation correlation diagram is (may also want to look at the correlation function code to see if that helps at all)
Comments (7)
-
reporter -
reporter Here is what a script would look like
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from matplotlib.colormap import cm import freud freud_handle = freud.order.BondOrder(rmax, k, n, n_bins_theta, n_bins_phi) for frame in frames: freud_handle.accumulate(frame.box, frame.position, frame.orientation, frame.position, frame.orientation) bond_order_array = self.compute.getBondOrder() theta_array = self.compute.getTheta() phi_array = self.compute.getPhi() bond_order_array /= np.nanmax(bond_order_array) # need to remap variables to plot in matplotlib map_arr = np.zeros(shape=(bond_order_array.shape[1], bond_order_array.shape[0]), dtype=np.float32) for i in range(bond_order_array.shape[1]): for j in range(bond_order_array.shape[0]): # this might actually be a transpose map_array[i,j] = bond_order_array[j,i] theta = np.linspace(0.0, 2.0 * np.pi, n_bins_t+1) phi = np.linspace(0.0, np.pi, n_bins_p+1) x = np.outer(np.cos(theta), np.sin(phi)) y = np.outer(np.sin(theta), np.sin(phi)) z = np.outer(np.ones_like(theta), np.cos(phi)) # I'm not entirely sure if this code works fig = plt.figure() ax = fig.gca(projection='3d') surf = ax.plot_surface(x, y, z, rstride=1, cstride=1, facecolors=cm.hot(map_array)) # ax.axis("off") ax.grid(False) for a in (ax.w_xaxis, ax.w_yaxis, ax.w_zaxis): for t in a.get_ticklines()+a.get_ticklabels(): t.set_visible(False) a.line.set_visible(False) a.pane.set_visible(False)
-
reporter @erteich @djulia did this ever happen? Was part of hackathon, I don't recall if this was resolved.
-
@erteich @djulia Just following up to see the status of this, and whether there is work to be done or if the issue can be closed.
-
Julia and I wrote these tools in the branch "ocd" during a Hackathon and that pull request was rejected by Eric in June 2016, who said he would merge it in manually:
https://bitbucket.org/glotzer/freud/pull-requests/67/ocd/diff
-
@erteich Thanks so much!
-
- changed status to resolved
@vramasub confirmed that the changes were made manually as described.
- Log in to comment
(Comments don’t line up with master right now, some were old and I added some to dos)
This starts at line 181 in BondOrder.cc: