build a pyemu.Cov instance from GeoStruct

                Parameters
                ----------
                x : (iterable of floats)
                    x-coordinate locations
                y : (iterable of floats)
                    y-coordinate locations
                names : (iterable of str)
                   (parameter) names of locations.

                Returns
                -------
                sparse : pyemu.SparseMatrix
                    the sparse covariance matrix implied by this GeoStruct for the x,y pairs.

                Example
                -------
                ``>>>pp_df = pyemu.pp_utils.pp_file_to_dataframe("hkpp.dat")``

                ``>>>cov = gs.covariance_matrix(pp_df.x,pp_df.y,pp_df.name)``

def sparse_covariance_matrix(self,x,y,names):
        """build a pyemu.Cov instance from GeoStruct

                Parameters
                ----------
                x : (iterable of floats)
                    x-coordinate locations
                y : (iterable of floats)
                    y-coordinate locations
                names : (iterable of str)
                   (parameter) names of locations.

                Returns
                -------
                sparse : pyemu.SparseMatrix
                    the sparse covariance matrix implied by this GeoStruct for the x,y pairs.

                Example
                -------
                ``>>>pp_df = pyemu.pp_utils.pp_file_to_dataframe("hkpp.dat")``

                ``>>>cov = gs.covariance_matrix(pp_df.x,pp_df.y,pp_df.name)``


                """

        if not isinstance(x, np.ndarray):
            x = np.array(x)
        if not isinstance(y, np.ndarray):
            y = np.array(y)
        assert x.shape[0] == y.shape[0]
        assert x.shape[0] == len(names)

        iidx = [i for i in range(len(names))]
        jidx = list(iidx)
        data = list(np.zeros(x.shape[0])+self.nugget)

        for v in self.variograms:
            v.add_sparse_covariance_matrix(x,y,names,iidx,jidx,data)
        coo = scipy.sparse.coo_matrix((data,(iidx,jidx)),shape=(len(names),len(names)))
        coo.eliminate_zeros()
        coo.sum_duplicates()
        return SparseMatrix(coo,row_names=names,col_names=names)