def rebuild(self, rcobj = None, force_new_axis = False ):
        new_axis = False
        if self.o == None or self.z == None or self.vecxz == None:
            new_axis = True
        if not new_axis:
            if self.o.__class__.__name__.find('Point') == -1:
                self.o = Point( np.array([ 0,0,0 ], dtype=FLOAT ) )
            if self.z == None:
                print 'Please, enter a valid z axis...'
                raise
            if self.vecxz == None:
                print 'Please, enter a valid vector in the xz plane...'
                raise
            if self.z.__class__.__name__.find('Vec') == -1:
                self.z = Vec( self.z )
            if self.vecxz.__class__.__name__.find('Vec') == -1:
                self.vecxz = Vec( self.vecxz )
        if new_axis or force_new_axis:
            if self.model == None:
                print 'The coordinate system must belong to a model...'
                print 'the user may create a coordsys giving directly:'
                print '- origin as a alg3dpy.Point'
                print '- z axis as a alg3dpy.Vec'
                print '- alg3dpy.Vec laying on xz plane'
                raise
            if   self.a1 <> None and self.a2 <> None and self.a3 <> None \
            and  self.b1 <> None and self.b2 <> None and self.b3 <> None \
            and  self.c1 <> None and self.c2 <> None and self.c3 <> None:
                self.rcobj = self.model.coorddict[ int(self.rcid) ]
                if self.rcobj.rebuilt:
                    #FIXME destroying the reference to rcobj original
                    p1 = np.array([self.a1, self.a2, self.a3], dtype=FLOAT)
                    p2 = np.array([self.b1, self.b2, self.b3], dtype=FLOAT)
                    p3 = np.array([self.c1, self.c2, self.c3], dtype=FLOAT)
                    CSYSGLOBAL = mapy.constants.CSYSGLOBAL
                    p1 = self.rcobj.transform( p1, CSYSGLOBAL )
                    p2 = self.rcobj.transform( p2, CSYSGLOBAL )
                    p3 = self.rcobj.transform( p3, CSYSGLOBAL )
                    self.rcid  = CSYSGLOBAL.id 
                    self.rcobj  = CSYSGLOBAL
                    self.o     = p1
                    self.z     = p1 - p2
                    self.vecxz = p3 - p1

                else:
                    print 'The coordsys cannot be rebuilt. The reference'
                    print 'coordsys given by rcid is not rebuilt...'
                    raise
            elif self.ida <> None\
            and  self.g1a <> None and self.g2a <> None and self.g3a <> None:
                g1a       = self.model.griddict[ int(self.g1a) ]
                g2a       = self.model.griddict[ int(self.g2a) ]
                g3a       = self.model.griddict[ int(self.g3a) ]
                if not g1a.rebuilt \
                or not g2a.rebuilt \
                or not g3a.rebuilt:
                    print 'The coordsys cannot be rebuilt. The reference'
                    print 'grids g1a, g2a and g3a are not rebuilt...'
                    raise
                self.o     = Point( g1a.array )
                self.z     = g2a - g1a
                self.vecxz = g3a - g1a 
            else:
                print 'Something wrong with your inputs'
                print 'Please, see all the attributes below:'
                for slot in self.__slots__:
                    print '\t' + slot + '', getattr(self, slot)
                raise 

        self.y  = self.z.cross( self.vecxz )
        self.x  = self.y.cross(     self.z )
        self.xy = Plane(  self.z[0],  self.z[1],  self.z[2], self.o.mod() ) 
        self.xz = Plane( -self.y[0], -self.y[1], -self.y[2], self.o.mod() )
        self.yz = Plane(  self.x[0],  self.x[1],  self.x[2], self.o.mod() )
        self.rebuilt = True
dataset/ETHPy150Open saullocastro/mapy/mapy/model/coords.py/Coord.rebuild/swapped operands of `-`