[ase-users] Read only atom positions from CHGCAR file

fabian Fabian.T89 at web.de
Tue May 16 09:35:45 CEST 2017


Dear Tristan,


Thank you very much for your answer! The reason i want to do this, is 
because i am trying to superimpose a structural model

onto slices through a Charge density difference file which still has the 
structure of a CHGCAR file. I just want to avoid to read the wrong

structural information should i do an error when copying the data form 
the HPC to the working dir of my system.

What i want to do is to plot a projection of the atomic geometry in a 
certain distance to and arbitrary plane, for the time being only planes 
parallel to the x y or z plane.

As i am really a novice with python and ase i am asking myself if 
something like this has already been done?


All the best


Fabian

Am 16.05.2017 um 04:25 schrieb Tristan Maxson:
> ​​​While this is a somewhat strange request initially (If you can make 
> a CHGCAR you probably have the POSCAR which would be far easier to 
> use), the solution is actually fairly trivial.​  Thankfully VASP 
> follows the same file format for CHGCAR and POSCAR and ASE happens to 
> gracefully ignore the rest of the file.
>
> Can you try to do the following?
>
> from ase.io <http://ase.io> import read
> atoms = read("CHGCAR", format="vasp")
>
> Thank you,
> Tristan Maxson
>
>
>
> On Mon, May 15, 2017 at 8:36 AM, fabian via ase-users 
> <ase-users at listserv.fysik.dtu.dk 
> <mailto:ase-users at listserv.fysik.dtu.dk>> wrote:
>
>     Dear all
>
>     Ist it possible to directly only read the atomic positions from a
>     CHGCAR file?
>
>
>     from ase.calculators.vasp import VaspChargeDensity from ase.io
>     import read, write from ase.atoms import Atoms CHGDATA =
>     VaspChargeDensity('CHGCAR') atoms = CHGDATA.atoms does work but
>
>
>     atoms = VaspChargeDensity.atoms('CHGCAR') does not work obviously.
>     I would like to avoid to read the complete and large CHGCAR file
>     for a small script i am working on. All the best Fabian
>
>     _______________________________________________ ase-users mailing
>     list ase-users at listserv.fysik.dtu.dk
>     <mailto:ase-users at listserv.fysik.dtu.dk>
>     https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>     <https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20170516/28c05759/attachment.html>


More information about the ase-users mailing list