isochrones/starmodel_old.py
def lnprior(self, mass, age, feh,
                distance=None, AV=None, 
                use_local_fehprior=True):
        """
        log-prior for model parameters
        
        """
        mass_prior = salpeter_prior(mass)
        if mass_prior==0:
            mass_lnprior = -np.inf
        else:
            mass_lnprior = np.log(mass_prior)

        if np.isnan(mass_lnprior):
            logging.warning('mass prior is nan at {}'.format(mass))

        age_lnprior = np.log(age * (2/(self.ic.maxage**2-self.ic.minage**2)))
        if np.isnan(age_lnprior):
            logging.warning('age prior is nan at {}'.format(age))


        if use_local_fehprior:
            fehdist = local_fehdist(feh)
        else:
            fehdist = 1/(self.ic.maxfeh - self.ic.minfeh)
        feh_lnprior = np.log(fehdist)
        if np.isnan(feh_lnprior):
            logging.warning('feh prior is nan at {}'.format(feh))


        if distance is not None:
            if distance <= 0:
                distance_lnprior = -np.inf
            else:
                distance_lnprior = np.log(3/self.max_distance**3 * distance**2)
        else:
            distance_lnprior = 0
        if np.isnan(distance_lnprior):
            logging.warning('distance prior is nan at {}'.format(distance))


        if AV is not None:
            AV_lnprior = np.log(1/self.maxAV)
        else:
            AV_lnprior = 0
        if np.isnan(AV_lnprior):
            logging.warning('AV prior is nan at {}'.format(AV))
            

        lnprior = (mass_lnprior + age_lnprior + feh_lnprior + 
                distance_lnprior + AV_lnprior)

        return lnprior

        log-prior for model parameters
        
        
log-prior for model parameters
log - prior for model parameters
def lnprior(self, mass, age, feh,
                distance=None, AV=None, 
                use_local_fehprior=True):
        mass_prior = salpeter_prior(mass)
        if mass_prior==0:
            mass_lnprior = -np.inf
        else:
            mass_lnprior = np.log(mass_prior)
        if np.isnan(mass_lnprior):
            logging.warning('mass prior is nan at {}'.format(mass))
        age_lnprior = np.log(age * (2/(self.ic.maxage**2-self.ic.minage**2)))
        if np.isnan(age_lnprior):
            logging.warning('age prior is nan at {}'.format(age))
        if use_local_fehprior:
            fehdist = local_fehdist(feh)
        else:
            fehdist = 1/(self.ic.maxfeh - self.ic.minfeh)
        feh_lnprior = np.log(fehdist)
        if np.isnan(feh_lnprior):
            logging.warning('feh prior is nan at {}'.format(feh))
        if distance is not None:
            if distance <= 0:
                distance_lnprior = -np.inf
            else:
                distance_lnprior = np.log(3/self.max_distance**3 * distance**2)
        else:
            distance_lnprior = 0
        if np.isnan(distance_lnprior):
            logging.warning('distance prior is nan at {}'.format(distance))
        if AV is not None:
            AV_lnprior = np.log(1/self.maxAV)
        else:
            AV_lnprior = 0
        if np.isnan(AV_lnprior):
            logging.warning('AV prior is nan at {}'.format(AV))
        lnprior = (mass_lnprior + age_lnprior + feh_lnprior + 
                distance_lnprior + AV_lnprior)
        return lnprior
def lnprior ( self , mass , age , feh , distance = None , AV = None , use_local_fehprior = True ) : mass_prior = salpeter_prior ( mass ) if mass_prior == 0 : mass_lnprior = - np . inf else : mass_lnprior = np . log ( mass_prior ) if np . isnan ( mass_lnprior ) : logging . warning ( 'mass prior is nan at {}' . format ( mass ) ) age_lnprior = np . log ( age * ( 2 / ( self . ic . maxage ** 2 - self . ic . minage ** 2 ) ) ) if np . isnan ( age_lnprior ) : logging . warning ( 'age prior is nan at {}' . format ( age ) ) if use_local_fehprior : fehdist = local_fehdist ( feh ) else : fehdist = 1 / ( self . ic . maxfeh - self . ic . minfeh ) feh_lnprior = np . log ( fehdist ) if np . isnan ( feh_lnprior ) : logging . warning ( 'feh prior is nan at {}' . format ( feh ) ) if distance is not None : if distance <= 0 : distance_lnprior = - np . inf else : distance_lnprior = np . log ( 3 / self . max_distance ** 3 * distance ** 2 ) else : distance_lnprior = 0 if np . isnan ( distance_lnprior ) : logging . warning ( 'distance prior is nan at {}' . format ( distance ) ) if AV is not None : AV_lnprior = np . log ( 1 / self . maxAV ) else : AV_lnprior = 0 if np . isnan ( AV_lnprior ) : logging . warning ( 'AV prior is nan at {}' . format ( AV ) ) lnprior = ( mass_lnprior + age_lnprior + feh_lnprior + distance_lnprior + AV_lnprior ) return lnprior
log-prior for model parameters
log - prior for model parameters
"""
        log-prior for model parameters
        
        """
self
mass
age
feh
distance
AV
use_local_fehprior