QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: ams_nanolab on August 26, 2016, 10:48

Title: Control over export options
Post by: ams_nanolab 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.

Title: Re: Control over export options
Post by: Petr Khomyakov 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.
Title: Re: Control over export options
Post by: ams_nanolab on August 30, 2016, 14:37
Thanks  :)