OVITO > Support Forum

Partial radial distribution function (RDF)

(1/5) > >>

Safy:
Hello! I am  trying to calculate the partial RDF for my systems. I used the instruction on this page:

http://forum.ovito.org/index.php?topic=131.0

As a result, I have the following: http://prntscr.com/l6yltd

I'm sorry, but I just started to learn the program Ovito and maybe I make some mistakes..

Alexander Stukowski:
Dear Safy,

Don't paste the code into the 'modifier name' input field. Instead, click the 'Edit script...' button. This will open the code editor window. Replace the existing default script in this window with the one you copied from the forum topic.

-Alex

Safy:
Thank you very much, Dr.Alexander Stukowski!
I followed your recommendations and I have successfully get the partial RDF (http://prntscr.com/l99vxl)

I have a question, how can I get a graphical representation of the output result?

Constanze Kalcher:
Hi Safy,
the answer depends on what version of OVITO you're using. In the latest developer version, you can already see the plot under "Data Plots" in the Data Inspector (see attached screenshot).

In OVITO 2.9, you can add two lines of code to your python script modifier using numpy.savetxt()


--- Code: ---result = np.column_stack((radii,rdf))
np.savetxt("partial_rdf_%s.dat" % frame, result)

--- End code ---
to export your data to a text file (labeled by number of the current frame) and then plot it with your favorite plotting program.

-Constanze

Kevin:
I needed this same functionality and tried myself with a problem.

Just noting that the file path has to be defined for the file name as well. (At least on mac)
Otherwise, the python script will complain that permission is denied.
I guess the default file path is somewhere writing permission is not given.

Thanks,
-Kyu

Navigation

[0] Message Index

[#] Next page

Go to full version