From b60a40f971df7dc3e6a87a3ccf22957a622c0207 Mon Sep 17 00:00:00 2001 From: Takahiro Morishita Date: Mon, 8 Aug 2022 12:33:37 -0700 Subject: [PATCH] Update function_class.py --- gsf/function_class.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gsf/function_class.py b/gsf/function_class.py index 7cc7b91..916953e 100644 --- a/gsf/function_class.py +++ b/gsf/function_class.py @@ -241,7 +241,7 @@ def open_spec_fits_dir(self, nage:int, nz:int, kk, Av00:float, zgal:float, A00:f return A00 * yyd_sort, xxd_sort - def get_template(self, lib, Amp:float = 1.0, T:float = 1.0, Av:float = 0.0, Z:float = 0.0, zgal:float = 1.0, f_bb:bool = False): + def get_template(self, lib, Amp:float = 1.0, T:float = 1.0, Av:float = 0.0, Z:float = 0.0, zgal:float = 1.0, f_bb:bool = False, fneb=False): ''' Gets an element template given a set of parameters. Not necessarily the most efficient way, but easy to use. @@ -282,7 +282,10 @@ def get_template(self, lib, Amp:float = 1.0, T:float = 1.0, Av:float = 0.0, Z:fl if T - self.age[nmodel] != 0: print('T=%.2f is not found in age library. T=%.2f is used.'%(T,self.age[nmodel])) - coln = int(2 + pp*len(self.ZZ)*len(self.AA) + NZ*len(self.AA) + nmodel) + if fneb: + coln = int(2 + pp*len(self.ZZ)*1 + NZ*1 + 0) + else: + coln = int(2 + pp*len(self.ZZ)*len(self.AA) + NZ*len(self.AA) + nmodel) nr = lib[:, 0] xx = lib[:, 1] # This is OBSERVED wavelength range at z=zgal yy = lib[:, coln] @@ -780,7 +783,7 @@ def open_spec_fits(self, fall:int=0, orig:bool=False): NT = self.MB.ntau NA = self.MB.nage for zz,Z in enumerate(ZZ): - for tt,TT in enumerate(self.MB.tau): + for tt,TT in enumerate(self.MB.tau): for ss,TA in enumerate(self.MB.ageparam): if zz == 0 and tt == 0 and ss == 0: nr = hdu0['colnum']