Skip to content

Commit

Permalink
Adding C/O vs O/H plots to understand behaviour of Carbon relative to…
Browse files Browse the repository at this point in the history
… the poor comparison with observations in the gas phase
  • Loading branch information
correac committed Dec 6, 2023
1 parent 45890e6 commit 13650da
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 42 deletions.
47 changes: 6 additions & 41 deletions colibre/auto_plotter/metallicity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -754,19 +754,19 @@ gas_metallicity_gas_carbon_over_oxygen_lom_50_kpc:
observational_data:
- filename: GalaxyStellarMassGasMetallicity/Nicholls_2017a.hdf5

gas_metallicity_gas_carbon_over_oxygen_lofloor_50_kpc:
gas_metallicity_gas_carbon_over_oxygen_total_lom_50_kpc:
type: "scatter"
legend_loc: "upper left"
selection_mask: "derived_quantities.has_cold_dense_gas_50_kpc"
comment: "All galaxies, LoM, Diffuse"
comment: "All galaxies, LoM, Total (Dust + Diffuse)"
y:
quantity: "derived_quantities.gas_c_over_o_abundance_avglog_low_50_kpc"
quantity: "derived_quantities.gas_c_over_o_total_abundance_avglin_50_kpc"
log: false
units: "dimensionless"
start: -2
end: 1
x:
quantity: "derived_quantities.gas_o_abundance_avglog_low_50_kpc"
quantity: "derived_quantities.gas_o_abundance_avglin_50_kpc"
log: false
units: "dimensionless"
start: 7
Expand All @@ -783,48 +783,13 @@ gas_metallicity_gas_carbon_over_oxygen_lofloor_50_kpc:
value: 10
units: "dimensionless"
metadata:
title: "Diffuse Gas metallicity - Diffuse Gas Carbon over Oxygen relation (mean-of-log, 50 kpc aperture)"
caption: Only shown for galaxies with cold, dense gas. Metallicity is represented by 12 + $\log_{10}$ O/H (where $\log_{10}$ O/H is averaged between gas particles with a [O/H]=-4 floor for diffuse O) of the cold, dense gas ($T < 10^{4.5}\;{\rm K}$, $n_{\rm H} > 0.1 \; {\rm cm^{-3}}$). The floor values are set to 1e-4 x (C/O)sun and 1e-4 x (O/H)sun. All haloes are plotted, including subhaloes. This uses depleted gas metallicity, i.e. it does not include metals that are present in dust.
title: "Diffuse Gas metallicity - (Dust + Diffuse) Gas Carbon over Oxygen relation (log-of-mean, 50 kpc aperture, only cold dense gas)"
caption: Only shown for galaxies with cold, dense gas. Metallicity is represented by 12 + $\log_{10}$ O/H (where $\log_{10}$ O/H is averaged between gas particles for diffuse O) of the cold, dense gas ($T < 10^{4.5}\;{\rm K}$, $n_{\rm H} > 0.1 \; {\rm cm^{-3}}$). No minimum metallicity is imposed. All haloes are plotted, including subhaloes. This uses total gas metallicity for C/O, i.e. it includes metals that are present in dust.
section: Gas Metallicity
show_on_webpage: true
observational_data:
- filename: GalaxyStellarMassGasMetallicity/Nicholls_2017a.hdf5

gas_metallicity_gas_carbon_over_oxygen_hifloor_50_kpc:
type: "scatter"
legend_loc: "upper left"
selection_mask: "derived_quantities.has_cold_dense_gas_50_kpc"
comment: "All galaxies, LoM, Diffuse"
y:
quantity: "derived_quantities.gas_c_over_o_abundance_avglog_high_50_kpc"
log: false
units: "dimensionless"
start: -2
end: 1
x:
quantity: "derived_quantities.gas_o_abundance_avglog_high_50_kpc"
log: false
units: "dimensionless"
start: 7
end: 10
median:
plot: true
log: true
adaptive: true
number_of_bins: 30
start:
value: 7
units: "dimensionless"
end:
value: 10
units: "dimensionless"
metadata:
title: "Diffuse Gas metallicity - Diffuse Gas Carbon over Oxygen relation (mean-of-log, 50 kpc aperture)"
caption: Only shown for galaxies with cold, dense gas. Metallicity is represented by 12 + $\log_{10}$ O/H (where $\log_{10}$ O/H is averaged between gas particles with a [O/H]=-3 floor for diffuse O) of the cold, dense gas ($T < 10^{4.5}\;{\rm K}$, $n_{\rm H} > 0.1 \; {\rm cm^{-3}}$). The floor values are set to 1e-3 x (C/O)sun and 1e-3 x (O/H)sun. All haloes are plotted, including subhaloes. This uses depleted gas metallicity, i.e. it does not include metals that are present in dust.
section: Gas Metallicity
show_on_webpage: true
observational_data:
- filename: GalaxyStellarMassGasMetallicity/Nicholls_2017a.hdf5

