How to use the getdist.types.BestFit function in getdist

To help you get started, we’ve selected a few getdist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cmbant / getdist / paramgrid / batchjob.py View on Github external
def chainBestfit(self, paramNameFile=None):
        bf_file = self.chainRoot + '.minimum'
        if nonEmptyFile(bf_file):
            return types.BestFit(bf_file, paramNameFile)
        return None
github cmbant / getdist / getdist / mcsamples.py View on Github external
def getBestFit(self, max_posterior=True):
        """
        Returns a :class:`~.types.BestFit` object with best-fit point stored in .minimum or .bestfit file

       :param max_posterior: whether to get maximum posterior (from .minimum file)
                             or maximum likelihood (from .bestfit file)
       :return:
        """
        ext = '.minimum' if max_posterior else '.bestfit'
        bf_file = self.root + ext
        if os.path.exists(bf_file):
            return types.BestFit(bf_file, max_posterior=max_posterior)
        else:
            raise MCSamplesError('Best fit can only be included if loaded from file and file_root%s exists '
                                 '(cannot be calculated from samples)' % ext)