Beispiel #1
0
def get_lhood_names( mcf ) :
    lhd = ld.get_lhood_dict()
    out = OrderedDict()
    mcvars=v.mc_variables()
    filename=getattr( mcf, "LHoodFile", None )
    if filename is not None :
        with open(filename, 'rb') as f:
            for line in f :
                name = line[:-1] #cut EOL
                out[name] = lhd[name]["name"] 
    return out
Beispiel #2
0
def get_lhood_from_file( mcf ) :
    lhs = ld.get_lhood_dict()
    mcvars=v.mc_variables()
    out = OrderedDict()
    filename=getattr( mcf, "LHoodFile", None )
    if filename is not None :
        with open(filename, 'rb') as f:
            for line in f :
                name = line[:-1] #cut EOL
                if name in lhs :
                    var_ints = [ mcvars[varname].get_index(mcf) for varname in lhs[name]["vars"]  ]
                    out[name] = lhm.LHood( var_ints, lhs[name] )
                else :
                    print "Unknown Likelihood: %s, ignoring!" % name
    return out