Galactic plane distances#

Plot the distance from the galactic plane for each binary in the population, separating by whether a binary experienced a kick from a supernova or not.

As one would expect, kicked systems are more likely to be found further from the galactic plane.

plot heights
cogsworth warning: 3 orbit(s) failed numerical integration, removing them. This can occur due to NaNs in stellar evolution or extreme orbits (e.g. passing directly through the galactic centre) that Gala cannot handle. Information for these systems was saved to `./failed_integration_binaries.h5`. This includes their initial_binaries, bpp, kick_info, and initial galaxy objects.

import cogsworth
import matplotlib.pyplot as plt
import numpy as np


p = cogsworth.pop.Population(500, final_kstar1=[13, 14], processes=1,
                             use_default_BSE_settings=True)
p.create_population(with_timing=False)

# find any binary that experienced a kick from a supernova
kicked = np.isin(p.bin_nums, p.bpp[(p.bpp["evol_type"] == 15) | (p.bpp["evol_type"] == 16)]["bin_num"])

# split the population
p_kicked = p[kicked]
p_unkicked = p[~kicked]

fig, ax = plt.subplots()

for pop, label, colour in zip([p_unkicked, p_kicked], ["Unkicked", "Kicked"], ["grey", "C2"]):
    ax.hist(abs(pop.final_pos[:, 2].value), bins=np.geomspace(1e-3, 1e3, 20),
            histtype="step", linewidth=3, color=colour)
    ax.hist(abs(pop.final_pos[:, 2].value), bins=np.geomspace(1e-3, 1e3, 20),
            alpha=0.5, color=colour, label=label)

ax.set(xscale="log", xlabel="Distance from Galactic Plane [kpc]", ylabel="Number of systems")
ax.legend()
plt.show()

Total running time of the script: (0 minutes 18.142 seconds)