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)
            names of location. If None, cov must not be None.  Default is None.
        cov : (pyemu.Cov) instance
            an existing Cov instance.  The contribution of this GeoStruct is added
            to cov.  If cov is None, names must not be None. Default is None

        Returns
        -------
        cov : pyemu.Cov
            the covariance matrix implied by this GeoStruct for the x,y pairs.
            cov has row and column names supplied by the names argument unless
            the "cov" argument was passed.

        Note
        ----
        either "names" or "cov" must be passed.  If "cov" is passed, cov.shape
        must equal len(x) and len(y).

        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 covariance_matrix(self,x,y,names=None,cov=None):
        """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)
            names of location. If None, cov must not be None.  Default is None.
        cov : (pyemu.Cov) instance
            an existing Cov instance.  The contribution of this GeoStruct is added
            to cov.  If cov is None, names must not be None. Default is None

        Returns
        -------
        cov : pyemu.Cov
            the covariance matrix implied by this GeoStruct for the x,y pairs.
            cov has row and column names supplied by the names argument unless
            the "cov" argument was passed.

        Note
        ----
        either "names" or "cov" must be passed.  If "cov" is passed, cov.shape
        must equal len(x) and len(y).

        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]

        if names is not None:
            assert x.shape[0] == len(names)
            c = np.zeros((len(names),len(names)))
            np.fill_diagonal(c,self.nugget)
            cov = Cov(x=c,names=names)
        elif cov is not None:
            assert cov.shape[0] == x.shape[0]
            names = cov.row_names
            c = np.zeros((len(names),1))
            c += self.nugget
            cont = Cov(x=c,names=names,isdiagonal=True)
            cov += cont

        else:
            raise Exception("GeoStruct.covariance_matrix() requires either " +
                            "names or cov arg")
        for v in self.variograms:
            v.covariance_matrix(x,y,cov=cov)
        return cov