Skip to content

Commit

Permalink
Update function_class.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mtakahiro committed Aug 8, 2022
1 parent e9916d4 commit b60a40f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gsf/function_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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']
Expand Down

0 comments on commit b60a40f

Please sign in to comment.