Public Member Functions | |
def | __init__ |
def | __str__ |
def | excitedState |
def | load |
Public Attributes | |
Z | |
A | |
states | |
name |
Definition at line 59 of file g4data.py.
def GenDecay::g4data::NuclideData::__init__ | ( | self, | ||
z, | ||||
a | ||||
) |
def GenDecay::g4data::NuclideData::__str__ | ( | self | ) |
def GenDecay::g4data::NuclideData::excitedState | ( | self, | ||
nucexenergy = 0.0 | ||||
) |
def GenDecay::g4data::NuclideData::load | ( | self | ) |
Definition at line 85 of file g4data.py.
00085 : 00086 import os 00087 dir = os.getenv('G4RADIOACTIVEDATA') 00088 if dir is None: 00089 raise EnvironmentError,'No G4RADIOACTIVEDATA variable, can not find data for Z=%d, A=%d'%(self.Z,self.A) 00090 file = dir + '/z%d.a%d'%(self.Z,self.A) 00091 file = open(file) 00092 types_seen = {} 00093 for line in file.readlines(): 00094 line = line.strip() 00095 #print line 00096 00097 # skip comments 00098 if line[0] == '#': continue 00099 00100 # parent 00101 if line[0] == 'P': 00102 self.states.append(NuclideState(self.name)) 00103 types_seen = {} 00104 p,ex,hl = line.split() 00105 self.states[-1].excitation = float(ex) 00106 self.states[-1].halflife = float(hl)*units.second 00107 continue 00108 00109 # warning 00110 if line[0] == 'W': 00111 #print line 00112 continue 00113 00114 # now parsing data 00115 chunks = line.split() 00116 00117 # skip first total BR for type 00118 if not types_seen.has_key(chunks[0]): 00119 types_seen[chunks[0]] = float(chunks[2]) 00120 continue 00121 00122 dk = NuclideDecay(chunks[0],float(chunks[2])/100.0, 00123 float(chunks[3])*units.keV,float(chunks[1])*units.keV) 00124 import decay 00125 if dk.type == 'Alpha': 00126 dk.daughterZ = self.Z - 2 00127 dk.daughterA = self.A - 4 00128 dk.radiation = decay.AlphaDecay(dk.qvalue,self.Z) 00129 elif dk.type == 'BetaMinus': 00130 dk.daughterZ = self.Z + 1 00131 dk.daughterA = self.A 00132 dk.radiation = decay.BetaDecay(dk.qvalue,self.Z) 00133 elif dk.type == 'BetaPlus': 00134 dk.daughterZ = self.Z - 1 00135 dk.daughterA = self.A 00136 dk.radiation = decay.BetaDecay(dk.qvalue,-1*self.Z) 00137 else: 00138 print 'Warning - not yet supported decay type: %s'%dk.type 00139 continue 00140 00141 self.states[-1].decays.append(dk) 00142 continue 00143 return 00144 00145 pass