def _add_nucl_list(self, nucl_list): sample_elt = nucl_list[0] if utils.is_name(sample_elt): nucl_list = utils.name_list_to_zamid_list(nucl_list) current_nucl_list = self.nucl_list new_extra_nuclides = list(set(nucl_list) - set(current_nucl_list)) new_extra_passport_list = self.get_passport_list(new_extra_nuclides) self._set_mass(new_extra_passport_list) self._set_zero_dens(new_extra_passport_list) for nucl_pass in new_extra_passport_list: self.passport_list.append(nucl_pass) self.nucl_list.append(nucl_pass.zamid)
def __init__(self, *nucl_list): self._nucl_list = None self._passport_list = None if nucl_list: nucl_list = nucl_list[0] sample_elt = nucl_list[0] if utils.is_name(sample_elt): nucl_list = utils.name_list_to_zamid_list(nucl_list) passport_list = self.get_passport_list(nucl_list) self._nucl_list = nucl_list self._passport_list = passport_list self._set_mass(passport_list) self.zam_order_passport_list() self._set_zero_dens(passport_list)
def _set_initial_dens(self, dens_dict): sample_key = list(dens_dict.keys())[0] passport_list = self.passport_list for i in range(len(passport_list)): nuc_pass = passport_list[i] if utils.is_zamid(sample_key): zamid = nuc_pass.zamid if zamid in dens_dict: dens = dens_dict[zamid] nuc_pass._set_initial_dens(dens) else: nuc_pass._set_initial_dens(0.0) elif utils.is_name(sample_key): name = nuc_pass.name if name in dens_dict: dens = dens_dict[name] nuc_pass._set_initial_dens(dens) else: nuc_pass._set_initial_dens(0.0)