[ase-users] Problem Using Atoms module

Tristan Maxson tgmaxson at gmail.com
Thu Jan 21 20:22:25 CET 2016


Can you post the CONTCAR here?  You probably have a bad CONTCAR file

On Thu, Jan 21, 2016 at 2:09 PM, Abhirup Patra <abhirup.patra at hotmail.com>
wrote:

> Thanks very much but I got a new error:-
>
> ValueError: invalid literal for int() with base 10: '1.00000000000000
> \n
>
> Abhirup Patra
> Research Assistant
> SERC-707,Department Of Physics
> Temple University
> PA-19122 U.S.A
> Ph No. 917-657-4032
>
>
> ------------------------------
> Date: Thu, 21 Jan 2016 14:06:00 -0500
>
> From: glenjenness at gmail.com
> To: abhirup.patra at hotmail.com
> CC: ase-users at listserv.fysik.dtu.dk
> Subject: Re: [ase-users] Problem Using Atoms module
>
> Abhirup,
> It should be:
>
> c = read('CONTCAR')
>
> The ase.io routines returns an Atoms object with the associated
> attributes (positions etc.).  The "open" function is a normal python
> function that just returns a file object.
>
> Glen
>
> On Thu, Jan 21, 2016 at 2:01 PM, Abhirup Patra <abhirup.patra at hotmail.com>
> wrote:
>
> Here is the part of the code :-
>
> c = open('CONTCAR','r')
>
> ----read z coordinates -----
> zc = c.positions[:,2]
>
> ----calculate the distance-----
>
> bins = int(np.ceil((zc.max() - zc.min())/dbin))
> histdat, levels = np.histogram(zc, bins)
> mask = histdat > tol * histdat.max()
> plev = levels[mask] + dbin/2
> alayer = histdat[mask]
> layerdist = plev[1:] - plev[:-1]
>
>
> Thanks
>
>
>
>
> ------------------------------
> Date: Thu, 21 Jan 2016 13:58:09 -0500
> Subject: Re: [ase-users] Problem Using Atoms module
> From: glenjenness at gmail.com
> To: abhirup.patra at hotmail.com
> CC: ase-users at listserv.fysik.dtu.dk
>
>
> Abhirup,
> Can we see the full code?  Or at least a minimum working example?
>
> Glen
>
> On Thu, Jan 21, 2016 at 12:22 PM, Abhirup Patra <abhirup.patra at hotmail.com
> > wrote:
>
> Hi All,
>
> I am trying to get the inter layer distance between the layers of the
> surface slab from using the
> CONTCATR of the VASP .
>
> But when I am trying to read the z-coordinates of the atoms using
> 'positions' attribute
> I am getting the error as -
>
> AttributeError: 'file' object has no attribute 'positions'
>
> Here is what i have imported in my code-
>
> import ase.io
> from ase import Atoms
> from ase.io import read
> from ase.io import write
> from ase import *
> import numpy as np
>
> Can anyone please give me any idea where I am going wrong ?
>
> Thanks,
>
>
>
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>
>
>
>
> --
> Dr. Glen Jenness
> Catalysis Center for Energy Innovation (CCEI)
> University of Delaware
>
>
>
>
> --
> Dr. Glen Jenness
> Catalysis Center for Energy Innovation (CCEI)
> University of Delaware
>
> _______________________________________________ ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> 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/20160121/86e24ed1/attachment.html>


More information about the ase-users mailing list