stellar_mass_star_metallicity_50:
type: "scatter"
Expand Down
18 changes: 18 additions & 0 deletions colibre/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,24 @@ scripts:
xvar: Fe_H
yvar: C_Fe
dataset: APOGEE
- filename: scripts/stellar_abundances.py
caption: '[Fe/H] vs [C/O] using Asplund et al. (2009) values for [O/H]Sun = 8.69 and [C/H]Sun = 8.43. The median [C/O] vs median [Fe/H] is indicated by the solid curve(s). The scatter points show abundances of individual stellar particles. The observational data for MW compiles the data from the APOGEE survey (Holtzman et al. 2018) and AstroNN added-value catalog (Leung, H.W. & Bovy, Jo 2019b). We create 6 stellar distributions by selecting stars from APOGEE based on galactocentric radial & azimuthal cuts, and combine them in order to derive a joint stellar abundance distribution that gives less weight to stars in the solar vicinity. The resulting contours use a log scale with 0.2 bin size.'
output_file: stellar_abundances_FeH_CO_APOGEE.png
section: Stellar Metal Abundances
title: '[Fe/H] vs [C/O]'
additional_arguments:
xvar: Fe_H
yvar: C_O
dataset: APOGEE
- filename: scripts/stellar_abundances.py
caption: '[O/H] vs [C/O] using Asplund et al. (2009) values for [O/H]Sun = 8.69 and [C/H]Sun = 8.43. The median [C/O] vs median [O/H] is indicated by the solid curve(s). The scatter points show abundances of individual stellar particles. The observational data for MW compiles the data from the APOGEE survey (Holtzman et al. 2018) and AstroNN added-value catalog (Leung, H.W. & Bovy, Jo 2019b). We create 6 stellar distributions by selecting stars from APOGEE based on galactocentric radial & azimuthal cuts, and combine them in order to derive a joint stellar abundance distribution that gives less weight to stars in the solar vicinity. The resulting contours use a log scale with 0.2 bin size.'
output_file: stellar_abundances_OH_CO_APOGEE.png
section: Stellar Metal Abundances
title: '[O/H] vs [C/O]'
additional_arguments:
xvar: O_H
yvar: C_O
dataset: APOGEE
- filename: scripts/stellar_abundances.py
caption: '[Fe/H] vs [N/Fe] using Asplund et al. (2009) values for [Fe/H]Sun = 7.5 and [N/H]Sun = 7.83. The median [N/Fe] vs median [Fe/H] is indicated by the solid curve(s). The scatter points show abundances of individual stellar particles. The observational data for MW compiles the data from the APOGEE survey (Holtzman et al. 2018) and AstroNN added-value catalog (Leung, H.W. & Bovy, Jo 2019b). We create 6 stellar distributions by selecting stars from APOGEE based on galactocentric radial & azimuthal cuts, and combine them in order to derive a joint stellar abundance distribution that gives less weight to stars in the solar vicinity. The resulting contours use a log scale with 0.2 bin size.'
output_file: stellar_abundances_FeH_NFe_APOGEE.png
Expand Down
34 changes: 34 additions & 0 deletions colibre/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,40 @@ def register_carbon_to_oxygen(self, catalogue, aperture_sizes):
)
setattr(self, f"has_cold_dense_gas_{aperture_size}_kpc", mask)

for aperture_size in aperture_sizes:

# Fetch C over O times gas mass computed in apertures. The
# mass ratio between N and O has already been accounted for.
# Note that here we are calling the total quantities
log_C_over_O_times_gas_mass = catalogue.get_quantity(
f"lin_element_ratios_times_masses.lin_C_over_O_total_times_gas_mass_{aperture_size}_kpc"
)

# Fetch gas mass in apertures
gas_cold_dense_mass = catalogue.get_quantity(
f"cold_dense_gas_properties.cold_dense_gas_mass_{aperture_size}_kpc"
)

# Compute gas-mass weighted O over H
log_C_over_O = unyt.unyt_array(
np.zeros_like(gas_cold_dense_mass), "dimensionless"
)
# Avoid division by zero
mask = gas_cold_dense_mass > 0.0 * gas_cold_dense_mass.units
log_C_over_O[mask] = np.log10(
log_C_over_O_times_gas_mass[mask] / gas_cold_dense_mass[mask]
)

log_C_over_O.name = (
f"Total (Dust + Diffuse) Gas $\\log_{{10}}({{\\rm C/O}})$ ({aperture_size} kpc)"
)

