Beispiel #1
0
 def _setNiDecay(self):
     curOxWarn=self.oxWarn
     self.oxWarn=False
     ni,co,fe=abund.calcNiDecay(self.data['Ni0'],self.t)
     self.FeDecayed=fe
     self._setElement('Ni',ni)
     self._setElement('Co',co)
     self.oxWarn=curOxWarn
     self._setElement('Fe',self.data['Fe0']+fe)
Beispiel #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