Skip to content

Commit

Permalink
analysis.composite_indv_detect.main: Add det3 to handle cases without…
Browse files Browse the repository at this point in the history
… reliable emission lines (iss #21)
  • Loading branch information
astrochun committed Feb 11, 2020
1 parent 67fca6d commit 0eb57a3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Metallicity_Stack_Commons/analysis/composite_indv_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ..temp_metallicity_calc import metallicity_calculation


def main(fitspath, dataset, composite_file, outfile):
def main(fitspath, dataset, composite_file, outfile, det3=True):
"""
Purpose:
Reads in composite table(s) containing bin information to
Expand All @@ -18,6 +18,9 @@ def main(fitspath, dataset, composite_file, outfile):
:param dataset: str containing sub-folder (specific to stacking approach)
:param composite_file: str containing filename of composite data
:param outfile: str containing filename of output file
:param det3: Bool indies whether individual galaxy files is limited to
those satisfying emission-line det3 requirement
Default: True
"""

# Read in composite table
Expand All @@ -42,7 +45,15 @@ def main(fitspath, dataset, composite_file, outfile):
O3 = det3_table['O3'].data # [OIII]4959,5007 fluxes (Assume 3.1:1 ratio)
Hb = det3_table['Hb'].data # H-beta fluxes

com_O_log, metal_dict = metallicity_calculation(adopted_temp, O2/Hb, O3/Hb)
if det3 == True:
com_O_log, metal_dict = metallicity_calculation(adopted_temp, O2/Hb, O3/Hb)
else:
det3 = np.where(bin_table['Individual_Detections'])[0]
temp_com_O_log, temp_metal_dict = \
metallicity_calculation(adopted_temp[det3], O2[det3]/Hb[det3],
O3[det3]/Hb[det3])
com_O_log = np.zeros(len(det3_table))
com_O_log[det3] = temp_com_O_log

# Update [det3_table] to include two new columns
col_temp = Column(adopted_temp, name='Temperature')
Expand Down

0 comments on commit 0eb57a3

Please sign in to comment.