Loading examples/example_population.py +7 −8 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ from binarycpython.utils.custom_logging_functions import temp_dir ######################################################### ## Quick script to get some output about which stars go supernova when. ## Quick script to get some output def output_lines(output): """ Function that outputs the lines that were recieved from the binary_c run. Loading Loading @@ -43,7 +43,7 @@ def parse_function(self, output): # CHeck the header and act accordingly if (headerline=='MY_STELLAR_DATA'): parameters = ['time', 'mass', 'zams_mass', 'probability'] parameters = ['time', 'mass', 'zams_mass', 'probability', 'radius'] values = el.split()[1:] if not os.path.exists(outfilename): Loading @@ -67,7 +67,7 @@ example_pop.set( # binary_c physics options M_1=10, # bse_options separation=0, # bse_options orbital_period=4580, # bse_options orbital_period=45000000080, # bse_options max_evolution_time=15000, # bse_options eccentricity=0.02, # bse_options Loading Loading @@ -101,12 +101,13 @@ if(stardata->star[0].stellar_type >= 2) { if (stardata->model.time < stardata->model.max_evolution_time) { Printf("MY_STELLAR_DATA %30.12e %g %g %g\\n", Printf("MY_STELLAR_DATA %30.12e %g %g %g %g\\n", // stardata->model.time, // 1 stardata->star[0].mass, //2 stardata->star[0].pms_mass, //4 stardata->model.probability //6 stardata->model.probability, //5 stardata->star[0].radius // 6 ); }; /* Kill the simulation to save time */ Loading @@ -115,7 +116,7 @@ if(stardata->star[0].stellar_type >= 2) """) # Add grid variables resolution = {'M_1': 10} resolution = {'M_1': 100} # Mass example_pop.add_grid_variable( Loading @@ -129,7 +130,6 @@ example_pop.add_grid_variable( dphasevol="dlnm1", parameter_name="M_1", condition="", # Impose a condition on this grid variable. Mostly for a check for yourself ) # Exporting of all the settings can be done with .export_all_info() Loading @@ -149,7 +149,6 @@ example_pop.export_all_info() # output = example_pop.evolve_single() # print(output) ## Executing a population ## This uses the values generated by the grid_variables example_pop.evolve_population_mp_chunks() # TODO: update this function call Loading Loading
examples/example_population.py +7 −8 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ from binarycpython.utils.custom_logging_functions import temp_dir ######################################################### ## Quick script to get some output about which stars go supernova when. ## Quick script to get some output def output_lines(output): """ Function that outputs the lines that were recieved from the binary_c run. Loading Loading @@ -43,7 +43,7 @@ def parse_function(self, output): # CHeck the header and act accordingly if (headerline=='MY_STELLAR_DATA'): parameters = ['time', 'mass', 'zams_mass', 'probability'] parameters = ['time', 'mass', 'zams_mass', 'probability', 'radius'] values = el.split()[1:] if not os.path.exists(outfilename): Loading @@ -67,7 +67,7 @@ example_pop.set( # binary_c physics options M_1=10, # bse_options separation=0, # bse_options orbital_period=4580, # bse_options orbital_period=45000000080, # bse_options max_evolution_time=15000, # bse_options eccentricity=0.02, # bse_options Loading Loading @@ -101,12 +101,13 @@ if(stardata->star[0].stellar_type >= 2) { if (stardata->model.time < stardata->model.max_evolution_time) { Printf("MY_STELLAR_DATA %30.12e %g %g %g\\n", Printf("MY_STELLAR_DATA %30.12e %g %g %g %g\\n", // stardata->model.time, // 1 stardata->star[0].mass, //2 stardata->star[0].pms_mass, //4 stardata->model.probability //6 stardata->model.probability, //5 stardata->star[0].radius // 6 ); }; /* Kill the simulation to save time */ Loading @@ -115,7 +116,7 @@ if(stardata->star[0].stellar_type >= 2) """) # Add grid variables resolution = {'M_1': 10} resolution = {'M_1': 100} # Mass example_pop.add_grid_variable( Loading @@ -129,7 +130,6 @@ example_pop.add_grid_variable( dphasevol="dlnm1", parameter_name="M_1", condition="", # Impose a condition on this grid variable. Mostly for a check for yourself ) # Exporting of all the settings can be done with .export_all_info() Loading @@ -149,7 +149,6 @@ example_pop.export_all_info() # output = example_pop.evolve_single() # print(output) ## Executing a population ## This uses the values generated by the grid_variables example_pop.evolve_population_mp_chunks() # TODO: update this function call Loading