Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/composite_indv_detect2 -> develop #36

Merged
merged 1 commit into from
Apr 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions Metallicity_Stack_Commons/analysis/composite_indv_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
ID_name = indv_names0[0]
bin_ID_name = bin_names0[0]

logR23_name = indv_names0[1]
logO32_name = indv_names0[2]
two_beta_name = indv_names0[5]
three_beta_name = indv_names0[6]


def main(fitspath, dataset, revised=False, det3=True):
"""
Expand Down Expand Up @@ -94,11 +99,17 @@ def main(fitspath, dataset, revised=False, det3=True):

O2 = indv_em_line_table['OII_3727_Flux_Gaussian'].data # [OII]3726,3728 fluxes
O3 = indv_em_line_table['OIII_5007_Flux_Gaussian'].data # [OIII]5007 fluxes
O3 = O3 * (1+1/OIII_r) #Scale to include OIII4959; Assume 3.1:1 ratio
O3 = O3 * (1+1/OIII_r) # Scale to include OIII4959; Assume 3.1:1 ratio
Hb = indv_em_line_table['HBETA_Flux_Gaussian'].data # H-beta fluxes

two_beta = O2/Hb
three_beta = O3/Hb
logR23 = np.log10(two_beta + three_beta)
logO32 = np.log10(O3/O2)

if not det3:
com_O_log, metal_dict = metallicity_calculation(adopted_temp, O2/Hb, O3/Hb)
com_O_log, metal_dict = \
metallicity_calculation(adopted_temp, two_beta, three_beta)
else:
det3 = np.where((detect_indv == 1.0) | (detect_indv == 0.5))[0]
temp_com_O_log, temp_metal_dict = \
Expand All @@ -114,8 +125,10 @@ def main(fitspath, dataset, revised=False, det3=True):

# Define [indv_derived_prop_table] to include ID, bin_ID, composite T_e,
# and 12+log(O/H)
arr0 = [indv_em_line_table[ID_name], bin_id_indv, adopted_temp, com_O_log]
names0 = [ID_name, bin_ID_name] + temp_metal_names0[:2]
arr0 = [indv_em_line_table[ID_name], bin_id_indv, logR23, logO32,
two_beta, three_beta, adopted_temp, com_O_log]
names0 = [ID_name, bin_ID_name, logR23_name, logO32_name, two_beta_name,
three_beta_name] + temp_metal_names0[:2]

# Include other metallicities
arr0 += list(metal_dict.values())
Expand Down