Pages

Affichage des articles dont le libellé est Out of index error using Python on NanoTCAD. Afficher tous les articles
Affichage des articles dont le libellé est Out of index error using Python on NanoTCAD. Afficher tous les articles

Out of index error using Python on NanoTCAD

lundi 8 août 2016

Hi Guys,

I am running NanoTCAD, a python library, to simulate transistor devices. I have been getting out of index error while using one of the commands, grid:

"IndexError: axis 1 out of bounds [0, 1)"

Code:

File"/home/kemps/anaconda3/lib/python3.5/NanoTCAD_ViDES.py", line 1409,in __init__
x=unique(concatenate((uxC,xg),1));


This error comes every time I try to use grid3D (function). I call the function grid3D like this (function definition below):
gridD=grid3D(xg,yg,CNT.z,CNT.x,CNT.y,CNT.z);
I tried searching online but I couldn't get it to work. I am not sure where I am making a mistake. Any thoughts from Python experts will be very appreciated. I have Anaconda Python 3.5 installed on Ubuntu 16.04 with Scipy v0.17.1 Numpy 1.11.1

The grid3D function is defined as such (from the code provided):

Code:


class grid3D:
def __init__(self,*args):
    # I initialize the rank
    if(mpi4py_loaded):
        rank = MPI.COMM_WORLD.Get_rank()
    else:
        rank=0;
    # args is a tuple and len(args) return 
    # the number of arguments
    # the number of arguments can be either 3 or 6
    # if 3, the first three inputs are the grid along the
    # x,y,z axis
    # if 6, the first three inputs are the grid along the
    # x,y,z axis, while the last three inputs are the x-y-z
    # coordinates of the atoms
    if(len(args)>3):
        xg=around(args[0],5);
        yg=around(args[1],5);
        zg=around(args[2],5);
        xC=around(args[3],5);
        yC=around(args[4],5);
        zC=around(args[5],5);
        npC=size(xC);
    else:
        xg=around(args[0],5);
        yg=around(args[1],5);
        zg=around(args[2],5);
        npC=0;

    #I create the grid
    if(npC!=0):
        #find the unique values for xC,yC and zC
        uxC=unique(xC);
        uyC=unique(yC);
        uzC=unique(zC);

        # I find the only the additional values which are in xg and not in uxC
        # the same for the other axis
        exg=intersect1d(setxor1d(xg,uxC),xg);
        eyg=intersect1d(setxor1d(yg,uyC),yg);
        ezg=intersect1d(setxor1d(zg,uzC),zg);

    if(npC!=0):
        x=unique(concatenate((uxC,xg),1));
        y=unique(concatenate((uyC,yg),1));
        z=unique(concatenate((uzC,zg),1));
    else:
        x=xg;
        y=yg;
        z=zg;

Let's block ads! (Why?)



Out of index error using Python on NanoTCAD
Read more ...