# Register the field
setattr(
self, f"gas_c_over_o_total_abundance_avglin_{aperture_size}_kpc", log_C_over_O
)
setattr(self, f"has_cold_dense_gas_{aperture_size}_kpc", mask)

# Loop over aperture average-of-log C/O-abundances
for aperture_size in aperture_sizes:

Expand Down
21 changes: 20 additions & 1 deletion colibre/scripts/stellar_abundances.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def read_data(data, xvar, yvar):
N_Fe_Sun = N_H_Sun_Asplund - Fe_H_Sun_Asplund - np.log10(mFe_in_cgs / mN_in_cgs)
O_Fe_Sun = O_H_Sun_Asplund - Fe_H_Sun_Asplund - np.log10(mFe_in_cgs / mO_in_cgs)
N_O_Sun = N_H_Sun_Asplund - O_H_Sun_Asplund - np.log10(mO_in_cgs / mN_in_cgs)
C_O_Sun = C_H_Sun_Asplund - O_H_Sun_Asplund - np.log10(mO_in_cgs / mC_in_cgs)
Mg_Fe_Sun = Mg_H_Sun_Asplund - Fe_H_Sun_Asplund - np.log10(mFe_in_cgs / mMg_in_cgs)

Si_Fe_Sun = Si_H_Sun_Asplund - Fe_H_Sun_Asplund - np.log10(mFe_in_cgs / mSi_in_cgs)
Expand All @@ -108,11 +109,13 @@ def read_data(data, xvar, yvar):
if yvar == "N_O":
nitrogen = data.stars.element_mass_fractions.nitrogen
oxygen = data.stars.element_mass_fractions.oxygen
if yvar == "C_O":
carbon = data.stars.element_mass_fractions.carbon
oxygen = data.stars.element_mass_fractions.oxygen
if yvar == "Mg_Fe":
magnesium = data.stars.element_mass_fractions.magnesium
if yvar == "Fe_SNIa_fraction":
iron_snia = data.stars.iron_mass_fractions_from_snia

if yvar == "Si_Fe":
silicon = data.stars.element_mass_fractions.silicon
if yvar == "Ne_Fe":
Expand Down Expand Up @@ -155,6 +158,12 @@ def read_data(data, xvar, yvar):
N_O[nitrogen == 0] = -2 # set lower limit
N_O[N_O < -2] = -2 # set lower limit
yval = N_O
elif yvar == "C_O":
C_O = np.log10(carbon / oxygen) - C_O_Sun
C_O[oxygen == 0] = -2 # set lower limit
C_O[carbon == 0] = -2 # set lower limit
C_O[C_O < -2] = -2 # set lower limit
yval = C_O
elif yvar == "O_Fe":
O_Fe = np.log10(oxygen / iron) - O_Fe_Sun
O_Fe[iron == 0] = -2 # set lower limit
Expand Down Expand Up @@ -291,6 +300,10 @@ def read_data(data, xvar, yvar):
observational_data = (
f"{path_to_obs_data}/data/StellarAbundances/APOGEE_data_NO.hdf5"
)
elif yvar == "C_O":
observational_data = (
f"{path_to_obs_data}/data/StellarAbundances/APOGEE_data_CO.hdf5"
)
elif yvar == "O_Fe":
observational_data = (
f"{path_to_obs_data}/data/StellarAbundances/APOGEE_data_O.hdf5"
Expand All @@ -314,6 +327,10 @@ def read_data(data, xvar, yvar):
observational_data = (
f"{path_to_obs_data}/data/StellarAbundances/APOGEE_data_NOOH.hdf5"
)
elif yvar == "C_O":
observational_data = (
f"{path_to_obs_data}/data/StellarAbundances/APOGEE_data_COOH.hdf5"
)
elif yvar == "Mg_Fe":
observational_data = (
f"{path_to_obs_data}/data/StellarAbundances/APOGEE_data_OHMGFE.hdf5"
Expand Down Expand Up @@ -451,6 +468,7 @@ def read_data(data, xvar, yvar):
"C_Fe": "[C/Fe]",
"N_Fe": "[N/Fe]",
"N_O": "[N/O]",
"C_O": "[C/O]",
"O_Fe": "[O/Fe]",
"Mg_Fe": "[Mg/Fe]",
"Si_Fe": "[Si/Fe]",
Expand All @@ -468,6 +486,7 @@ def read_data(data, xvar, yvar):
"C_Fe": (-1.5, 1.5),
"N_Fe": (-1.5, 1.5),
"N_O": (-1.5, 1.5),
"C_O": (-1.5, 1.5),
"O_Fe": (-1.5, 1.5),
"Mg_Fe": (-1.5, 2.0),
"Si_Fe": (-1.5, 2.0),
Expand Down

0 comments on commit 13650da

Please sign in to comment.