Exemple #1
0
def initLumVphGrid(step=1,gridSize=10,doPickle=True):
    t=config.getTimeFromExplosion()
    vph=initialize.time2vph(t)
    mainConfigDir=config.getMainConfigDir()
    
    modelW7=initialize.readW7Data(os.path.join(mainConfigDir,'w7.combined.dat'))
    initDica=config.getVanillaDica()
    initDica['t']=t
    #Preparing the normalization
    initComp=config.getVanillaComp()
    initComp.update(initialize.getW7Comp(modelW7,t))
    initComp=abund.setNiDecay(initComp,t)
    initComp=abund.setCONe(initComp)
    initComp=abund.normAbundances(initComp)
    initRunDir='init_lumvph_run/'
    initialVph=[0.6*vph,1.4*vph]
    return lumVphGrid(initialLum,initialVph,1,initRunDir,initComp=initComp,initDica=initDica,gridSize=gridSize,doPickle=doPickle)
Exemple #2
0
 def __init__(self,initComp=None, t=None, mode='initW7'):
     if t == None:
         assert SNConfigDict != None
         self.t = SNConfigDict['t']
     
     else: self.t = t
     self.autoOxyCorr=True
     self.decayNi=True
     self.lockTiCr=False
     self.lockScTi=False
     self.lockVCr=False
     self.TiCrSet=set(('Ti','Cr'))
     self.ScTiSet=set(('Sc','Ti'))
     self.lockIGEwoNi=False
     self.lockIGEwNi=False
     self.lockIGE=False
     self.oxWarn=True
     self.autoRelAbund=None
     self.keepElementRel=False
     
     self.VCrSet=set(('V','Cr'))
     self.IGEwoNiSet=set(('Sc','Ti','V','Cr','Mn','Cu','Zn'))
     self.IGEwNiSet=self.IGEwoNiSet.union(['Ni0'])
     self.IGESet=self.IGEwNiSet.union(['Fe0'])
     self.data={'Al': 0.0,
                'Ar': 0.0,
                'B': 0.0,
                'Be': 0.0,
                'C': 0.0,
                'Ca': 0.0, 
                'Cl': 0.0,
                'Co': 0.0,
                'Cr': 0.0,
                'Cu': 0.0,
                'F': 0.0,
                'Fe': 0.0,
                'H': 0.0,
                'He': 0.0,
                'K': 0.0,
                'Li': 0.0,
                'Mg': 0.0,
                'Mn': 0.0,
                'N': 0.0,
                'Na': 0.0,
                'Ne': 0.0,
                'Ni': 0.0,
                'O': 0.0,
                'P': 0.0,
                'S': 0.0,
                'Sc': 0.0,
                'Si': 0.0,
                'Ti': 0.0,
                'V': 0.0,
                'Zn': 0.0,
                'Ni0':0.0,
                'Fe0':0.0}
     self.FeDecayed=0.0
     if initComp!=None:
         self.data.update(initComp)
         if self.data['Ni0']==0.0 and self.data['Fe0']==0.0:
             print "Calculating Ni0 and Fe0"
             curNi,curCo,curFe=self.data['Ni'],self.data['Co'],self.data['Fe']
             curSum=np.sum((curNi,curCo,curFe))
             decNi,decCo,decFe=abund.calcNiDecay(curSum,self.t)
             factorNi=curSum/decNi
             self['Ni0']=curNi*factorNi
             self['Fe0']=curFe-self['Fe']
             if self['Fe0']<0: raise Exception('Problems while calculating Ni0 and Fe0')
             
     elif mode=='initW7':
         self.data.update(initialize.getW7Comp(t=self.t))
         self.Fe0=self.data['Fe']
         curAutoOxyCorr=self.autoOxyCorr
         self.autoOxyCorr=False
         self._setNiDecay()
         self.resetOxygen()
         self.autoOxyCorr=curAutoOxyCorr
Exemple #3
0
def getInitComp(model="w7"):
    if model == "w7":
        w7Data = initialize.readW7Data()
        initialize.getW7Comp(w7Data)