Author Topic: Control over export options  (Read 1845 times)

0 Members and 1 Guest are viewing this topic.

Offline ams_nanolab

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 389
  • Country: in
  • Reputation: 11
    • View Profile
Control over export options
« on: August 26, 2016, 10:48 »
Hello, I want to export a graphene.py file structure into graphene.xyz  but only in the cartesian co-rodinates as the .xyz output file.

original structure in .py
=========================
# Set up lattice
lattice = Hexagonal(2.4612*Angstrom, 6.709*Angstrom)

# Define elements
elements = [Carbon, Carbon]

# Define coordinates
fractional_coordinates = [[ 0.333333333333,  0.166666666667,  0.5           ],
                          [ 0.666666666667,  0.833333333333,  0.5           ]]

# Set up configuration
bulk_configuration = BulkConfiguration(
    bravais_lattice=lattice,
    elements=elements,
    fractional_coordinates=fractional_coordinates
    )
-----------------------------

Export as .xyz
==============

2
Bulk
C     6.153000e-01 -3.552436e-01  3.354500e+00    0.33333  0.16667  0.50000
C     1.845900e+00  3.552436e-01  3.354500e+00    0.66667  0.83333  0.50000

----------------------------------------

what I really want is : something like this

2

C     6.153000e-01 -3.552436e-01  3.354500e+00   
C     1.845900e+00  3.552436e-01  3.354500e+00   

===============================

how can it be done? For graphene it's simple to just edit the text but for larger structures doing by hand is difficult.


Offline Petr Khomyakov

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1290
  • Country: dk
  • Reputation: 25
    • View Profile
Re: Control over export options
« Reply #1 on: August 26, 2016, 16:13 »
You can erase the fractional coordinates in a 'filename.xyz' with the script enclosed.

$ python convert.py filename.xyz > filename_new.xyz

or

$ atkpython convert.py filename.xyz > filename_new.xyz

The new file contains the atomic coordinates in Cartesian only.

Offline ams_nanolab

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 389
  • Country: in
  • Reputation: 11
    • View Profile
Re: Control over export options
« Reply #2 on: August 30, 2016, 14:37 »
Thanks  :)