def plot_mass(loa_omegas, loa_omega_names, version_string, expl_string): #plot stellar mass and total mass vis_obj = visualize(loa_omegas, loa_omega_names, num_yaxes=2) vis_obj.add_time_mass("locked", index_yaxis=0) vis_obj.add_time_mass("total", index_yaxis=1) vis_obj.add_datapoint( (eris_data().mass["time"][0], eris_data().mass["total_mass"][0]), index_yaxis=1, label="M_b(z=0)") vis_obj.add_datapoint( (eris_data().mass["time"][1], eris_data().mass["total_mass"][1]), index_yaxis=1, label="M_b(z=1)") vis_obj.finalize(show=False, save="data/mass_parameters_%s_n%d" % (version_string, num_steps)) #save "gas_mass" and "m_locked" for i, mass_type in enumerate(["gas_mass", "m_locked", "m_tot"]): save_obj = save_data(loa_omegas) save_obj.make_filenames("data/mass_parameters_%s_%d_n%d" % (version_string, i, num_steps)) save_obj.make_explanatory_file( "mass arrays of %s \n%s" % (mass_type, expl_string), ["time"] + loa_omega_names, "Applying mass parameters to 'Eris' parameters") save_obj.make_numpy_file(["time", mass_type])
def plot_spectro(loa_omegas, loa_omega_names, version_string, expl_string, exclude_eu=False): #Plot spectroscopic data for [O/H], [Fe/H], [Eu/H] vis_obj = visualize(loa_omegas, loa_omega_names, num_yaxes=3, loa_abu=[], loa_spectro_abu=["[O/H]", "[Fe/H]", "[Eu/H]"]) vis_obj.add_time_relabu("[O/H]", index_yaxis=0) vis_obj.add_time_relabu("[Fe/H]", index_yaxis=1) vis_obj.add_time_relabu("[Eu/H]", index_yaxis=2) vis_obj.finalize(show=False, save="data/star_parameters_%s_n%d" % (version_string, num_steps)) #save data from spectroscopic plots for i, spectro_string in enumerate(["[O/H]", "[Fe/H]", "[Eu/H]"]): save_obj = save_data(loa_omegas) save_obj.make_filenames("data/star_parameters_%s_%d_n%d" % (version_string, i, num_steps)) save_obj.make_explanatory_file( "spectroscopic arrays of %s \n%s" % (spectro_string, expl_string), ["time"] + loa_omega_names, "Applying star-parameters to 'Omega' with mass-parameters determined" ) save_obj.make_numpy_file(["time", spectro_string])
def plot_spectro(loa_omegas, loa_omega_names, expl_string): filename = "spectro_n%d" % (num_steps) #Plot spectroscopic data for [O/H], [Fe/H], [Eu/H] vis_obj = visualize(loa_omegas, loa_omega_names, num_yaxes=3) vis_obj.add_time_relabu("[O/H]", index_yaxis=0) vis_obj.add_time_relabu("[Fe/H]", index_yaxis=1) vis_obj.add_time_relabu("[Eu/H]", index_yaxis=2) vis_obj.finalize(show=False, save=filename + ".png") #save data from spectroscopic plots for i, spectro_string in enumerate(["[O/H]", "[Fe/H]", "[Eu/H]"]): save_obj = save_data(loa_omegas) save_obj.make_filenames(filename + "_param%d" % i) save_obj.make_explanatory_file( "spectroscopic arrays of %s \n%s" % (spectro_string, expl_string), ["time"] + loa_omega_names, "Final 'Eris'-bestfit of 'Omega'") save_obj.make_numpy_file(["time", spectro_string])
def plot_rates(loa_omegas, loa_omega_names, expl_string): filename = "rates_n%d" % (num_steps) #plot star-formation, kilonova, and supernova rates vis_obj = visualize(loa_omegas, loa_omega_names, num_yaxes=3) vis_obj.add_time_rate("sf", index_yaxis=0) vis_obj.add_time_rate("sn", index_yaxis=1) vis_obj.add_time_rate("kn", index_yaxis=2) vis_obj.finalize(show=False, save=filename + ".png") #save data from rates for i, rate_key in enumerate(["sf", "sn2", "nsns"]): save_obj = save_data(loa_omegas) save_obj.make_filenames(filename + "_param%d" % i) save_obj.make_explanatory_file( "Rate arrays of %s \n%s" % (rate_key, expl_string), ["time"] + loa_omega_names, "Final 'Eris'-bestfit of 'Omega'") save_obj.make_numpy_file(["time", rate_key])
def plot_rates(loa_omegas, loa_omega_names, version_string, expl_string): #plot star-formation, kilonova, and supernova rates vis_obj = visualize(loa_omegas, loa_omega_names, num_yaxes=3) vis_obj.add_time_rate("sf", index_yaxis=0) vis_obj.add_time_rate("sn", index_yaxis=1) vis_obj.add_time_rate("kn", index_yaxis=2) vis_obj.finalize(show=False, save="data/mass_parameters_%s_n%d" % (version_string, num_steps)) #save data from rates for i, rate_key in enumerate(["sf", "sn2", "nsns"]): save_obj = save_data(loa_omegas) save_obj.make_filenames("data/mass_parameters_%s_%d_n%d" % (version_string, i, num_steps)) save_obj.make_explanatory_file( "Rate arrays of %s \n%s" % (rate_key, expl_string), ["time"] + loa_omega_names, "Applying mass parameters to 'Eris' parameters") save_obj.make_numpy_file(["time", rate_key])
def plot_mass(loa_omegas, loa_omega_names, expl_string): filename = "masses_n%d" % (num_steps) #plot stellar mass and total mass vis_obj = visualize(loa_omegas, loa_omega_names, num_yaxes=2) vis_obj.add_time_mass("locked", index_yaxis=0) vis_obj.add_time_mass("total", index_yaxis=1) vis_obj.add_datapoint( (eris_data().mass["time"][0], eris_data().mass["total_mass"][0]), index_yaxis=1, label="M_b(z=0)") vis_obj.add_datapoint( (eris_data().mass["time"][1], eris_data().mass["total_mass"][1]), index_yaxis=1, label="M_b(z=1)") vis_obj.finalize(show=False, save=filename + ".png") #save "gas_mass" and "m_locked" for i, mass_type in enumerate(["gas_mass", "m_locked", "m_tot"]): save_obj = save_data(loa_omegas) save_obj.make_filenames(filename + "_param%d" % i) save_obj.make_explanatory_file( "mass arrays of %s \n%s" % (mass_type, expl_string), ["time"] + loa_omega_names, "Final 'Eris'-bestfit of 'Omega'") save_obj.make_numpy_file(["time", mass_type])
#Make list of all 'Omega' instances and appr. names loa_omegas = [eris_omega, clean_slate_omega, milky_way_omega, milky_way_cte_omega] loa_omega_names = ["'Eris'", "deafult", "Milky Way default", "Milky Way cte default"] if False: #plot star-formation, kilonova, and supernova rates vis_obj = visualize(loa_omegas, loa_omega_names, num_yaxes=3) vis_obj.add_time_rate("sf", index_yaxis=0) vis_obj.add_time_rate("sn", index_yaxis=1) vis_obj.add_time_rate("kn", index_yaxis=2) vis_obj.finalize(show=False, save="data/%seris_parameters_rates"%highres_string) #save data from rates for i,rate_key in enumerate(["sf", "sn2", "nsns"]): save_obj = save_data(loa_omegas) save_obj.make_filenames("data/%seris_parameters_rates%d"%(highres_string, i)) save_obj.make_explanatory_file("File contains rate-arrays of %s"%rate_key, ["time"]+loa_omega_names, "Applying 'Eris' to default") save_obj.make_numpy_file(["time", rate_key]) if False: #Plot spectroscopic data for [O/H], [Fe/H], [Eu/H] vis_obj = visualize(loa_omegas, loa_omega_names, num_yaxes=3) vis_obj.add_time_relabu("[O/H]", index_yaxis=0) vis_obj.add_time_relabu("[Fe/H]", index_yaxis=1) vis_obj.add_time_relabu("[Eu/H]", index_yaxis=2) vis_obj.finalize(show=False, save="data/%seris_parameters_spectro"%highres_string) #save data from spectroscopic plots