Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
temp_dict = OrderedDict()
for e in element_list:
if e == "":
pass
elif '-' in e: # pileup peaks
e1, e2 = e.split('-')
energy = float(get_energy(e1))+float(get_energy(e2))
ps = PreFitStatus(z=get_Z(e),
energy=str(energy), norm=1)
temp_dict[e] = ps
else:
ename = e.split('_')[0]
ps = PreFitStatus(z=get_Z(ename),
energy=get_energy(e),
norm=1)
temp_dict[e] = ps
self.EC.add_to_dict(temp_dict)
def create_EC_list(self, element_list):
temp_dict = OrderedDict()
for e in element_list:
if e == "":
pass
elif '-' in e: # pileup peaks
e1, e2 = e.split('-')
energy = float(get_energy(e1))+float(get_energy(e2))
ps = PreFitStatus(z=get_Z(e),
energy=str(energy), norm=1)
temp_dict[e] = ps
else:
ename = e.split('_')[0]
ps = PreFitStatus(z=get_Z(ename),
energy=get_energy(e),
norm=1)
temp_dict[e] = ps
self.EC.add_to_dict(temp_dict)