def check_point_data_dist(self, rectify=False):
        """ check for point_data entries that are closer than
        EPSILON distance - this will cause a singular kriging matrix.

        Parameters
        ----------
        rectify : (boolean)
            flag to fix the problems with point_data
            by dropping additional points that are
            closer than EPSILON distance.  Default is False

        Note
        ----
        this method will issue warnings for points that are closer
        than EPSILON distance

        """

        ptx_array = self.point_data.x.values
        pty_array = self.point_data.y.values
        ptnames = self.point_data.name.values
        drop = []
        for i in range(self.point_data.shape[0]):
            ix,iy,iname = ptx_array[i],pty_array[i],ptnames[i]
            dist = pd.Series((ptx_array[i+1:] - ix) ** 2 + (pty_array[i+1:] - iy) ** 2, ptnames[i+1:])
            if dist.min() < EPSILON**2:
                print(iname,ix,iy)
                warnings.warn("points {0} and {1} are too close. This will cause a singular kriging matrix ".\
                              format(iname,dist.idxmin()),PyemuWarning)
                drop_idxs = dist.loc[dist<=EPSILON**2]
                drop.extend([pt for pt in list(drop_idxs.index) if pt not in drop])
        if rectify and len(drop) > 0:
            print("rectifying point data by removing the following points: {0}".format(','.join(drop)))
            print(self.point_data.shape)
            self.point_data = self.point_data.loc[self.point_data.index.map(lambda x: x not in drop),:]
            print(self.point_data.shape)
def check_point_data_dist ( self , rectify = False ) : ptx_array = self . point_data . x . values pty_array = self . point_data . y . values ptnames = self . point_data . name . values drop = [ ] for i in range ( self . point_data . shape [ 0 ] ) : ix , iy , iname = ptx_array [ i ] , pty_array [ i ] , ptnames [ i ] dist = pd . Series ( ( ptx_array [ i + 1 : ] - ix ) ** 2 + ( pty_array [ i + 1 : ] - iy ) ** 2 , ptnames [ i + 1 : ] ) if dist . min ( ) < EPSILON ** 2 : print ( iname , ix , iy ) warnings . warn ( "points {0} and {1} are too close. This will cause a singular kriging matrix " . format ( iname , dist . idxmin ( ) ) , PyemuWarning ) drop_idxs = dist . loc [ dist <= EPSILON ** 2 ] drop . extend ( [ pt for pt in list ( drop_idxs . index ) if pt not in drop ] ) if rectify and len ( drop ) > 0 : print ( "rectifying point data by removing the following points: {0}" . format ( ',' . join ( drop ) ) ) print ( self . point_data . shape ) self . point_data = self . point_data . loc [ self . point_data . index . map ( lambda x : x not in drop ) , : ] print ( self . point_data . shape )
check for point_data entries that are closer than
        EPSILON distance - this will cause a singular kriging matrix.

        Parameters
        ----------
        rectify : (boolean)
            flag to fix the problems with point_data
            by dropping additional points that are
            closer than EPSILON distance.  Default is False

        Note
        ----
        this method will issue warnings for points that are closer
        than EPSILON distance