Skip to content

Commit

Permalink
cleaning up secular code when running TRES through main, as in TPS. o…
Browse files Browse the repository at this point in the history
…nly done for codes that are not set by the user outside of TRES
  • Loading branch information
Silvia Toonen committed Sep 25, 2024
1 parent 53b4a34 commit 286e481
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions TRES.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,20 @@ def main(inner_primary_mass = 1.3|units.MSun, inner_secondary_mass = 0.5|units.M
inner_argument_of_pericenter, outer_argument_of_pericenter,
inner_longitude_of_ascending_node)

clean_up_stellar_code = False
clean_up_secular_code = False
if stellar_code is None:
stellar_code = SeBa()
# stellar_code = SeBa(redirection='none')
# stellar_code = SeBa(redirection='file', redirect_file='output_SeBa_TRES.txt')
# stellar_code = SeBa(redirection='file', redirect_file='output_SeBa_TRES.txt')
clean_up_stellar_code = True

stellar_code.parameters.metallicity = metallicity
if secular_code is None:
secular_code = SecularTriple()
# secular_code = SecularTriple(redirection='none')
# secular_code = SecularTriple(redirection='file', redirect_file='output_SecularTriple_TRES.txt')
clean_up_secular_code = True

triple_class_object = Triple_Class(stars, bins, correct_params, stellar_code, secular_code,
relative_inclination, tend, tinit,
Expand Down Expand Up @@ -148,8 +153,13 @@ def main(inner_primary_mass = 1.3|units.MSun, inner_secondary_mass = 0.5|units.M
secular_code.triples.remove_particles(triple_set)
del stars, bins, triple_set

triple_class_object.stellar_code.stop()

if clean_up_stellar_code:
triple_class_object.stellar_code.stop()
print('cleaning se')
if clean_up_secular_code:
triple_class_object.secular_code.stop()
print('cleaning sec')

return triple_class_object


Expand Down

0 comments on commit 286e481

Please sign in to comment.