Here is the .XYZ format file NP3D.XYZ
Somehow i cannot import this file.It return an error box :- "Cannot Import Data As XYZ Format."
it contains 1000 snapshot of 10 Carbon particles coordinate moving in a box that i have to visualise.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityHere is the .XYZ format file NP3D.XYZ
Somehow i cannot import this file.It return an error box :- "Cannot Import Data As XYZ Format."
it contains 1000 snapshot of 10 Carbon particles coordinate moving in a box that i have to visualise.
It does not work because of different data elements, compare
Import["ExampleData/caffeine.xyz"]
with data structure
and your data structure:
but change it to:
with
Import["NP3D.xyz"]
you will get:
full data looks like
You can make an animation with these snapshots:
data1 = StringRiffle[#, "\n"] & /@
Split[ReadList["/Users/xslittlegrass/Downloads/NP3D.xyz",
"String"], #2 =!= "10" &][[All, 3 ;; -1]];
data = ParallelMap[ImportString[#, "XYZ"] &, data1]; // AbsoluteTiming
Export["~/Downloads/1.gif", data[[46 ;; 146]]]
Manipulate
(or something like that) to step through each structure is what is desired. But, OP should be able to sort this out for themselves IMO.
$\endgroup$
Apr 22, 2016 at 17:24
This will split the text into chunks and plot them as molecular plots,
imglist = ImportString[ExportString[#, "Table"], "XYZ"] & /@
Partition[
StringSplit[
Import["http://comsics.usm.my/tlyoon/teaching/ZCE111_1516SEM2/\
data/NP3D.xyz", "Text"], "\n"], 12];
But, those carbon atoms sure are close together....
imglist[[405]]
Maybe the units are not angstroms?