Author Topic: Data collection error  (Read 229 times)

berraw

  • Newbie
  • *
  • Posts: 4
Data collection error
« on: February 14, 2019, 10:38:30 AM »
Dear all,

I am trying to collect the dislocation length by using python script. I can collect all types of dislocations except for Hirth(1/3<001>). I receive an error as below. Thanks for help.

Traceback (most recent call last):
  File "C:\Lammps_data\str_rate\gs_100\dxa_ovito.py", line 26, in <module>
    total_line_hirth = node.output.attributes['DislocationAnalysis.length.1/3<001>']
  File "C:\Program Files\Ovito\plugins\python\ovito\data\data_collection.py", line 71, in __getitem__
    raise KeyError("Attribute '%s' does not exist in data collection." % str(key))
KeyError: "Attribute 'DislocationAnalysis.length.1/3<001>' does not exist in data collection."


Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 595
Re: Data collection error
« Reply #1 on: February 14, 2019, 11:17:24 AM »
Hi,

The naming of the output attribute is different. It is "DislocationAnalysis.length.1/3<100>" (not <001>), as you can see in the attributes data inspector of Ovito (attached screenshot).

-Alex

berraw

  • Newbie
  • *
  • Posts: 4
Re: Data collection error
« Reply #2 on: February 14, 2019, 11:21:10 AM »
Oh.. sorry. This is my fault. Thanks for help and quick reply!

berraw

  • Newbie
  • *
  • Posts: 4
Re: Data collection error
« Reply #3 on: February 14, 2019, 11:28:59 AM »
By the way, I realized that Hirth dislocation was written 1/3<001> on right menu.
« Last Edit: February 14, 2019, 11:32:39 AM by berraw »

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 595
Re: Data collection error
« Reply #4 on: February 14, 2019, 11:40:04 AM »
Yeah, I thought so.

The reason for this difference is that the table in the modifier panel lists the prescribed dislocation classes, which all have manually assigned names. In contrast to this, the names of the output attributes are auto-generated from the prototype Burgers vectors, and the algorithm puts all zero entries at the end of the Miller notation.

I should rename the predefined dislocation classes in the code to make them consistent with this scheme.

berraw

  • Newbie
  • *
  • Posts: 4
Re: Data collection error
« Reply #5 on: February 14, 2019, 01:12:54 PM »
The reason for this difference is that the table in the modifier panel lists the prescribed dislocation classes, which all have manually assigned names. In contrast to this, the names of the output attributes are auto-generated from the prototype Burgers vectors, and the algorithm puts all zero entries at the end of the Miller notation.

Thanks for information.