From 2368f245911f58e2e9a70064080e0076d353223a Mon Sep 17 00:00:00 2001 From: Caroline McCormick Date: Mon, 20 Jan 2020 11:54:57 -0700 Subject: [PATCH 1/2] Imported numpy as np. In dir_date, fixed string formatting for adding in the year to the file path. (from 'i%02i%02i' to '%02i') --- Metallicity_Stack_Commons/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Metallicity_Stack_Commons/__init__.py b/Metallicity_Stack_Commons/__init__.py index 82051f2..3f37c40 100644 --- a/Metallicity_Stack_Commons/__init__.py +++ b/Metallicity_Stack_Commons/__init__.py @@ -3,6 +3,7 @@ from datetime import date import os import getpass +import numpy as np version = "0.1.0" @@ -42,7 +43,7 @@ def exclude_outliers(objno): flag = np.zeros(len(objno), dtype=int) bad_data = np.array(['32007727', '32101412', '42006031', '32035286', '14023705']) for ii in range(len(bad_data)): - idx = [xx for xx in range(len(objno)) if bad_data[ii] == str(objno[xx])][0] + idx = [xx for xx in range(len(objno)) if bad_data[ii] == str(objno[xx])] flag[idx] = 1 return flag @@ -76,7 +77,7 @@ def dir_date(org_name, path_init='', year=False): list_path = [path_init, org_name, "%02i%02i" % (today.month, today.day), ''] if year: - list_path[-2] += "i%02i%02i" % today.year + list_path[-2] += "%02i" % today.year fitspath = os.path.join(*list_path) try: From 0ef778f506e76bb92620f781a03d0adfecee2608 Mon Sep 17 00:00:00 2001 From: Chun Ly Date: Thu, 30 Jan 2020 21:25:14 -0700 Subject: [PATCH 2/2] Add OIII flux ratio (iss #2) --- Metallicity_Stack_Commons/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Metallicity_Stack_Commons/__init__.py b/Metallicity_Stack_Commons/__init__.py index 82051f2..f3812ff 100644 --- a/Metallicity_Stack_Commons/__init__.py +++ b/Metallicity_Stack_Commons/__init__.py @@ -22,6 +22,9 @@ scalefact = 1e-17 +# Flux ratio of [OIII]5007 to [OIII]4959 +OIII_r = 3.1 + # Define k values for dust attenuation k_values = cardelli(lambda0 * u.Angstrom) k_dict = dict(zip(line_name,k_values))