Commit 4c217371 by Laura Ketzer

### worked on evolve_planet, to evolve OwWu17 sample (each planet has a different...

`worked on evolve_planet, to evolve OwWu17 sample (each planet has a different host star) along various tracks`
parent 2ec4c611
 ... ... @@ -87,7 +87,6 @@ def Lx_evo(t, track_dict): else: # normal case, i.e. slope past t_curr given by input parameters alpha = (np.log10(Lx_5Gyr/Lx_curr))/(np.log10(t_5Gyr/t_curr)) print(alpha) k = 10**(np.log10(Lx_curr) - alpha*np.log10(t_curr)) Lx = powerlaw(t, k, alpha) ... ... @@ -103,7 +102,6 @@ def Lx_evo(t, track_dict): if t >= t_sat: #and t <= t_curr: # only data in power law regime alpha = (np.log10(Lx_curr/Lx_max))/(np.log10(t_curr/t_sat)) print(alpha) k = 10**(np.log10(Lx_max) - alpha*np.log10(t_sat)) Lx = powerlaw(t, k, alpha) ... ... @@ -195,3 +193,18 @@ def undo_what_Lxuv_all_does(L_xuv): def calculate_Lx_sat(L_star_bol): """ Typical relation (from observations) to estimate the saturation X-ray luminosity given a bolometric luminosity.""" return 10**(-3)*(L_star_bol*const.L_sun.cgs).value def L_high_energy(t_i, mass_star): """ L_HE (UV to X-ray) in Owen & Wu (2017). @param t_i - in Myr @param mass_star - in solar masses """ t_sat = 100. # Myr L_sat = 10**(-3.5)*(mass_star) * (const.L_sun.cgs).value a_0 = 0.5 if t_i < t_sat: L_HE = L_sat elif t_i >= t_sat: L_HE = L_sat*(t_i/t_sat)**(-1-a_0) return L_HE # in erg/s \ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
