Author Topic: Particle positions for certain frames not same as what is in XYZ file  (Read 254 times)

benjy

  • Newbie
  • *
  • Posts: 8
Hi, so I've been working with a 3 particle system and doing some analysis, and noticed some discrepancies compared to other methods. When I checked the certain frames where these discrepancies occurred I noticed the positions of the particles were incorrect; for example, when I'm supposed to see:
Code: [Select]
AT1 -0.0458366307079032 0.487435423124703 0.388100731462943
 AT2 0.485326388695391 0.00895584052847351 -0.491597042508263
 AT3 -0.428006586535080 -0.492443496755789 0.0976308063157959

I end up seeing those positions multiplied by 10.
Code: [Select]
1 (AT1) -0.458366 4.87435 3.88101
2 (AT2) 4.85326 0.0895584 -4.91597
3 (AT3) -4.28007 -4.92443 0.976308

It has happened for other frames as well, and seemingly at random. Is there some way I can correct this? Don't know if this is relevant but the particle radii are set to 0, so there shouldnt be overlap, I think. The format of the xyz file is as follows:
Code: [Select]
3
cell_origin="-5.0 -5.0 -5.0", Lattice="10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 10.0"
 C1 -0.0458366307079032 0.487435423124703 0.388100731462943
 C2 0.485326388695391 0.00895584052847351 -0.491597042508263
 C3 -0.428006586535080 -0.492443496755789 0.0976308063157959

Constanze Kalcher

  • Administrator
  • Sr. Member
  • *****
  • Posts: 301
Hi benjy,

I need to know exactly what you're doing during your analysis in order to be able to help you. Seems like your somehow manipulating the positions?

-Constanze
« Last Edit: May 22, 2019, 09:25:40 PM by Constanze Kalcher »

benjy

  • Newbie
  • *
  • Posts: 8
Constanze,

The analysis isn't the problem (probably shouldve just let that part out), its when I load the XYZ file into ovito and step through each frame of the file, I see the errors on certain frames like the one I mentioned in the original post. This is before doing any of the analysis (which in this case is just generating bonds).

Constanze Kalcher

  • Administrator
  • Sr. Member
  • *****
  • Posts: 301
Hi benjy,
if you like you can upload some example frames of your trajectory here so I can look into this. Also it would be helpful to know what version of OVITO you’re using.
-Constanze

benjy

  • Newbie
  • *
  • Posts: 8
Constanze,

I've attached some of the frames in question. The version I'm using is version 3.0.0-dev349.

Constanze Kalcher

  • Administrator
  • Sr. Member
  • *****
  • Posts: 301
Hi benjy,

thank you for uploading the files. When you imported your files with the developer version,  did you deactivate the option "Detect reduced coordinates" in the XYZ-file reader?
Because it seems that this is what causes you problems. That still doesn't explain why ovito would assume that you have reduced coordinates and then scale the coordinates with the given lattice dimensions (x10 in your case) for only some frames as you say, so I will continue looking into this.

But as a quick fix for now, please deactivate the option "Detect reduced coordinates" in the XYZ File reader panel (see attached screenshots) and then use the "Reload data button". Then everything should be imported correctly.
Let me know if that doesn't work for you.

-Constanze

Edit: The explanation for this behavior is that the option "Detect reduced coordinates" will assume your data is in reduced format if all coordinates are within the [0,1] or [-0.5,+0.5]. Now in your very special case of only 3 particles, you have certain frames where that's true (e.g. in the frame in the screenshot).  So you will definitely need to deactivate that auto-detect option.

« Last Edit: May 23, 2019, 12:04:13 PM by Constanze Kalcher »

benjy

  • Newbie
  • *
  • Posts: 8
Constanze,

Thank you so much! I never realized that was an option/issue, but now it is fixed. Is there a way to specify in a python script to ensure that it the reduced coordinate detection is turned off? I was looking through the manual and didnt see if you could specify that in a script via some line of code.

Constanze Kalcher

  • Administrator
  • Sr. Member
  • *****
  • Posts: 301
Hi benjy,

you're right, unfortunately this is not documented yet. But when you use import_file(), you should be able to pass
Code: [Select]
rescale_reduced_coords = False
-Constanze