示例#1
0
    def make_star2_isochrone(self,
                             age,
                             Ks_ext,
                             dist,
                             phase,
                             met,
                             use_atm_func='merged'):
        self.Ks_ext = Ks_ext

        self.dist = dist * u.pc
        self.default_dist = dist
        ## Revise prior bounds for distance
        self.lo_dist_prior_bound = 0.8 * dist
        self.hi_dist_prior_bound = 1.2 * dist

        self.age = age
        self.met = met

        self.star2_isochrone = isoc_interp.isochrone_mist(
            age=age,
            ext=Ks_ext,
            dist=dist,
            phase=phase,
            met=met,
            use_atm_func=use_atm_func)

        ## Convert from specified extinction in Ks to Kp and H
        self.Kp_ext = Ks_ext * (self.lambda_Ks /
                                self.lambda_Kp)**self.ext_alpha
        self.H_ext = Ks_ext * (self.lambda_Ks / self.lambda_H)**self.ext_alpha
示例#2
0
    def make_pop_isochrone(self,
                           isoc_age=4.0e6,
                           isoc_ext_Ks=2.54,
                           isoc_dist=7.971e3,
                           isoc_phase=None,
                           isoc_met=0.0):
        # Store out isochrone parameters into object
        self.isoc_age = isoc_age,
        self.isoc_ext = isoc_ext_Ks,
        self.isoc_dist = isoc_dist,
        self.isoc_phase = isoc_phase,
        self.isoc_met = isoc_met

        # Generate isoc_interp object
        self.pop_isochrone = isoc_interp.isochrone_mist(age=isoc_age,
                                                        ext=isoc_ext_Ks,
                                                        dist=isoc_dist,
                                                        phase=isoc_phase,
                                                        met=isoc_met,
                                                        use_atm_func='phoenix')

        # Also set population extinction based on isochrone extinction
        ## Filter properties
        lambda_Ks = 2.18e-6 * u.m
        dlambda_Ks = 0.35e-6 * u.m

        lambda_Kp = 2.124e-6 * u.m
        dlambda_Kp = 0.351e-6 * u.m

        lambda_H = 1.633e-6 * u.m
        dlambda_H = 0.296e-6 * u.m

        ## Calculate default population extinction
        self.ext_Kp = isoc_ext_Ks * (lambda_Ks / lambda_Kp)**self.ext_alpha
        self.ext_H = isoc_ext_Ks * (lambda_Ks / lambda_H)**self.ext_alpha
示例#3
0
#!/usr/bin/env python

# Isochrone interpolation tester
# ---
# Abhimat Gautam

from phoebe_phitter import isoc_interp

import numpy as np

isochrone = isoc_interp.isochrone_mist(age=3.9e6,
                                       ext=2.63,
                                       dist=7.971e3,
                                       phase='MS')

interp_params_full, interp_params_lc = isochrone.rad_interp(5.)

print(interp_params_full)
print(interp_params_lc)

interp_params_full, interp_params_lc = isochrone.rad_interp(10.)

print(interp_params_full)
print(interp_params_lc)

interp_params_full, interp_params_lc = isochrone.mass_init_interp(5.)

print(interp_params_full)
print(interp_params_lc)

interp_params_full, interp_params_lc = isochrone.mass_init_interp(10.)
binary_q_samps = np.empty(num_samples)
binary_q_init_samps = np.empty(num_samples)

## Fit Characteristics
fit_chi2red_samps = np.empty(num_samples)
fit_BIC_samps = np.empty(num_samples)

# Generate PopStar isochrone
from popstar import synthetic, evolution, atmospheres, reddening
from popstar.imf import imf, multiplicity

from phoebe_phitter import isoc_interp

## Parameters for PopStar isochrone
isochrone = isoc_interp.isochrone_mist(age=isoc_age, ext=isoc_ext,
                                       dist=isoc_dist, phase=isoc_phase,
                                       met=isoc_met, use_atm_func=isoc_atm_func)


# Derive stellar and binary parameters for each sample
for cur_samp_num in tqdm(range(num_samples)):
    cur_star1_rad = star1_rad_samps[cur_samp_num]
    cur_star2_rad = star2_rad_samps[cur_samp_num]
    cur_binary_period = binary_per_samps[cur_samp_num] * u.d

    ## Stellar parameters from isochrone
    (star1_params_all, star1_params_lcfit) = isochrone.rad_interp(cur_star1_rad)
    (star2_params_all, star2_params_lcfit) = isochrone.rad_interp(cur_star2_rad)

    (cur_star1_mass_init, cur_star1_mass, cur_star1_rad, cur_star1_lum,
        cur_star1_teff, cur_star1_logg, cur_star1_mag_Kp, cur_star1_mag_H,