No preview for this file type
 ... ... @@ -8,7 +8,7 @@ sys.path.append('../plaml_package/') # Planet Class from Planet_class_LoFo14 import planet_LoFo14 from Planet_class_Ot20 import planet_Ot20 from Lx_evo_and_flux import undo_what_Lxuv_all_does from Lx_evo_and_flux import undo_what_Lxuv_all_does, L_high_energy def evolve_one_planet(pl_folder_pair, t_final, init_step, eps, K_on, beta_on, evo_track_dict_list_or_1, path_for_saving): ... ... @@ -55,19 +55,56 @@ def evolve_one_planet(pl_folder_pair, t_final, init_step, eps, K_on, beta_on, ev path_for_saving=path_for_saving, planet_folder_id=folder) else: # evolve on planet along more than one track (e.g. to see effects of different tracks on planetary evolution) for track in evo_track_dict_list: # either the dictionary in the list already contains ALL nine parameters (then continue) if len(evo_track_dict_list_or_1[0]) == 9: pl = pl_folder_pair[1] folder = pl_folder_pair[0] pl.set_name(t_final, init_step, eps, K_on, beta_on, evo_track_dict=track) # set planet name based on specified track # generate a useful planet name for saving the results pl_file_name = folder + "_track" + pl.planet_id.split("_track")[1] + ".txt" if os.path.isdir(path_for_saving+pl_file_name): # skip & don't evolve planet # print("Folder "+pl_file_name+" exists.") pass else: pl.evolve_forward(t_final, init_step, eps, K_on, beta_on, evo_track_dict=track, path_for_saving=path_for_saving, planet_folder_id=folder) for track in evo_track_dict_list: pl.set_name(t_final, init_step, eps, K_on, beta_on, evo_track_dict=track) # set planet name based on specified track # generate a useful planet name for saving the results pl_file_name = folder + "_track" + pl.planet_id.split("_track")[1] + ".txt" if os.path.isdir(path_for_saving+pl_file_name): # skip & don't evolve planet # print("Folder "+pl_file_name+" exists.") pass else: pl.evolve_forward(t_final, init_step, eps, K_on, beta_on, evo_track_dict=track, path_for_saving=path_for_saving, planet_folder_id=folder) else: # calculate missing parameters based on individual planet (host star is different!!) Lx_solar = L_high_energy(1., 1.0) # value with which to shift Lx_1Gyr & Lx_5Gyr using OwWu17 Lx_sat # if I use Tu Lx values, then I should change the solar saturation value to what they use! #Lx_solar = 10**(-3.13)*const.L_sun.cgs.value pl = pl_folder_pair[1] folder = pl_folder_pair[0] # get factor with which to scale tracks up or down scaling_factor = pl.Lx_age/Lx_solar #Lx_age_approx = 10**(-3)*(10**mass_luminosity_relation(smass))*const.L_sun.cgs.value # create dictionaries with all the values necessary to create the evolutionary paths (tracks converge at 1 Gyr!) Lx_1Gyr = 2.10*10**28 * scaling_factor # Lx value at 1 Gyr from Tu et al. (2015) model tracks (scaled) Lx_5Gyr = 1.65*10**27 * scaling_factor # Lx value at 5 Gyr from Tu et al. (2015) model tracks (scaled) for t in evo_track_dict_list_or_1: same_track_params = {"t_start": pl.age, "t_curr": 1e3, "t_5Gyr": 5e3, "Lx_curr": Lx_1Gyr, "Lx_5Gyr": Lx_5Gyr, "Lx_max": pl.Lx_age} # combine the same_track params with different track params for a complete track dictionary track = same_track_params.copy() track.update(t) #print(track) pl.set_name(t_final, init_step, eps, K_on, beta_on, evo_track_dict=track) # set planet name based on specified track # generate a useful planet name for saving the results pl_file_name = folder + "_track" + pl.planet_id.split("_track")[1] + ".txt" if os.path.isdir(path_for_saving+pl_file_name): # skip & don't evolve planet # print("Folder "+pl_file_name+" exists.") pass else: pl.evolve_forward(t_final, init_step, eps, K_on, beta_on, evo_track_dict=track, path_for_saving=path_for_saving, planet_folder_id=folder) def evolve_ensamble(planets_chunks, t_final, init_step, eps, K_on, beta_on, evo_track_dict_list_or_1, path_save): ... ...
 import numpy as np import pandas as pd from scipy import interpolate def M_L_relation(): """ main-sequencen mass-luminosity relation""" # this is from Thomas, I am not sure where exactly it comes from df = pd.read_csv("../supplementary_files/ZAMS_online.dat", header="infer", sep="\s+") logL_from_M = interpolate.interp1d(df["Mass"], np.log10(df["Lbol"]), kind="quadratic") return logL_from_M \ No newline at end of file
 star_id,mass_star,radius_star,age,Lbol,Lx_age star_age1.0_mass0.72,0.7184941392412282,None,1.0,1.0,1.392369397981642e+29 \ No newline at end of file
 a,core_mass,fenv,mass,radius,metallicity,age 0.1385481957745512,4.266318510202839,21.077576557608428,5.405711487454493,11.691119046005358,solarZ,1.0 \ No newline at end of file
This diff is collapsed.
 a,core_mass,fenv,mass,radius,metallicity,track 0.1385481957745512,4.266318510202839,15.578695623472305,5.053604112979136,4.846603075263876,solarZ,planet_0001_track_1.0_100.0_5000.0_1.392369397981642e+29_0.0_0.0 \ No newline at end of file
 t_start,t_sat,t_curr,t_5Gyr,Lx_max,Lx_curr,Lx_5Gyr,dt_drop,Lx_drop_factor 1.0,100.0,5000.0,5000.0,1.392369397981642e+29,3.9382153729178e+26,3.9382153729178e+26,0.0,0.0 \ No newline at end of file
 star_id,mass_star,radius_star,age,Lbol,Lx_age star_age1.0_mass1.01,1.0097333169215508,None,1.0,1.0,2.047074262504397e+29 \ No newline at end of file
 a,core_mass,fenv,mass,radius,metallicity,age 0.2552748377979306,8.327241668651112,1.274857470980825,8.434773002432902,3.389666871505346,solarZ,1.0 \ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!