Exemplo n.º 1
0
def get_data(filename):
    """
    Grabs the data (z and stellar birth density in mh / cm^3).
    """

    data = load(filename)

    birth_densities = data.stars.birth_densities.to("g/cm**3") / mh.to("g")
    birth_redshifts = 1 / data.stars.birth_scale_factors.value - 1

    return birth_densities.value, birth_redshifts
Exemplo n.º 2
0
def get_data(filename):
    """
    Grabs the data (MMF and stellar birth density in mh / cm^3).
    """

    data = load(filename)

    birth_densities = data.stars.birth_densities.to("g/cm**3") / mh.to("g")
    try:
        metal_mass_fractions = data.stars.smoothed_metal_mass_fractions.value
    except AttributeError:
        metal_mass_fractions = data.stars.metal_mass_fractions.value

    below_Z_min = np.where(
        metal_mass_fractions < metal_mass_fraction_bounds[0])

    # Stars with Z < lowest Z in the figure should be added to the lowest-Z bin
    metal_mass_fractions[below_Z_min] = metal_mass_fraction_bounds[0] * (
        1.0 + 1e-3 / bins)

    return birth_densities.value, metal_mass_fractions
    "$z > 3$": axes[2],
}

for label, ax in ax_dict.items():
    ax.loglog()
    ax.text(0.025,
            1.0 - 0.025 * 3,
            label,
            transform=ax.transAxes,
            ha="left",
            va="top")

for color, (snapshot, name) in enumerate(zip(data, names)):

    stars_SNII_densities = snapshot.stars.densities_at_last_supernova_event.to(
        "g/cm**3") / mh.to("g")

    # swift-colibre master branch as of Feb 26 2021
    try:
        stars_SNII_redshifts = (
            1 / snapshot.stars.last_sniithermal_feedback_scale_factors.value -
            1)
    # swift-colibre master prior to Feb 26 2021
    except AttributeError:
        stars_SNII_redshifts = (
            1 / snapshot.stars.last_sniifeedback_scale_factors.value - 1)

    gas_SNII_densities = snapshot.gas.densities_at_last_supernova_event.to(
        "g/cm**3") / mh.to("g")

    try:
Exemplo n.º 4
0
    "$1 < z < 3$": axes[1],
    "$z > 3$": axes[2],
}

for label, ax in ax_dict.items():
    ax.loglog()
    ax.text(0.025,
            1.0 - 0.025 * 3,
            label,
            transform=ax.transAxes,
            ha="left",
            va="top")

for color, (snapshot, name) in enumerate(zip(data, names)):

    birth_densities = snapshot.stars.birth_densities.to("g/cm**3") / mh.to("g")
    birth_redshifts = 1 / snapshot.stars.birth_scale_factors.value - 1

    # Segment birth densities into redshift bins
    birth_densities_by_redshift = {
        "$z < 1$":
        birth_densities[birth_redshifts < 1],
        "$1 < z < 3$":
        birth_densities[np.logical_and(birth_redshifts > 1,
                                       birth_redshifts < 3)],
        "$z > 3$":
        birth_densities[birth_redshifts > 3],
    }

    # Compute the critical density from DV&S2012
    SNII_heating_temperature = float(