def lnlike(self, p):
if not self._props_cleaned:<EOL><INDENT>self._clean_props()<EOL><DEDENT>if not self.use_emcee:<EOL><INDENT>fit_for_distance = True<EOL>mass, age, feh, dist, AV = (p[<NUM_LIT:0>], p[<NUM_LIT:1>], p[<NUM_LIT:2>], p[<NUM_LIT:3>], p[<NUM_LIT:4>])<EOL><DEDENT>else:<EOL><INDENT>if len(p)==<NUM_LIT:5>:<EOL><INDENT>fit_for_distance = True<EOL>mass,age,feh,dist,AV = p<EOL><DEDENT>elif len(p)==<NUM_LIT:3>:<EOL><INDENT>fit_for_distance = False<EOL>mass,age,feh = p<EOL><DEDENT><DEDENT>if mass < self.ic.minmass or mass > self.ic.maxmassor age < self.ic.minage or age > self.ic.maxageor feh < self.ic.minfeh or feh > self.ic.maxfeh:<EOL><INDENT>return -np.inf<EOL><DEDENT>if fit_for_distance:<EOL><INDENT>if dist < <NUM_LIT:0> or AV < <NUM_LIT:0> or dist > self.max_distance:<EOL><INDENT>return -np.inf<EOL><DEDENT>if AV > self.maxAV:<EOL><INDENT>return -np.inf<EOL><DEDENT><DEDENT>if self.min_logg is not None:<EOL><INDENT>logg = self.ic.logg(mass,age,feh)<EOL>if logg < self.min_logg:<EOL><INDENT>return -np.inf<EOL><DEDENT><DEDENT>logl = <NUM_LIT:0><EOL>for prop in self.properties.keys():<EOL><INDENT>try:<EOL><INDENT>val,err = self.properties[prop]<EOL><DEDENT>except TypeError:<EOL><INDENT>continue<EOL><DEDENT>if prop in self.ic.bands:<EOL><INDENT>if not fit_for_distance:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>mod = self.ic.mag[prop](mass,age,feh) + <NUM_LIT:5>*np.log10(dist) - <NUM_LIT:5><EOL>A = AV*EXTINCTION[prop]<EOL>mod += A<EOL><DEDENT>elif re.search('<STR_LIT>',prop):<EOL><INDENT>continue<EOL><DEDENT>elif prop=='<STR_LIT>':<EOL><INDENT>mod = feh<EOL><DEDENT>elif prop=='<STR_LIT>':<EOL><INDENT>mod = <NUM_LIT:1.>/dist * <NUM_LIT:1000><EOL><DEDENT>else:<EOL><INDENT>mod = getattr(self.ic,prop)(mass,age,feh)<EOL><DEDENT>logl += -(val-mod)**<NUM_LIT:2>/(<NUM_LIT:2>*err**<NUM_LIT:2>) + np.log(<NUM_LIT:1>/(err*np.sqrt(<NUM_LIT:2>*np.pi)))<EOL><DEDENT>if np.isnan(logl):<EOL><INDENT>logl = -np.inf<EOL><DEDENT>return logl<EOL>
Log-likelihood of model at given parameters


        :param p: 
            mass, log10(age), feh, [distance, A_V (extinction)].
            Final two should only be provided if ``self.fit_for_distance``
            is ``True``; that is, apparent magnitudes are provided.

        :return:
           log-likelihood.  Will be -np.inf if values out of range.