build a prior parameter covariance matrix.

        Parameters
        ----------
            fmt : str
                the format to save the cov matrix.  Options are "ascii","binary","uncfile", "coo".
                default is "ascii"
            filename : str
                the filename to save the prior cov matrix to.  If None, the name is formed using
                model nam_file name.  Default is None.
            droptol : float
                tolerance for dropping near-zero values when writing compressed binary.
                Default is None
            chunk : int
                chunk size to write in a single pass - for binary only
            sparse : bool
                flag to build a pyemu.SparseMatrix format cov matrix.  Default is False
            sigma_range : float
                number of standard deviations represented by the parameter bounds.  Default
                is 6.

        Returns
        -------
            cov : pyemu.Cov
            a full covariance matrix

def build_prior(self, fmt="ascii",filename=None,droptol=None, chunk=None, sparse=False,
                    sigma_range=6):
        """ build a prior parameter covariance matrix.

        Parameters
        ----------
            fmt : str
                the format to save the cov matrix.  Options are "ascii","binary","uncfile", "coo".
                default is "ascii"
            filename : str
                the filename to save the prior cov matrix to.  If None, the name is formed using
                model nam_file name.  Default is None.
            droptol : float
                tolerance for dropping near-zero values when writing compressed binary.
                Default is None
            chunk : int
                chunk size to write in a single pass - for binary only
            sparse : bool
                flag to build a pyemu.SparseMatrix format cov matrix.  Default is False
            sigma_range : float
                number of standard deviations represented by the parameter bounds.  Default
                is 6.

        Returns
        -------
            cov : pyemu.Cov
            a full covariance matrix

        """

        fmt = fmt.lower()
        acc_fmts = ["ascii","binary","uncfile","none","coo"]
        if fmt not in acc_fmts:
            self.logger.lraise("unrecognized prior save 'fmt':{0}, options are: {1}".
                               format(fmt,','.join(acc_fmts)))

        self.log("building prior covariance matrix")
        struct_dict = {}
        if self.pp_suffix in self.par_dfs.keys():
            pp_df = self.par_dfs[self.pp_suffix]
            pp_dfs = []
            for pargp in pp_df.pargp.unique():
                gp_df = pp_df.loc[pp_df.pargp==pargp,:]
                p_df = gp_df.drop_duplicates(subset="parnme")
                pp_dfs.append(p_df)
            #pp_dfs = [pp_df.loc[pp_df.pargp==pargp,:].copy() for pargp in pp_df.pargp.unique()]
            struct_dict[self.pp_geostruct] = pp_dfs
        if self.gr_suffix in self.par_dfs.keys():
            gr_df = self.par_dfs[self.gr_suffix]
            gr_dfs = []
            for pargp in gr_df.pargp.unique():
                gp_df = gr_df.loc[gr_df.pargp==pargp,:]
                p_df = gp_df.drop_duplicates(subset="parnme")
                gr_dfs.append(p_df)
            #gr_dfs = [gr_df.loc[gr_df.pargp==pargp,:].copy() for pargp in gr_df.pargp.unique()]
            struct_dict[self.grid_geostruct] = gr_dfs
        if "temporal_list" in self.par_dfs.keys():
            bc_df = self.par_dfs["temporal_list"]
            bc_df.loc[:,"y"] = 0
            bc_df.loc[:,"x"] = bc_df.timedelta.apply(lambda x: x.days)
            bc_dfs = []
            for pargp in bc_df.pargp.unique():
                gp_df = bc_df.loc[bc_df.pargp==pargp,:]
                p_df = gp_df.drop_duplicates(subset="parnme")
                #print(p_df)
                bc_dfs.append(p_df)
            #bc_dfs = [bc_df.loc[bc_df.pargp==pargp,:].copy() for pargp in bc_df.pargp.unique()]
            struct_dict[self.temporal_list_geostruct] = bc_dfs
        if "spatial_list" in self.par_dfs.keys():
            bc_df = self.par_dfs["spatial_list"]
            bc_dfs = []
            for pargp in bc_df.pargp.unique():
                gp_df = bc_df.loc[bc_df.pargp==pargp,:]
                #p_df = gp_df.drop_duplicates(subset="parnme")
                #print(p_df)
                bc_dfs.append(gp_df)
            struct_dict[self.spatial_list_geostruct] = bc_dfs
        if "hfb" in self.par_dfs.keys():
            if self.spatial_list_geostruct in struct_dict.keys():
                struct_dict[self.spatial_list_geostruct].append(self.par_dfs["hfb"])
            else:
                struct_dict[self.spatial_list_geostruct] = [self.par_dfs["hfb"]]

        if "sfr" in self.par_dfs.keys():
            self.logger.warn("geospatial prior not implemented for SFR pars")

        if len(struct_dict) > 0:
            if sparse:
                cov = pyemu.helpers.sparse_geostatistical_prior_builder(self.pst,
                                                                        struct_dict=struct_dict,
                                                                        sigma_range=sigma_range)

            else:
                cov = pyemu.helpers.geostatistical_prior_builder(self.pst,
                                                             struct_dict=struct_dict,
                                                             sigma_range=sigma_range)
        else:
            cov = pyemu.Cov.from_parameter_data(self.pst,sigma_range=sigma_range)

        if filename is None:
            filename = os.path.join(self.m.model_ws,self.pst_name+".prior.cov")
        if fmt != "none":
            self.logger.statement("saving prior covariance matrix to file {0}".format(filename))
        if fmt == 'ascii':
            cov.to_ascii(filename)
        elif fmt == 'binary':
            cov.to_binary(filename,droptol=droptol,chunk=chunk)
        elif fmt == 'uncfile':
            cov.to_uncfile(filename)
        elif fmt == 'coo':
            cov.to_coo(filename,droptol=droptol,chunk=chunk)
        self.log("building prior covariance matrix")
        return cov