mirror of
https://codeberg.org/Yael-II/MSc1-Internship-Stellar-Cluster.git
synced 2026-03-15 03:16:26 +01:00
Add files via upload
This commit is contained in:
28
COSMIC/source/COSMIC_v3.py
Normal file
28
COSMIC/source/COSMIC_v3.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
* COSMIC : Cluster Orbital SysteM Integration Code
|
||||
* Version 3
|
||||
@ Yaël Moussouni
|
||||
@ Unistra, P&E, MSc1-MoFP
|
||||
@ Observatory of Strasbourg (Intern)
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
import amuse.units.units as u
|
||||
# import matplotlib.pyplot as plt
|
||||
import COSMIC_v3_config as config
|
||||
import COSMIC_v3_init as init
|
||||
import COSMIC_v3_evolve as evolve
|
||||
# import COSMIC_v3_output as output
|
||||
# import COSMIC_v3_emission as emission
|
||||
|
||||
params, params_list = config.default()
|
||||
params = config.from_cfg_file(params)
|
||||
stars, binaries, converter = init.king_salpeter_binaries(params)
|
||||
# stars, converter = init.king_salpeter(params)
|
||||
channels = init.create_channels()
|
||||
codes = init.gravity_stellar_bridge(converter, params)
|
||||
codes = init.add_stars(codes, stars)
|
||||
codes, channels = init.add_binaries(codes, stars, binaries, channels)
|
||||
codes, channels = init.commit(codes, stars, channels, params)
|
||||
codes, stars, channels = evolve.stellar_gravity_binaries(codes, stars, binaries, channels, params, save_stars = True, save_binaries = True, compute_X_emission = True)
|
||||
# evolve.stellar_gravity(codes, stars, channels, params, save_stars = True)
|
||||
96
COSMIC/source/COSMIC_v3_config.py
Normal file
96
COSMIC/source/COSMIC_v3_config.py
Normal file
@@ -0,0 +1,96 @@
|
||||
"""
|
||||
* COSMIC - CONFIG
|
||||
* Version 3
|
||||
@ Yaël Moussouni
|
||||
@ Unistra, P&E, MSc1-MoFP
|
||||
@ Observatory of Strasbourg (Intern)
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
import amuse.units.units as u
|
||||
import datetime
|
||||
|
||||
def params_dic():
|
||||
params_list = ["N_stars", "timestep", "output_times", "R0_king", "W0_king", "metallicity_stellar", "M_min_salpeter", "M_max_salpeter", "a_salpeter", "binary_fraction", "mean_period", "std_period", "X_coefficient_OBA", "X_coefficient_GKM", "out_directory", "in_directory", "config", "filename", "workers_stellar", "workers_gravity", "format_type"]
|
||||
params = {i:0 for i in params_list}
|
||||
return params, params_list
|
||||
|
||||
def verbatim(params):
|
||||
print("\033[94m"+"Info: Simulation time of "+"\033[0m"+"{:.2f} Myr".format(np.max(params["output_times"].value_in(u.Myr))))
|
||||
print("\033[94m"+"Info: Simulation of "+"\033[0m"+"{:d} stars".format(params["N_stars"]))
|
||||
print("\033[94m"+"Info: Simulation will be saved with the prefix "+"\033[0m"+"{}".format(params["filename"]))
|
||||
print("\033[94m"+"Info: Gravity: "+"\033[0m"+"{:d} workers".format(params["workers_gravity"])+"\033[94m"+", Stellar: "+"\033[0m"+"{:d} workers".format(params["workers_stellar"]))
|
||||
return 0
|
||||
|
||||
def default():
|
||||
params, params_list = params_dic()
|
||||
|
||||
date = datetime.datetime.now()
|
||||
date = "{:04d}-{:02d}-{:02d}_{:02d}h{:02d}".format(date.year, date.month, date.day, date.hour, date.minute)
|
||||
|
||||
params["N_stars"] = np.int32(10) # Number of particle
|
||||
params["timestep"] = np.float32(1)|u.Myr # Time increment
|
||||
params["output_times"] = np.float32([1,2,5,10,20,50,100,200,500,1000,2000,5000])|u.Myr # Output intants
|
||||
params["R0_king"] = np.float32(1)|u.pc # Cluster virial radius
|
||||
params["W0_king"] = np.float32(9) # Cluster King's parameter
|
||||
params["metallicity_stellar"] = np.float32(0.02) # Metallicity
|
||||
params["M_min_salpeter"] = np.float32(0.1)|u.MSun # Minimum mass for Salpeter's law
|
||||
params["M_max_salpeter"] = np.float32(125)|u.MSun # Maximum mass for Salpeter's law
|
||||
params["a_salpeter"] = np.float32(-2.35) # Salpeter's law coefficient
|
||||
params["binary_fraction"] = np.float32(0.13) # Fraction of binary stars
|
||||
params["mean_period"] = np.float32(4.54) # Mean orbital period of binary systems (log10(T/days))
|
||||
params["std_period"] = np.float32(2.4) # Orbital period deviation of binary systems
|
||||
params["X_coefficient_OBA"] = np.float32(1.4e-7) # X-ray luminosity coefficient for O, B and A type stars
|
||||
params["X_coefficient_GKM"] = np.float32(1.4e27) # X-ray luminosity coefficient for G, K and M type stars
|
||||
params["out_directory"] = "./output/"
|
||||
params["in_directory"] = "./input/"
|
||||
params["config"] = "default.cfg"
|
||||
params["filename"] = "COSMIC_{}".format(date)
|
||||
params["workers_stellar"] = np.int32(1)
|
||||
params["workers_gravity"] = np.int32(1)
|
||||
params["format_type"] = "csv"
|
||||
return params, params_list
|
||||
|
||||
def change_params(params, cfg_param, cfg_values):
|
||||
if cfg_param == "":
|
||||
return params
|
||||
elif cfg_param == "N_stars": params["N_stars"] = np.int32(cfg_values[0])
|
||||
elif cfg_param == "timestep": params["timestep"] = np.float32(cfg_values[0])|u.Myr
|
||||
elif cfg_param == "output_times": params["output_times"] = np.float32(cfg_values)|u.Myr
|
||||
elif cfg_param == "R0_king": params["R0_king"] = np.float32(cfg_values[0])|u.pc
|
||||
elif cfg_param == "W0_king": params["W0_king"] = np.float32(cfg_values[0])
|
||||
elif cfg_param == "metallicity_stellar": params["metallicity_stellar"] = np.float32(cfg_values[0])
|
||||
elif cfg_param == "M_min_salpeter": params["M_min_salpeter"] = np.float32(cfg_values[0])|u.MSun
|
||||
elif cfg_param == "M_max_salpeter": params["M_max_salpeter"] = np.float32(cfg_values[0])|u.MSun
|
||||
elif cfg_param == "a_salpeter": params["a_salpeter"] = np.float32(cfg_values[0])
|
||||
elif cfg_param == "binary_fraction": params["binary_fraction"] = np.float32(cfg_values[0])
|
||||
elif cfg_param == "mean_period": params["mean_period"] = np.float32(cfg_values[0])
|
||||
elif cfg_param == "std_period": params["std_period"] = np.float32(cfg_values[0])
|
||||
elif cfg_param == "X_coefficient_OBA": params["X_coefficient_OBA"] = np.float32(cfg_values[0])
|
||||
elif cfg_param == "X_coefficient_GKM": params["X_coefficient_GKM"] = np.float32(cfg_values[0])
|
||||
elif cfg_param == "out_directory": params["out_directory"] = cfg_values[0].replace("\n", "")
|
||||
elif cfg_param == "in_directory": params["in_directory"] = cfg_values[0].replace("\n", "")
|
||||
elif cfg_param == "config": params["config"] = cfg_values[0].replace("\n", "")
|
||||
elif cfg_param == "filename": params["filename"] = cfg_values[0].replace("\n", "")
|
||||
elif cfg_param == "workers_stellar": params["workers_stellar"] = np.int32(cfg_values[0])
|
||||
elif cfg_param == "workers_gravity": params["workers_gravity"] = np.int32(cfg_values[0])
|
||||
elif cfg_param == "format_type": params["format_type"] = cfg_values[0].replace("\n", "")
|
||||
else:
|
||||
print("\033[93m"+"Warning: cannot understand the parameter in config: "+"\033[0m" + cfg_param)
|
||||
return params
|
||||
|
||||
|
||||
def from_cfg_file(params):
|
||||
cfg_path = params["in_directory"] + params["config"]
|
||||
with open(cfg_path, "r") as cfg_file:
|
||||
for cfg_line in cfg_file.readlines():
|
||||
cfg_split = cfg_line.split(" ")
|
||||
if len(cfg_split) == 1:
|
||||
print("\033[93m"+"Warning: cannot understand the line in config: "+"\033[0m" + cfg_line)
|
||||
continue
|
||||
cfg_param = cfg_split[0]
|
||||
cfg_values = cfg_split[1:]
|
||||
params = change_params(params, cfg_param, cfg_values)
|
||||
verbatim(params)
|
||||
return params
|
||||
|
||||
27
COSMIC/source/COSMIC_v3_emission.py
Normal file
27
COSMIC/source/COSMIC_v3_emission.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""
|
||||
* COSMIC - EMISSION
|
||||
* Version 3
|
||||
@ Yaël Moussouni
|
||||
@ Unistra, P&E, MSc1-MoFP
|
||||
@ Observatory of Strasbourg (Intern)
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
import amuse.units.units as u
|
||||
|
||||
def rotation(stars, params):
|
||||
N = params["N_stars"] + np.int32(np.round(params["N_stars"] * params["binary_fraction"]))
|
||||
stars.X_v = np.random.uniform(0, 10, N) | u.km * u.s**(-1)
|
||||
p = np.random.uniform(0, 1, N)
|
||||
stars.X_vsini = stars.X_v * np.sqrt(2*p-p**2)
|
||||
return stars
|
||||
|
||||
def X_emission(stars, params):
|
||||
for i in range(len(stars)):
|
||||
if stars[i].temperature.value_in(u.K) > 7300: # O B A
|
||||
stars[i].X_luminosity = params["X_coefficient_OBA"] * stars[i].luminosity.in_(u.erg * u.s**(-1))
|
||||
elif stars[i].temperature.value_in(u.K) < 6000: # G K M
|
||||
stars[i].X_luminosity = params["X_coefficient_GKM"] * (stars[i].X_vsini.value_in(u.km * u.s**(-1)))**(1.9) | u.erg * u.s**(-1)
|
||||
else: # F
|
||||
stars[i].X_luminosity = 0
|
||||
return stars
|
||||
44
COSMIC/source/COSMIC_v3_evolve.py
Normal file
44
COSMIC/source/COSMIC_v3_evolve.py
Normal file
@@ -0,0 +1,44 @@
|
||||
"""
|
||||
* COSMIC - EVOLVE
|
||||
* Version 3
|
||||
@ Yaël Moussouni
|
||||
@ Unistra, P&E, MSc1-MoFP
|
||||
@ Observatory of Strasbourg (Intern)
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
import amuse.units.units as u
|
||||
import COSMIC_v3_output as output
|
||||
import COSMIC_v3_emission as emission
|
||||
|
||||
def stellar_gravity(codes, stars, channels, params, save_stars = False):
|
||||
"""
|
||||
Evolve a model with both gravity and stellar evolution.
|
||||
"""
|
||||
for t in params["output_times"]:
|
||||
print("\033[36m"+"t: "+"\033[0m"+"{:02.2f} Myr/{:02.2f} Myr".format(t.value_in(u.Myr),np.max(params["output_times"].value_in(u.Myr))))
|
||||
codes["g"].evolve_model(t)
|
||||
channels.copy()
|
||||
if save_stars: output.save_stars(stars, params, t.value_in(u.Myr))
|
||||
|
||||
print("\033[36m"+"Simulation completed"+"\033[0m")
|
||||
return 0
|
||||
|
||||
def stellar_gravity_binaries(codes, stars, binaries, channels, params, save_stars = False, save_binaries = False, compute_X_emission = False):
|
||||
"""
|
||||
Evolve a model with both gravity and stellar evolution.
|
||||
"""
|
||||
for t in params["output_times"]:
|
||||
print("\033[36m"+"t: "+"\033[0m"+"{:02.2f} Myr/{:02.2f} Myr".format(t.value_in(u.Myr),np.max(params["output_times"].value_in(u.Myr))))
|
||||
codes["b"].evolve_model(t)
|
||||
channels.copy()
|
||||
if compute_X_emission:
|
||||
stars = emission.rotation(stars, params)
|
||||
stars = emission.X_emission(stars, params)
|
||||
if save_stars: output.save_stars(stars, params, t.value_in(u.Myr))
|
||||
if save_binaries: output.save_binaries(binaries, params, t.value_in(u.Myr))
|
||||
|
||||
print("\033[36m"+"Simulation completed"+"\033[0m")
|
||||
return codes, stars, channels
|
||||
|
||||
|
||||
0
COSMIC/source/COSMIC_v3_galaxy.py
Normal file
0
COSMIC/source/COSMIC_v3_galaxy.py
Normal file
193
COSMIC/source/COSMIC_v3_init.py
Normal file
193
COSMIC/source/COSMIC_v3_init.py
Normal file
@@ -0,0 +1,193 @@
|
||||
"""
|
||||
* COSMIC - INIT
|
||||
* Version 3
|
||||
@ Yaël Moussouni
|
||||
@ Unistra, P&E, MSc1-MoFP
|
||||
@ Observatory of Strasbourg (Intern)
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
import amuse.units.units as u
|
||||
|
||||
import COSMIC_v3_galaxy as galaxy
|
||||
|
||||
from amuse.units import nbody_system
|
||||
from amuse.ic.kingmodel import new_king_model
|
||||
from amuse.ic.salpeter import new_salpeter_mass_distribution
|
||||
# from amuse.community.huayno.interface import Huayno # FIXME DOES NOT WORK
|
||||
from amuse.community.ph4.interface import Ph4
|
||||
from amuse.community.seba.interface import SeBa
|
||||
from amuse.couple.bridge import Bridge
|
||||
from amuse.datamodel.particles import Channels
|
||||
from amuse.datamodel import Particles
|
||||
|
||||
# def IMF_Besancon(M, alpha_1=1.6, alpha_2=3.0):
|
||||
# return (M.value_in(u.MSun))**(alpha_1-1) * ((M.value_in(u.MSun))<1) + (((M.value_in(u.MSun))-1)**(alpha_2-1) + 1) * ((M.value_in(u.MSun))>=1)
|
||||
|
||||
# def Besancon_disk(params):
|
||||
# """
|
||||
# Generate two IMF of stars and binaries
|
||||
# """
|
||||
# M_1 = []
|
||||
# M_2 = []
|
||||
# N_min = 0
|
||||
# N_max = IMF_Besancon(params["M_max_besancon"], params["a_besancon_1"], params["a_besancon_2"])
|
||||
# while len(M_1) < params["N_stars"]:
|
||||
# X = np.random.uniform(params["M_min_besancon"].value_in(u.MSun), params["M_max_besancon"].value_in(u.MSun))|u.MSun
|
||||
# Y = np.random.uniform(N_min, N_max)
|
||||
# if Y > IMF_Besancon(X, params["a_besancon_1"], params["a_besancon_2"]):
|
||||
# M_1.append(X)
|
||||
# while len(M_2) < params["N_stars"] * params["binary_fraction"]:
|
||||
# X = np.random.uniform(params["M_min_besancon"].value_in(u.MSun), params["M_max_besancon"].value_in(u.MSun))|u.MSun
|
||||
# Y = np.random.uniform(N_min, N_max)
|
||||
# if Y > IMF_Besancon(X, params["a_besancon_1"], params["a_besancon_2"]):
|
||||
# M_2.append(X)
|
||||
# return M_1, M_2
|
||||
|
||||
def orbital_parameters(params, m_tot):
|
||||
x_0 = params["mean_period"] * np.log(2)
|
||||
sigma_0 = params["std_period"] * np.log(2)
|
||||
T = np.random.lognormal(mean = x_0, sigma = sigma_0)
|
||||
a = (T**2 * u.constants.G.value_in(u.au**3*u.day**(-2)*u.MSun**(-1)) * m_tot.value_in(u.MSun) / (4*np.pi**2) )**(1/3) | u.au
|
||||
e = 1
|
||||
return a, e
|
||||
|
||||
def king_salpeter(params):
|
||||
"""
|
||||
Create a cluster of N stars, with a King's law of parameter W0, with a (virial) radius R, stellar masses following a Salpeter law ranging between M_min and M_max with exponent a_salpeter.
|
||||
"""
|
||||
M_stars = new_salpeter_mass_distribution(params["N_stars"], mass_min=params["M_min_salpeter"], mass_max=params["M_max_salpeter"], alpha=params["a_salpeter"])
|
||||
converter = nbody_system.nbody_to_si(M_stars.sum(), params["R0_king"])
|
||||
stars = new_king_model(params["N_stars"], params["W0_king"], converter)
|
||||
stars.mass = M_stars
|
||||
stars.zams_mass = M_stars
|
||||
return stars, converter
|
||||
|
||||
def king_salpeter_binaries(params):
|
||||
"""
|
||||
|
||||
"""
|
||||
M_primary = new_salpeter_mass_distribution(params["N_stars"], mass_min=params["M_min_salpeter"], mass_max=params["M_max_salpeter"], alpha=params["a_salpeter"])
|
||||
M_secondary = new_salpeter_mass_distribution(np.int32(np.round(params["N_stars"]*params["binary_fraction"])), mass_min=params["M_min_salpeter"], mass_max=params["M_max_salpeter"], alpha=params["a_salpeter"])
|
||||
|
||||
M_stars = np.concatenate([M_primary, M_secondary])
|
||||
N_binaries = len(M_secondary)
|
||||
converter = nbody_system.nbody_to_si(M_stars.sum(), params["R0_king"])
|
||||
stars_primary = new_king_model(params["N_stars"], params["W0_king"], converter)
|
||||
stars_primary.mass = M_primary
|
||||
stars_primary.zams_mass = M_primary
|
||||
|
||||
stars_secondary = Particles(N_binaries)
|
||||
for i in range(N_binaries):
|
||||
stars_secondary[i].mass = M_secondary[i]
|
||||
stars_secondary[i].radius = 0|u.m
|
||||
stars_secondary[i].vx = stars_primary[i].vx
|
||||
stars_secondary[i].vy = stars_primary[i].vy
|
||||
stars_secondary[i].vz = stars_primary[i].vz
|
||||
stars_secondary[i].x = stars_primary[i].x
|
||||
stars_secondary[i].y = stars_primary[i].y
|
||||
stars_secondary[i].z = stars_primary[i].z
|
||||
stars_secondary[i].zams_mass = M_secondary[i]
|
||||
|
||||
stars = Particles()
|
||||
binaries = Particles(N_binaries)
|
||||
|
||||
stars.add_particles(stars_primary)
|
||||
stars.add_particles(stars_secondary)
|
||||
|
||||
stars.ra = 0 | u.deg
|
||||
stars.dec = 0 | u.deg
|
||||
stars.X_v = 0 | u.km * u.s**(-1)
|
||||
stars.X_vsini = 0 | u.km * u.s**(-1)
|
||||
stars.X_temperature_0 = 0 | u.kilo(u.eV)
|
||||
stars.X_temperature_1 = 0 | u.kilo(u.eV)
|
||||
stars.X_luminosity = 0 | u.erg * u.s**(-1)
|
||||
|
||||
if N_binaries == 0:
|
||||
binaries.child1 = [0]
|
||||
binaries.child2 = [0]
|
||||
binaries.mass1 = 0
|
||||
binaries.mass2 = 0
|
||||
binaries.mass_tot = 0
|
||||
else:
|
||||
binaries.child1 = list(stars_primary[:N_binaries])
|
||||
binaries.child2 = list(stars_secondary)
|
||||
binaries.mass1 = list(stars_primary[:N_binaries].mass)
|
||||
binaries.mass2 = list(stars_secondary.mass.in_(u.kg))
|
||||
binaries.mass_tot = binaries.mass1 + binaries.mass2
|
||||
|
||||
for i in range(N_binaries):
|
||||
semi_major_axis, eccentricity = orbital_parameters(params, binaries[i].mass_tot)
|
||||
binaries[i].semi_major_axis = semi_major_axis
|
||||
binaries[i].eccentricity = eccentricity
|
||||
return stars, binaries, converter
|
||||
|
||||
|
||||
def gravity_stellar_bridge(converter, params):
|
||||
gravity = Ph4(converter, number_of_workers=params["workers_gravity"]) # TODO A CHANGER SI BESOIN
|
||||
stellar = SeBa(number_of_worker=params["workers_stellar"])
|
||||
bridge = Bridge()
|
||||
codes = {"g":gravity, "s":stellar, "b":bridge}
|
||||
return codes
|
||||
|
||||
def create_channels():
|
||||
channels = Channels()
|
||||
return channels
|
||||
|
||||
def generate_galaxy(stars, params):
|
||||
galaxy_model = galaxy.MilkyWay_AMUSE()
|
||||
vc = galaxy_model.vel_circ(stars.center_of_mass().length())
|
||||
stars.x += params["cluster_position_x"]
|
||||
stars.y += params["cluster_position_y"]
|
||||
stars.z += params["cluster_position_z"]
|
||||
phi = np.arctan2(stars.center_of_mass().y, stars.center_of_mass().x)
|
||||
stars.vx += - vc * np.sin(phi)
|
||||
stars.vy += vc * np.cos(phi)
|
||||
return stars, galaxy_model
|
||||
|
||||
def add_stars(codes, stars):
|
||||
codes["g"].particles.add_particles(stars)
|
||||
codes["s"].particles.add_particles(stars)
|
||||
return codes
|
||||
|
||||
def add_binaries(codes, stars, binaries, channels):
|
||||
codes["s"].binaries.add_particles(binaries)
|
||||
channels.add_channel(codes["s"].binaries.new_channel_to(stars))
|
||||
return codes, channels
|
||||
|
||||
def commit(codes, stars, channels, params):
|
||||
codes["s"].set_metallicity(params["metallicity_stellar"])
|
||||
codes["s"].commit_particles()
|
||||
codes["g"].commit_particles()
|
||||
# codes["g"].initialize_code() # NOT REQUIRED WITH Ph4
|
||||
|
||||
codes["b"].add_system(codes["g"])
|
||||
codes["b"].add_system(codes["s"])
|
||||
|
||||
codes["b"].synchronize_model()
|
||||
codes["b"].timestep = params["timestep"]
|
||||
|
||||
codes["b"].channels.add_channel(codes["s"].particles.new_channel_to(codes["g"].particles, attributes=["mass", "radius"]))
|
||||
|
||||
channels.add_channel(codes["s"].particles.new_channel_to(stars))
|
||||
channels.add_channel(codes["g"].particles.new_channel_to(stars))
|
||||
return codes, channels
|
||||
|
||||
def commit_with_potential(codes, stars, channels, galaxy_model, params):
|
||||
codes["s"].set_metallicity(params["metallicity_stellar"])
|
||||
codes["s"].commit_particles()
|
||||
codes["g"].commit_particles()
|
||||
# codes["g"].initialize_code() # NOT REQUIRED WITH Ph4
|
||||
|
||||
codes["b"].add_system(codes["g"], (galaxy_model,))
|
||||
codes["b"].add_system(codes["s"])
|
||||
|
||||
codes["b"].synchronize_model()
|
||||
codes["b"].timestep = params["timestep"]
|
||||
|
||||
codes["b"].channels.add_channel(codes["s"].particles.new_channel_to(codes["g"].particles, attributes=["mass", "radius"]))
|
||||
|
||||
channels.add_channel(codes["s"].particles.new_channel_to(stars))
|
||||
channels.add_channel(codes["g"].particles.new_channel_to(stars))
|
||||
return codes, channels
|
||||
|
||||
20
COSMIC/source/COSMIC_v3_output.py
Normal file
20
COSMIC/source/COSMIC_v3_output.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
* COSMIC - SAVE
|
||||
* Version 3
|
||||
@ Yaël Moussouni
|
||||
@ Unistra, P&E, MSc1-MoFP
|
||||
@ Observatory of Strasbourg (Intern)
|
||||
"""
|
||||
|
||||
|
||||
import numpy as np
|
||||
|
||||
from amuse.io.base import write_set_to_file
|
||||
|
||||
def save_stars(stars, params, t=0):
|
||||
write_set_to_file(set=stars, filename=params["out_directory"]+params["filename"]+"_stars_{:04d}_Myr.{}".format(np.int32(t), params["format_type"]), format=params["format_type"])
|
||||
return 0
|
||||
|
||||
def save_binaries(binaries, params, t=0):
|
||||
write_set_to_file(set=binaries, filename=params["out_directory"]+params["filename"]+"_binaries_{:04d}_Myr.{}".format(np.int32(t), params["format_type"]), format=params["format_type"])
|
||||
return 0
|
||||
Reference in New Issue
Block a user