Skip to content

Commit

Permalink
swapped mwdust.Combined15 to mwdust.Green15
Browse files Browse the repository at this point in the history
  • Loading branch information
danxhuber committed May 6, 2017
1 parent da91ecb commit ebdf5de
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions direct/classify_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def stparas(input,dnumodel=0,bcmodel=0,dustmodel=0,dnucor=0,useav=0,plot=0):
if (bcmodel == 0):
bcmodel = h5py.File('bcgrid.h5', 'r')
if (dustmodel == 0.):
dustmodel = mwdust.Combined15()
dustmodel = mwdust.Green15()

# object containing output values
out = resdata()
Expand Down Expand Up @@ -104,6 +104,7 @@ def stparas(input,dnumodel=0,bcmodel=0,dustmodel=0,dnucor=0,useav=0,plot=0):
lat_deg=gal.lat*180./np.pi

avs = 3.1*dustmodel(lon_deg,lat_deg,dsamp/1000.)
avs = np.zeros(len(dsamp))+useav
ext=avs*extfactors.ak
ext=0. # already in BC

Expand Down Expand Up @@ -374,6 +375,18 @@ def stparas(input,dnumodel=0,bcmodel=0,dustmodel=0,dnucor=0,useav=0,plot=0):
nit=0
while (nit < 5):

if (nit == 0.):
out.avs=0.0
else:
out.avs = 3.1*dustmodel(lon_deg,lat_deg,out.dis/1000.)[0]
#print lon_deg,lat_deg,out.dis

if (useav != 0.):
out.avs=useav
if (out.avs < 0.):
out.avs = 0.0
ext = out.avs*avtoext

# bolometric correction interpolated from MESA
interp = RegularGridInterpolator((np.array(bcmodel['teffgrid']),\
np.array(bcmodel['logggrid']),np.array(bcmodel['fehgrid']),\
Expand Down Expand Up @@ -402,18 +415,12 @@ def stparas(input,dnumodel=0,bcmodel=0,dustmodel=0,dnucor=0,useav=0,plot=0):
ddis=abs((olddis-out.dis)/out.dis)
#print olddis,out.dis,ddis,ext
olddis=out.dis

nit=nit+1
#print out.dis,out.avs

out.avs = 3.1*dustmodel(lon_deg,lat_deg,out.dis/1000.)[0]

if (useav != 0.):
out.avs=useav

if (out.avs < 0.):
out.avs = 0.0

#pdb.set_trace()
ext = out.avs*avtoext
nit=nit+1


#pdb.set_trace()
print 'Av(mag):',out.avs
Expand All @@ -422,6 +429,8 @@ def stparas(input,dnumodel=0,bcmodel=0,dustmodel=0,dnucor=0,useav=0,plot=0):

out.disep=out.dise
out.disem=out.dise

out.mabs=Mabs

return out

Expand Down Expand Up @@ -602,6 +611,8 @@ def __init__(self):
self.plxe = 0.
self.plxep = 0.
self.plxem = 0.

self.mabs = 0.

class extinction():
def __init__(self):
Expand Down

0 comments on commit ebdf5de

Please sign in to comment.