Example #1
0
 def loadJobItemResults(self, paramNameFile=None, bestfit=True, bestfitonly=False, noconverge=False, silent=False):
     self.result_converge = None
     self.result_marge = None
     self.result_likemarge = None
     self.result_bestfit = self.chainBestfit(paramNameFile)
     if not bestfitonly:
         marge_root = self.distRoot
         if self.getDistExists():
             if not noconverge: self.result_converge = types.ConvergeStats(marge_root + '.converge')
             self.result_marge = types.MargeStats(marge_root + '.margestats', paramNameFile)
             self.result_likemarge = types.LikeStats(marge_root + '.likestats')
             if self.result_bestfit is not None and bestfit: self.result_marge.addBestFit(self.result_bestfit)
         elif not silent:
             print('missing: ' + marge_root)
def margeParamTex(rootname, params=None, limit=1, paramNameFile=None):
    """ Get tex snippet for constraint on parameters in params """
    if not '.margestats' in rootname: rootname += '.margestats'
    marge = types.MargeStats(rootname, paramNameFile)
    if not params: params = marge.list()

    formatter = types.NoLineTableFormatter()
    texs = []
    labels = []
    for par in params:
        tex = marge.texValues(formatter, par, limit=limit)
        if tex is not None:
            texs.append(tex[0])
            labels.append(marge.parWithName(par).label)
        else:
            texs.append(None)
            labels.append(None)

    return params, labels, texs