CCL: Coordinate conversion program
- From: Dan Maftei <dan.maftei!^!uaic.ro>
- Subject: CCL: Coordinate conversion program
- Date: Tue, 01 Nov 2011 11:12:19 +0200
Sent to CCL by: Dan Maftei [dan.maftei+/-uaic.ro]
Hi,
Assuming you have a xyz file (symbol x y z), to convert from
angstroms to bohr you may use the following command-line construct:
cat angstrom.xyz | awk '{print $1 " " $2/0.52918 " "
$3/0.52918 "
" $4/0.52918}' > bohr.xyz
To do the reverse, the command will look like:
cat bohr.xyz | awk '{print $1 " " $2*0.52918 " "
$3*0.52918 " "
$4*0.52918}' > angstroms.xyz
For a prettier look, a printf awk command will to the trick:
cat angstrom.xyz | awk '{printf("%2s %10.6f %10.6f
%10.6f\n",
$1, $2/0.52918, $3/0.52918, $4/0.52918 ) }' > borh.xyz
You may need to check your file headers after the conversion (number of
atoms, title and so on)
Regards,
Dan.
On 11/01/2011 06:05 AM, Bradley K Welch bwelch5(-)slu.edu wrote:
> Sent to CCL by: "Bradley K Welch" [bwelch5|a|slu.edu]
> CCL readers,
>
> Does anyone know of a program that will convert bohr coordinates to
angstroms
> and vice versa? Is openbabel capable of it?
>
>
>
> Bradley Welch
> Saint Louis University
> Room 218>
>
--
Dan Maftei,
Assistant Professor,
Faculty of Chemistry/Department of Chemistry
University Alexandru Ioan Cuza Iasi
Bd. Carol 1, Nr. 11, 700506 Iasi, Romania
Tel: +40 232 201307
E-mail(s):
dan.maftei=chem.uaic.ro
dan.maftei=uaic.ro